/[svn]/linuxsampler/trunk/src/Sampler.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/Sampler.cpp

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

revision 1686 by schoenebeck, Thu Feb 14 14:58:50 2008 UTC revision 1695 by schoenebeck, Sat Feb 16 01:09:33 2008 UTC
# Line 318  namespace LinuxSampler { Line 318  namespace LinuxSampler {
318          }          }
319      }      }
320    
321        void Sampler::fireMidiDeviceToBeDestroyed(MidiInputDevice* pDevice) {
322            for (int i = 0; i < llMidiDeviceCountListeners.GetListenerCount(); i++) {
323                llMidiDeviceCountListeners.GetListener(i)->MidiDeviceToBeDestroyed(pDevice);
324            }
325        }
326    
327        void Sampler::fireMidiDeviceCreated(MidiInputDevice* pDevice) {
328            for (int i = 0; i < llMidiDeviceCountListeners.GetListenerCount(); i++) {
329                llMidiDeviceCountListeners.GetListener(i)->MidiDeviceCreated(pDevice);
330            }
331        }
332    
333      void Sampler::AddVoiceCountListener(VoiceCountListener* l) {      void Sampler::AddVoiceCountListener(VoiceCountListener* l) {
334          llVoiceCountListeners.AddListener(l);          llVoiceCountListeners.AddListener(l);
335      }      }
# Line 559  namespace LinuxSampler { Line 571  namespace LinuxSampler {
571                  for (uint i = 0; i < SamplerChannels(); i++)                  for (uint i = 0; i < SamplerChannels(); i++)
572                      if (GetSamplerChannel(i)->GetMidiInputDevice() == pDevice) throw Exception("Sampler channel " + ToString(i) + " is still connected to the midi input device.");                      if (GetSamplerChannel(i)->GetMidiInputDevice() == pDevice) throw Exception("Sampler channel " + ToString(i) + " is still connected to the midi input device.");
573    
574                    fireMidiDeviceToBeDestroyed(pDevice);
575    
576                  // disable device                  // disable device
577                  pDevice->StopListen();                  pDevice->StopListen();
578    
# Line 586  namespace LinuxSampler { Line 600  namespace LinuxSampler {
600                  }                  }
601          }          }
602    
603            fireMidiDeviceCreated(pDevice);
604          fireMidiDeviceCountChanged(MidiInputDevices());          fireMidiDeviceCountChanged(MidiInputDevices());
605          return pDevice;          return pDevice;
606      }      }

Legend:
Removed from v.1686  
changed lines
  Added in v.1695

  ViewVC Help
Powered by ViewVC