/[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 411 by schoenebeck, Sat Feb 26 02:01:14 2005 UTC revision 551 by schoenebeck, Tue May 17 18:16:54 2005 UTC
# Line 49  namespace LinuxSampler { Line 49  namespace LinuxSampler {
49          if (pEngineChannel) {          if (pEngineChannel) {
50              MidiInputPort* pMidiInputPort = GetMidiInputDevicePort(this->midiPort);              MidiInputPort* pMidiInputPort = GetMidiInputDevicePort(this->midiPort);
51              if (pMidiInputPort) pMidiInputPort->Disconnect(pEngineChannel);              if (pMidiInputPort) pMidiInputPort->Disconnect(pEngineChannel);
52              if (pAudioOutputDevice) pAudioOutputDevice->Disconnect(pEngineChannel);              if (pEngineChannel) {
53              delete pEngineChannel;                  if (pAudioOutputDevice) pEngineChannel->DisconnectAudioOutputDevice();
54                    delete pEngineChannel;
55                }
56          }          }
57      }      }
58    
# Line 66  namespace LinuxSampler { Line 68  namespace LinuxSampler {
68          // disconnect old engine          // disconnect old engine
69          if (pEngineChannel) {          if (pEngineChannel) {
70              if (pMidiInputPort) pMidiInputPort->Disconnect(pEngineChannel);              if (pMidiInputPort) pMidiInputPort->Disconnect(pEngineChannel);
71              if (pAudioOutputDevice) pAudioOutputDevice->Disconnect(pEngineChannel);              if (pAudioOutputDevice) pEngineChannel->DisconnectAudioOutputDevice();
72              delete pEngineChannel;              delete pEngineChannel;
73          }          }
74    
75          // connect new engine channel          // connect new engine channel
76          pEngineChannel = pNewEngineChannel;          pEngineChannel = pNewEngineChannel;
77          if (pMidiInputPort) pMidiInputPort->Connect(pNewEngineChannel, this->midiChannel);          if (pMidiInputPort) pMidiInputPort->Connect(pNewEngineChannel, this->midiChannel);
78          if (pAudioOutputDevice) pAudioOutputDevice->Connect(pNewEngineChannel);          if (pAudioOutputDevice) {
79                pNewEngineChannel->Connect(pAudioOutputDevice);
80                pAudioOutputDevice->Connect(pNewEngineChannel->GetEngine());
81            }
82          dmsg(2,("OK\n"));          dmsg(2,("OK\n"));
83      }      }
84    
85      void SamplerChannel::SetAudioOutputDevice(AudioOutputDevice* pDevice) {      void SamplerChannel::SetAudioOutputDevice(AudioOutputDevice* pDevice) {
86          // disconnect old device          // disconnect old device
87          if (pAudioOutputDevice && pEngineChannel) pAudioOutputDevice->Disconnect(pEngineChannel);          if (pAudioOutputDevice && pEngineChannel) pEngineChannel->DisconnectAudioOutputDevice();
88          // connect new device          // connect new device
89          pAudioOutputDevice = pDevice;          pAudioOutputDevice = pDevice;
90          if (pEngineChannel) pAudioOutputDevice->Connect(pEngineChannel);          if (pEngineChannel) {
91                pEngineChannel->Connect(pAudioOutputDevice);
92                pAudioOutputDevice->Connect(pEngineChannel->GetEngine());
93            }
94      }      }
95    
96      void SamplerChannel::SetMidiInputDevice(MidiInputDevice* pDevice) {      void SamplerChannel::SetMidiInputDevice(MidiInputDevice* pDevice) {
# Line 308  namespace LinuxSampler { Line 316  namespace LinuxSampler {
316    
317      MidiInputDevice* Sampler::CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException) {      MidiInputDevice* Sampler::CreateMidiInputDevice(String MidiDriver, std::map<String,String> Parameters) throw (LinuxSamplerException) {
318          // create new device          // create new device
319          MidiInputDevice* pDevice = MidiInputDeviceFactory::Create(MidiDriver, Parameters);          MidiInputDevice* pDevice = MidiInputDeviceFactory::Create(MidiDriver, Parameters, this);
320    
321          // add new device to the midi device list          // add new device to the midi device list
322          for (uint i = 0; ; i++) { // seek for a free place starting from the beginning          for (uint i = 0; ; i++) { // seek for a free place starting from the beginning

Legend:
Removed from v.411  
changed lines
  Added in v.551

  ViewVC Help
Powered by ViewVC