/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInputDevice.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/midi/MidiInputDevice.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 880 by schoenebeck, Tue Jun 27 22:57:37 2006 UTC revision 1295 by iliev, Mon Aug 13 20:05:56 2007 UTC
# Line 23  Line 23 
23    
24  #include "MidiInputDevice.h"  #include "MidiInputDevice.h"
25    
26    #include "../../Sampler.h"
27    
28  namespace LinuxSampler {  namespace LinuxSampler {
29    
30  // *************** ParameterActive ***************  // *************** ParameterActive ***************
# Line 109  namespace LinuxSampler { Line 111  namespace LinuxSampler {
111      }      }
112    
113      void MidiInputDevice::ParameterPorts::OnSetValue(int i) throw (Exception) {      void MidiInputDevice::ParameterPorts::OnSetValue(int i) throw (Exception) {
114            MidiInputDevice* dev = static_cast<MidiInputDevice*> (pDevice);
115            Sampler* s = static_cast<Sampler*> (dev->pSampler);
116            std::map<uint, SamplerChannel*> channels = s->GetSamplerChannels();
117            std::map<uint, SamplerChannel*>::iterator iter = channels.begin();
118            for (; iter != channels.end(); iter++) {
119                SamplerChannel* chn = iter->second;
120                if (chn->GetMidiInputDevice() == NULL || chn->GetMidiInputDevice() != pDevice) {
121                    continue;
122                }
123                
124                int port = chn->GetMidiInputPort();
125                if (port >= i) {
126                    String err = "Sampler channel " + ToString(iter->first);
127                    err += " is still connected to MIDI port " + ToString(port);
128                    throw Exception(err);
129                }
130            }
131            
132          ((MidiInputDevice*)pDevice)->AcquirePorts(i);          ((MidiInputDevice*)pDevice)->AcquirePorts(i);
133      }      }
134    

Legend:
Removed from v.880  
changed lines
  Added in v.1295

  ViewVC Help
Powered by ViewVC