--- linuxsampler/trunk/src/network/lscpserver.h 2004/07/25 23:27:41 211 +++ linuxsampler/trunk/src/network/lscpserver.h 2005/02/07 00:19:30 360 @@ -47,12 +47,14 @@ /// TCP Port on which the server should listen for connection requests. #define LSCP_PORT 8888 +/// try up to 3 minutes to bind server socket +#define LSCP_SERVER_BIND_TIMEOUT 180 + using namespace LinuxSampler; // External references to the main scanner and parser functions extern int yyparse(void* YYPARSE_PARAM); -extern int yylex_init(yyscan_t* scanner); -extern int yylex_destroy(yyscan_t yyscanner); +extern void restart(yyparse_param_t* pparam, int& yychar); /** * Network server for the LinuxSampler Control Protocol (LSCP). @@ -115,8 +117,9 @@ String SetMIDIInputDevice(uint MIDIDeviceId, uint uiSamplerChannel); String SetMIDIInputType(String MidiInputDriver, uint uiSamplerChannel); String SetMIDIInput(uint MIDIDeviceId, uint MIDIPort, uint MIDIChannel, uint uiSamplerChannel); - String SetVolume(double Volume, uint uiSamplerChannel); + String SetVolume(double dVolume, uint uiSamplerChannel); String ResetChannel(uint uiSamplerChannel); + String ResetSampler(); String SubscribeNotification(LSCPEvent::event_t); String UnsubscribeNotification(LSCPEvent::event_t); String SetEcho(yyparse_param_t* pSession, double boolean_value); @@ -126,6 +129,9 @@ static std::map bufferedCommands; static void SendLSCPNotify( LSCPEvent Event ); + static int EventSubscribers( std::list events ); + static void LockRTNotify( void ) { RTNotifyMutex.Lock(); } + static void UnlockRTNotify( void ) { RTNotifyMutex.Unlock(); } protected: int hSocket; @@ -156,6 +162,11 @@ static Mutex SubscriptionMutex; static std::map< LSCPEvent::event_t, std::list > eventSubscriptions; static fd_set fdSet; + + //Protect main thread that generates real time notify messages + //like voice count, stream count and buffer fill + //from LSCP server removing engines and channels from underneath + static Mutex RTNotifyMutex; }; /**