53 |
Mutex LSCPServer::SubscriptionMutex = Mutex(); |
Mutex LSCPServer::SubscriptionMutex = Mutex(); |
54 |
Mutex LSCPServer::RTNotifyMutex = Mutex(); |
Mutex LSCPServer::RTNotifyMutex = Mutex(); |
55 |
|
|
56 |
LSCPServer::LSCPServer(Sampler* pSampler) : Thread(false, 0, -4) { |
LSCPServer::LSCPServer(Sampler* pSampler) : Thread(true, false, 0, -4) { |
57 |
this->pSampler = pSampler; |
this->pSampler = pSampler; |
58 |
LSCPEvent::RegisterEvent(LSCPEvent::event_channels, "CHANNELS"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_channels, "CHANNELS"); |
59 |
LSCPEvent::RegisterEvent(LSCPEvent::event_voice_count, "VOICE_COUNT"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_voice_count, "VOICE_COUNT"); |
454 |
if (bBackground) { |
if (bBackground) { |
455 |
InstrumentLoader.StartNewLoad(Filename, uiInstrument, pEngine); |
InstrumentLoader.StartNewLoad(Filename, uiInstrument, pEngine); |
456 |
} |
} |
457 |
else pEngine->LoadInstrument(Filename.c_str(), uiInstrument); |
else { |
458 |
|
// tell the engine which instrument to load |
459 |
|
pEngine->PrepareLoadInstrument(Filename.c_str(), uiInstrument); |
460 |
|
// actually start to load the instrument (blocks until completed) |
461 |
|
pEngine->LoadInstrument(); |
462 |
|
} |
463 |
} |
} |
464 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
465 |
result.Error(e); |
result.Error(e); |