68 |
LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_buffer_fill, "BUFFER_FILL"); |
69 |
LSCPEvent::RegisterEvent(LSCPEvent::event_info, "INFO"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_info, "INFO"); |
70 |
LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS"); |
LSCPEvent::RegisterEvent(LSCPEvent::event_misc, "MISCELLANEOUS"); |
71 |
|
hSocket = -1; |
72 |
|
} |
73 |
|
|
74 |
|
LSCPServer::~LSCPServer() { |
75 |
|
if (hSocket >= 0) close(hSocket); |
76 |
} |
} |
77 |
|
|
78 |
/** |
/** |
90 |
} |
} |
91 |
|
|
92 |
int LSCPServer::Main() { |
int LSCPServer::Main() { |
93 |
int hSocket = socket(AF_INET, SOCK_STREAM, 0); |
hSocket = socket(AF_INET, SOCK_STREAM, 0); |
94 |
if (hSocket < 0) { |
if (hSocket < 0) { |
95 |
std::cerr << "LSCPServer: Could not create server socket." << std::endl; |
std::cerr << "LSCPServer: Could not create server socket." << std::endl; |
96 |
//return -1; |
//return -1; |
173 |
int dummy; // just a temporary hack to fulfill the restart() function prototype |
int dummy; // just a temporary hack to fulfill the restart() function prototype |
174 |
restart(NULL, dummy); // restart the 'scanner' |
restart(NULL, dummy); // restart the 'scanner' |
175 |
currentSocket = (*iter).hSession; //a hack |
currentSocket = (*iter).hSession; //a hack |
176 |
|
dmsg(2,("LSCPServer: [%s]\n",bufferedCommands[currentSocket].c_str())); |
177 |
if ((*iter).bVerbose) { // if echo mode enabled |
if ((*iter).bVerbose) { // if echo mode enabled |
178 |
AnswerClient(bufferedCommands[currentSocket]); |
AnswerClient(bufferedCommands[currentSocket]); |
179 |
} |
} |
487 |
String LSCPServer::SetEngineType(String EngineName, uint uiSamplerChannel) { |
String LSCPServer::SetEngineType(String EngineName, uint uiSamplerChannel) { |
488 |
dmsg(2,("LSCPServer: LoadEngine(EngineName=%s,SamplerChannel=%d)\n", EngineName.c_str(), uiSamplerChannel)); |
dmsg(2,("LSCPServer: LoadEngine(EngineName=%s,SamplerChannel=%d)\n", EngineName.c_str(), uiSamplerChannel)); |
489 |
LSCPResultSet result; |
LSCPResultSet result; |
490 |
try { |
try { |
491 |
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
SamplerChannel* pSamplerChannel = pSampler->GetSamplerChannel(uiSamplerChannel); |
492 |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
if (!pSamplerChannel) throw LinuxSamplerException("Invalid sampler channel number " + ToString(uiSamplerChannel)); |
493 |
LockRTNotify(); |
LockRTNotify(); |
599 |
int AudioOutputChannels = 0; |
int AudioOutputChannels = 0; |
600 |
String AudioRouting; |
String AudioRouting; |
601 |
|
|
602 |
if (pEngineChannel) { |
if (pEngineChannel) { |
603 |
EngineName = pEngineChannel->GetEngine()->EngineName(); |
EngineName = pEngineChannel->EngineName(); |
604 |
AudioOutputChannels = pEngineChannel->Channels(); |
AudioOutputChannels = pEngineChannel->Channels(); |
605 |
Volume = pEngineChannel->Volume(); |
Volume = pEngineChannel->Volume(); |
606 |
InstrumentStatus = pEngineChannel->InstrumentStatus(); |
InstrumentStatus = pEngineChannel->InstrumentStatus(); |