47 |
/// TCP Port on which the server should listen for connection requests. |
/// TCP Port on which the server should listen for connection requests. |
48 |
#define LSCP_PORT 8888 |
#define LSCP_PORT 8888 |
49 |
|
|
50 |
|
/// try up to 3 minutes to bind server socket |
51 |
|
#define LSCP_SERVER_BIND_TIMEOUT 180 |
52 |
|
|
53 |
using namespace LinuxSampler; |
using namespace LinuxSampler; |
54 |
|
|
55 |
// External references to the main scanner and parser functions |
// External references to the main scanner and parser functions |
56 |
extern int yyparse(void* YYPARSE_PARAM); |
extern int yyparse(void* YYPARSE_PARAM); |
57 |
extern int yylex_init(yyscan_t* scanner); |
extern void restart(yyparse_param_t* pparam, int& yychar); |
|
extern int yylex_destroy(yyscan_t yyscanner); |
|
58 |
|
|
59 |
/** |
/** |
60 |
* Network server for the LinuxSampler Control Protocol (LSCP). |
* Network server for the LinuxSampler Control Protocol (LSCP). |
117 |
String SetMIDIInputDevice(uint MIDIDeviceId, uint uiSamplerChannel); |
String SetMIDIInputDevice(uint MIDIDeviceId, uint uiSamplerChannel); |
118 |
String SetMIDIInputType(String MidiInputDriver, uint uiSamplerChannel); |
String SetMIDIInputType(String MidiInputDriver, uint uiSamplerChannel); |
119 |
String SetMIDIInput(uint MIDIDeviceId, uint MIDIPort, uint MIDIChannel, uint uiSamplerChannel); |
String SetMIDIInput(uint MIDIDeviceId, uint MIDIPort, uint MIDIChannel, uint uiSamplerChannel); |
120 |
String SetVolume(double Volume, uint uiSamplerChannel); |
String SetVolume(double dVolume, uint uiSamplerChannel); |
121 |
String ResetChannel(uint uiSamplerChannel); |
String ResetChannel(uint uiSamplerChannel); |
122 |
|
String ResetSampler(); |
123 |
String SubscribeNotification(LSCPEvent::event_t); |
String SubscribeNotification(LSCPEvent::event_t); |
124 |
String UnsubscribeNotification(LSCPEvent::event_t); |
String UnsubscribeNotification(LSCPEvent::event_t); |
125 |
String SetEcho(yyparse_param_t* pSession, double boolean_value); |
String SetEcho(yyparse_param_t* pSession, double boolean_value); |
129 |
static std::map<int,String> bufferedCommands; |
static std::map<int,String> bufferedCommands; |
130 |
|
|
131 |
static void SendLSCPNotify( LSCPEvent Event ); |
static void SendLSCPNotify( LSCPEvent Event ); |
132 |
|
static int EventSubscribers( std::list<LSCPEvent::event_t> events ); |
133 |
|
static void LockRTNotify( void ) { RTNotifyMutex.Lock(); } |
134 |
|
static void UnlockRTNotify( void ) { RTNotifyMutex.Unlock(); } |
135 |
|
|
136 |
protected: |
protected: |
137 |
int hSocket; |
int hSocket; |
162 |
static Mutex SubscriptionMutex; |
static Mutex SubscriptionMutex; |
163 |
static std::map< LSCPEvent::event_t, std::list<int> > eventSubscriptions; |
static std::map< LSCPEvent::event_t, std::list<int> > eventSubscriptions; |
164 |
static fd_set fdSet; |
static fd_set fdSet; |
165 |
|
|
166 |
|
//Protect main thread that generates real time notify messages |
167 |
|
//like voice count, stream count and buffer fill |
168 |
|
//from LSCP server removing engines and channels from underneath |
169 |
|
static Mutex RTNotifyMutex; |
170 |
}; |
}; |
171 |
|
|
172 |
/** |
/** |