147 |
if (FD_ISSET((*iter).hSession, &selectSet)) { //Was it this socket? |
if (FD_ISSET((*iter).hSession, &selectSet)) { //Was it this socket? |
148 |
if (GetLSCPCommand(iter)) { //Have we read the entire command? |
if (GetLSCPCommand(iter)) { //Have we read the entire command? |
149 |
dmsg(3,("LSCPServer: Got command on socket %d, calling parser.\n", currentSocket)); |
dmsg(3,("LSCPServer: Got command on socket %d, calling parser.\n", currentSocket)); |
150 |
yylex_init(&((*iter).pScanner)); //FIXME: should me moved out of this loop and initialized only when a new session is created |
int dummy; // just a temporary hack to fulfill the restart() function prototype |
151 |
|
restart(NULL, dummy); // restart the 'scanner' |
152 |
currentSocket = (*iter).hSession; //a hack |
currentSocket = (*iter).hSession; //a hack |
153 |
if ((*iter).bVerbose) { // if echo mode enabled |
if ((*iter).bVerbose) { // if echo mode enabled |
154 |
AnswerClient(bufferedCommands[currentSocket]); |
AnswerClient(bufferedCommands[currentSocket]); |
174 |
} |
} |
175 |
NotifyBufferMutex.Unlock(); |
NotifyBufferMutex.Unlock(); |
176 |
} |
} |
|
//It will never get here anyway |
|
|
//yylex_destroy(yyparse_param.pScanner); |
|
177 |
} |
} |
178 |
|
|
179 |
void LSCPServer::CloseConnection( std::vector<yyparse_param_t>::iterator iter ) { |
void LSCPServer::CloseConnection( std::vector<yyparse_param_t>::iterator iter ) { |
192 |
bufferedNotifies.erase(socket); |
bufferedNotifies.erase(socket); |
193 |
close(socket); |
close(socket); |
194 |
NotifyMutex.Unlock(); |
NotifyMutex.Unlock(); |
|
//yylex_destroy((*iter).pScanner); |
|
195 |
} |
} |
196 |
|
|
197 |
void LSCPServer::SendLSCPNotify( LSCPEvent event ) { |
void LSCPServer::SendLSCPNotify( LSCPEvent event ) { |
741 |
DeviceCreationParameter* pParameter = MidiInputDeviceFactory::GetDriverParameter(Driver, Parameter); |
DeviceCreationParameter* pParameter = MidiInputDeviceFactory::GetDriverParameter(Driver, Parameter); |
742 |
result.Add("TYPE", pParameter->Type()); |
result.Add("TYPE", pParameter->Type()); |
743 |
result.Add("DESCRIPTION", pParameter->Description()); |
result.Add("DESCRIPTION", pParameter->Description()); |
744 |
result.Add("MANDATORY", pParameter->Mandatory()); |
result.Add("MANDATORY", (pParameter->Mandatory()) ? "true" : "false"); |
745 |
result.Add("FIX", pParameter->Fix()); |
result.Add("FIX", (pParameter->Fix()) ? "true" : "false"); |
746 |
result.Add("MULTIPLICITY", pParameter->Multiplicity()); |
result.Add("MULTIPLICITY", (pParameter->Multiplicity()) ? "true" : "false"); |
747 |
if (pParameter->Depends()) result.Add("DEPENDS", pParameter->Depends()); |
if (pParameter->Depends()) result.Add("DEPENDS", *pParameter->Depends()); |
748 |
if (pParameter->Default()) result.Add("DEFAULT", pParameter->Default()); |
if (pParameter->Default()) result.Add("DEFAULT", *pParameter->Default()); |
749 |
if (pParameter->RangeMin()) result.Add("RANGE_MIN", pParameter->RangeMin()); |
if (pParameter->RangeMin()) result.Add("RANGE_MIN", *pParameter->RangeMin()); |
750 |
if (pParameter->RangeMax()) result.Add("RANGE_MAX", pParameter->RangeMax()); |
if (pParameter->RangeMax()) result.Add("RANGE_MAX", *pParameter->RangeMax()); |
751 |
if (pParameter->Possibilities()) result.Add("POSSIBILITIES", pParameter->Possibilities()); |
if (pParameter->Possibilities()) result.Add("POSSIBILITIES", *pParameter->Possibilities()); |
752 |
} |
} |
753 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
754 |
result.Error(e); |
result.Error(e); |
763 |
DeviceCreationParameter* pParameter = AudioOutputDeviceFactory::GetDriverParameter(Driver, Parameter); |
DeviceCreationParameter* pParameter = AudioOutputDeviceFactory::GetDriverParameter(Driver, Parameter); |
764 |
result.Add("TYPE", pParameter->Type()); |
result.Add("TYPE", pParameter->Type()); |
765 |
result.Add("DESCRIPTION", pParameter->Description()); |
result.Add("DESCRIPTION", pParameter->Description()); |
766 |
result.Add("MANDATORY", pParameter->Mandatory()); |
result.Add("MANDATORY", (pParameter->Mandatory()) ? "true" : "false"); |
767 |
result.Add("FIX", pParameter->Fix()); |
result.Add("FIX", (pParameter->Fix()) ? "true" : "false"); |
768 |
result.Add("MULTIPLICITY", pParameter->Multiplicity()); |
result.Add("MULTIPLICITY", (pParameter->Multiplicity()) ? "true" : "false"); |
769 |
if (pParameter->Depends()) result.Add("DEPENDS", pParameter->Depends()); |
if (pParameter->Depends()) result.Add("DEPENDS", *pParameter->Depends()); |
770 |
if (pParameter->Default()) result.Add("DEFAULT", pParameter->Default()); |
if (pParameter->Default()) result.Add("DEFAULT", *pParameter->Default()); |
771 |
if (pParameter->RangeMin()) result.Add("RANGE_MIN", pParameter->RangeMin()); |
if (pParameter->RangeMin()) result.Add("RANGE_MIN", *pParameter->RangeMin()); |
772 |
if (pParameter->RangeMax()) result.Add("RANGE_MAX", pParameter->RangeMax()); |
if (pParameter->RangeMax()) result.Add("RANGE_MAX", *pParameter->RangeMax()); |
773 |
if (pParameter->Possibilities()) result.Add("POSSIBILITIES", pParameter->Possibilities()); |
if (pParameter->Possibilities()) result.Add("POSSIBILITIES", *pParameter->Possibilities()); |
774 |
} |
} |
775 |
catch (LinuxSamplerException e) { |
catch (LinuxSamplerException e) { |
776 |
result.Error(e); |
result.Error(e); |
1281 |
return result.Produce(); |
return result.Produce(); |
1282 |
} |
} |
1283 |
|
|
1284 |
|
/** |
1285 |
|
* Will be called by the parser to reset the whole sampler. |
1286 |
|
*/ |
1287 |
|
String LSCPServer::ResetSampler() { |
1288 |
|
dmsg(2,("LSCPServer: ResetSampler()\n")); |
1289 |
|
pSampler->Reset(); |
1290 |
|
LSCPResultSet result; |
1291 |
|
return result.Produce(); |
1292 |
|
} |
1293 |
|
|
1294 |
/** |
/** |
1295 |
* Will be called by the parser to subscribe a client (frontend) on the |
* Will be called by the parser to subscribe a client (frontend) on the |
1296 |
* server for receiving event messages. |
* server for receiving event messages. |