27 |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
#include "drivers/audio/AudioOutputDeviceFactory.h" |
28 |
#include "drivers/midi/MidiInputDeviceFactory.h" |
#include "drivers/midi/MidiInputDeviceFactory.h" |
29 |
#include "engines/gig/Engine.h" |
#include "engines/gig/Engine.h" |
30 |
|
#include "network/lscpserver.h" |
31 |
|
|
32 |
namespace LinuxSampler { |
namespace LinuxSampler { |
33 |
|
|
182 |
if (!mSamplerChannels.size()) { |
if (!mSamplerChannels.size()) { |
183 |
SamplerChannel* pChannel = new SamplerChannel(this); |
SamplerChannel* pChannel = new SamplerChannel(this); |
184 |
mSamplerChannels[0] = pChannel; |
mSamplerChannels[0] = pChannel; |
185 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_channels, 1)); |
186 |
return pChannel; |
return pChannel; |
187 |
} |
} |
188 |
|
|
197 |
// we found an unused index, so insert the new channel there |
// we found an unused index, so insert the new channel there |
198 |
SamplerChannel* pChannel = new SamplerChannel(this); |
SamplerChannel* pChannel = new SamplerChannel(this); |
199 |
mSamplerChannels[i] = pChannel; |
mSamplerChannels[i] = pChannel; |
200 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_channels, i)); |
201 |
return pChannel; |
return pChannel; |
202 |
} |
} |
203 |
throw LinuxSamplerException("Internal error: could not find unoccupied sampler channel index."); |
throw LinuxSamplerException("Internal error: could not find unoccupied sampler channel index."); |
206 |
// we have not reached the index limit so we just add the channel past the highest index |
// we have not reached the index limit so we just add the channel past the highest index |
207 |
SamplerChannel* pChannel = new SamplerChannel(this); |
SamplerChannel* pChannel = new SamplerChannel(this); |
208 |
mSamplerChannels[lastIndex + 1] = pChannel; |
mSamplerChannels[lastIndex + 1] = pChannel; |
209 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_channels, lastIndex + 1)); |
210 |
return pChannel; |
return pChannel; |
211 |
} |
} |
212 |
|
|
224 |
if (iterChan->second == pSamplerChannel) { |
if (iterChan->second == pSamplerChannel) { |
225 |
mSamplerChannels.erase(iterChan); |
mSamplerChannels.erase(iterChan); |
226 |
delete pSamplerChannel; |
delete pSamplerChannel; |
227 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_channels, mSamplerChannels.size())); |
228 |
return; |
return; |
229 |
} |
} |
230 |
} |
} |