42 |
#include "../Sampler.h" |
#include "../Sampler.h" |
43 |
#include "../common/Thread.h" |
#include "../common/Thread.h" |
44 |
#include "../common/Mutex.h" |
#include "../common/Mutex.h" |
45 |
|
#include "../common/Condition.h" |
46 |
|
|
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 |
51 |
|
|
52 |
// External references to the main scanner and parser functions |
// External references to the main scanner and parser functions |
53 |
extern int yyparse(void* YYPARSE_PARAM); |
extern int yyparse(void* YYPARSE_PARAM); |
54 |
extern int yylex_init(yyscan_t* scanner); |
extern void restart(yyparse_param_t* pparam, int& yychar); |
|
extern int yylex_destroy(yyscan_t yyscanner); |
|
55 |
|
|
56 |
/** |
/** |
57 |
* Network server for the LinuxSampler Control Protocol (LSCP). |
* Network server for the LinuxSampler Control Protocol (LSCP). |
59 |
class LSCPServer : public Thread { |
class LSCPServer : public Thread { |
60 |
public: |
public: |
61 |
LSCPServer(Sampler* pSampler); |
LSCPServer(Sampler* pSampler); |
62 |
|
int WaitUntilInitialized(long TimeoutSeconds = 0L, long TimeoutNanoSeconds = 0L); |
63 |
|
|
64 |
// Methods called by the parser |
// Methods called by the parser |
65 |
String DestroyAudioOutputDevice(uint DeviceIndex); |
String DestroyAudioOutputDevice(uint DeviceIndex); |
116 |
String SetMIDIInput(uint MIDIDeviceId, uint MIDIPort, uint MIDIChannel, uint uiSamplerChannel); |
String SetMIDIInput(uint MIDIDeviceId, uint MIDIPort, uint MIDIChannel, uint uiSamplerChannel); |
117 |
String SetVolume(double Volume, uint uiSamplerChannel); |
String SetVolume(double Volume, uint uiSamplerChannel); |
118 |
String ResetChannel(uint uiSamplerChannel); |
String ResetChannel(uint uiSamplerChannel); |
119 |
|
String ResetSampler(); |
120 |
String SubscribeNotification(LSCPEvent::event_t); |
String SubscribeNotification(LSCPEvent::event_t); |
121 |
String UnsubscribeNotification(LSCPEvent::event_t); |
String UnsubscribeNotification(LSCPEvent::event_t); |
122 |
String SetEcho(yyparse_param_t* pSession, double boolean_value); |
String SetEcho(yyparse_param_t* pSession, double boolean_value); |
131 |
int hSocket; |
int hSocket; |
132 |
sockaddr_in SocketAddress; |
sockaddr_in SocketAddress; |
133 |
Sampler* pSampler; |
Sampler* pSampler; |
134 |
|
Condition Initialized; |
135 |
|
|
136 |
int Main(); ///< Implementation of virtual method from class Thread |
int Main(); ///< Implementation of virtual method from class Thread |
137 |
|
|