127 |
LSCPEvent::RegisterEvent(LSCPEvent::event_db_instr_info, "DB_INSTRUMENT_INFO"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_db_instr_info, "DB_INSTRUMENT_INFO"); |
128 |
LSCPEvent::RegisterEvent(LSCPEvent::event_db_instrs_job_info, "DB_INSTRUMENTS_JOB_INFO"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_db_instrs_job_info, "DB_INSTRUMENTS_JOB_INFO"); |
129 |
LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS"); |
130 |
|
LSCPEvent::RegisterEvent(LSCPEvent::event_total_stream_count, "TOTAL_STREAM_COUNT"); |
131 |
LSCPEvent::RegisterEvent(LSCPEvent::event_total_voice_count, "TOTAL_VOICE_COUNT"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_total_voice_count, "TOTAL_VOICE_COUNT"); |
132 |
LSCPEvent::RegisterEvent(LSCPEvent::event_global_info, "GLOBAL_INFO"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_global_info, "GLOBAL_INFO"); |
133 |
hSocket = -1; |
hSocket = -1; |
189 |
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_voice_count, NewCount)); |
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_voice_count, NewCount)); |
190 |
} |
} |
191 |
|
|
192 |
|
void LSCPServer::EventHandler::TotalStreamCountChanged(int NewCount) { |
193 |
|
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_total_stream_count, NewCount)); |
194 |
|
} |
195 |
|
|
196 |
#if HAVE_SQLITE3 |
#if HAVE_SQLITE3 |
197 |
void LSCPServer::DbInstrumentsEventHandler::DirectoryCountChanged(String Dir) { |
void LSCPServer::DbInstrumentsEventHandler::DirectoryCountChanged(String Dir) { |
198 |
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_count, InstrumentsDb::toEscapedPath(Dir))); |
LSCPServer::SendLSCPNotify(LSCPEvent(LSCPEvent::event_db_instr_dir_count, InstrumentsDb::toEscapedPath(Dir))); |
289 |
pSampler->AddVoiceCountListener(&eventHandler); |
pSampler->AddVoiceCountListener(&eventHandler); |
290 |
pSampler->AddStreamCountListener(&eventHandler); |
pSampler->AddStreamCountListener(&eventHandler); |
291 |
pSampler->AddBufferFillListener(&eventHandler); |
pSampler->AddBufferFillListener(&eventHandler); |
292 |
|
pSampler->AddTotalStreamCountListener(&eventHandler); |
293 |
pSampler->AddTotalVoiceCountListener(&eventHandler); |
pSampler->AddTotalVoiceCountListener(&eventHandler); |
294 |
pSampler->AddFxSendCountListener(&eventHandler); |
pSampler->AddFxSendCountListener(&eventHandler); |
295 |
MidiInstrumentMapper::AddMidiInstrumentCountListener(&eventHandler); |
MidiInstrumentMapper::AddMidiInstrumentCountListener(&eventHandler); |
446 |
NotifyMutex.Unlock(); |
NotifyMutex.Unlock(); |
447 |
} |
} |
448 |
|
|
449 |
|
void LSCPServer::LockRTNotify() { |
450 |
|
RTNotifyMutex.Lock(); |
451 |
|
} |
452 |
|
|
453 |
|
void LSCPServer::UnlockRTNotify() { |
454 |
|
RTNotifyMutex.Unlock(); |
455 |
|
} |
456 |
|
|
457 |
int LSCPServer::EventSubscribers( std::list<LSCPEvent::event_t> events ) { |
int LSCPServer::EventSubscribers( std::list<LSCPEvent::event_t> events ) { |
458 |
int subs = 0; |
int subs = 0; |
459 |
SubscriptionMutex.Lock(); |
SubscriptionMutex.Lock(); |
2361 |
} |
} |
2362 |
|
|
2363 |
/** |
/** |
2364 |
|
* Will be called by the parser to return the current number of all active streams. |
2365 |
|
*/ |
2366 |
|
String LSCPServer::GetTotalStreamCount() { |
2367 |
|
dmsg(2,("LSCPServer: GetTotalStreamCount()\n")); |
2368 |
|
LSCPResultSet result; |
2369 |
|
result.Add(pSampler->GetDiskStreamCount()); |
2370 |
|
return result.Produce(); |
2371 |
|
} |
2372 |
|
|
2373 |
|
/** |
2374 |
* Will be called by the parser to return the current number of all active voices. |
* Will be called by the parser to return the current number of all active voices. |
2375 |
*/ |
*/ |
2376 |
String LSCPServer::GetTotalVoiceCount() { |
String LSCPServer::GetTotalVoiceCount() { |
2553 |
if ( win32FileAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { |
if ( win32FileAttributeData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) { |
2554 |
throw Exception("Directory is specified"); |
throw Exception("Directory is specified"); |
2555 |
} |
} |
2556 |
#else |
#else |
2557 |
struct stat statBuf; |
struct stat statBuf; |
2558 |
int res = stat(Filename.c_str(), &statBuf); |
int res = stat(Filename.c_str(), &statBuf); |
2559 |
if (res) { |
if (res) { |