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 (pAudioOutputDevice) pEngineChannel->DisconnectAudioOutputDevice(); |
53 |
delete pEngineChannel; |
delete pEngineChannel; |
54 |
} |
} |
55 |
} |
} |
66 |
// disconnect old engine |
// disconnect old engine |
67 |
if (pEngineChannel) { |
if (pEngineChannel) { |
68 |
if (pMidiInputPort) pMidiInputPort->Disconnect(pEngineChannel); |
if (pMidiInputPort) pMidiInputPort->Disconnect(pEngineChannel); |
69 |
if (pAudioOutputDevice) pAudioOutputDevice->Disconnect(pEngineChannel); |
if (pAudioOutputDevice) pEngineChannel->DisconnectAudioOutputDevice(); |
70 |
delete pEngineChannel; |
delete pEngineChannel; |
71 |
} |
} |
72 |
|
|
73 |
// connect new engine channel |
// connect new engine channel |
74 |
pEngineChannel = pNewEngineChannel; |
pEngineChannel = pNewEngineChannel; |
75 |
if (pMidiInputPort) pMidiInputPort->Connect(pNewEngineChannel, this->midiChannel); |
if (pMidiInputPort) pMidiInputPort->Connect(pNewEngineChannel, this->midiChannel); |
76 |
if (pAudioOutputDevice) pAudioOutputDevice->Connect(pNewEngineChannel); |
if (pAudioOutputDevice) { |
77 |
|
pNewEngineChannel->Connect(pAudioOutputDevice); |
78 |
|
pAudioOutputDevice->Connect(pNewEngineChannel->GetEngine()); |
79 |
|
} |
80 |
dmsg(2,("OK\n")); |
dmsg(2,("OK\n")); |
81 |
} |
} |
82 |
|
|
83 |
void SamplerChannel::SetAudioOutputDevice(AudioOutputDevice* pDevice) { |
void SamplerChannel::SetAudioOutputDevice(AudioOutputDevice* pDevice) { |
84 |
// disconnect old device |
// disconnect old device |
85 |
if (pAudioOutputDevice && pEngineChannel) pAudioOutputDevice->Disconnect(pEngineChannel); |
if (pAudioOutputDevice && pEngineChannel) pEngineChannel->DisconnectAudioOutputDevice(); |
86 |
// connect new device |
// connect new device |
87 |
pAudioOutputDevice = pDevice; |
pAudioOutputDevice = pDevice; |
88 |
if (pEngineChannel) pAudioOutputDevice->Connect(pEngineChannel); |
if (pEngineChannel) { |
89 |
|
pEngineChannel->Connect(pAudioOutputDevice); |
90 |
|
pAudioOutputDevice->Connect(pEngineChannel->GetEngine()); |
91 |
|
} |
92 |
} |
} |
93 |
|
|
94 |
void SamplerChannel::SetMidiInputDevice(MidiInputDevice* pDevice) { |
void SamplerChannel::SetMidiInputDevice(MidiInputDevice* pDevice) { |