--- linuxsampler/trunk/src/network/lscpserver.h 2004/04/26 17:15:51 53 +++ linuxsampler/trunk/src/network/lscpserver.h 2004/06/20 16:49:47 137 @@ -2,7 +2,7 @@ * * * LinuxSampler - modular, streaming capable sampler * * * - * Copyright (C) 2003 by Benno Senoner and Christian Schoenebeck * + * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -57,7 +57,9 @@ LSCPServer(Sampler* pSampler); // Methods called by the parser - String LoadInstrument(String Filename, uint uiInstrument, uint uiSamplerChannel); + String CreateAudioOutputDevice(String Driver, std::map Parameters); + String DestroyAudioOutputDevice(uint DeviceIndex); + String LoadInstrument(String Filename, uint uiInstrument, uint uiSamplerChannel, bool bBackground = false); String LoadEngine(String EngineName, uint uiSamplerChannel); String GetChannels(); String AddChannel(); @@ -68,15 +70,30 @@ String GetVoiceCount(uint uiSamplerChannel); String GetStreamCount(uint uiSamplerChannel); String GetBufferFill(fill_response_t ResponseType, uint uiSamplerChannel); - String SetAudioOutputType(audio_output_type_t AudioOutputType, uint uiSamplerChannel); - String SetAudioOutputChannel(uint AudioOutputChannel, uint uiSamplerChannel); - String SetMIDIInputType(midi_input_type_t MidiInputType, uint uiSamplerChannel); + String GetAvailableAudioOutputDrivers(); + String GetAudioOutputDriverInfo(String Driver); +#ifdef __GNUC__ + typedef std::map StringMap; // nasty workaround for a GCC bug (see GCC bug #15980, #57) + String GetAudioOutputDriverParameterInfo(String Driver, String Parameter, std::map DependencyList = StringMap()); +#else + String GetAudioOutputDriverParameterInfo(String Driver, String Parameter, std::map DependencyList = std::map()); +#endif // __GNUC__ + String GetAudioOutputDeviceCount(); + String GetAudioOutputDevices(); + String GetAudioOutputDeviceInfo(uint DeviceIndex); + String GetAudioOutputChannelInfo(uint DeviceId, uint ChannelId); + String GetAudioOutputChannelParameterInfo(uint DeviceId, uint ChannelId, String ParameterName); + String SetAudioOutputChannelParameter(uint DeviceId, uint ChannelId, String ParamKey, String ParamVal); + String SetAudioOutputDeviceParameter(uint DeviceIndex, String ParamKey, String ParamVal); + String SetAudioOutputChannel(uint ChannelAudioOutputChannel, uint AudioOutputDeviceInputChannel, uint uiSamplerChannel); + String SetMIDIInputType(String MidiInputDriver, uint uiSamplerChannel); String SetMIDIInputPort(String MIDIInputPort, uint uiSamplerchannel); String SetMIDIInputChannel(uint MIDIChannel, uint uiSamplerChannel); + String SetAudioOutputDevice(uint AudioDeviceId, uint SamplerChannel); String SetVolume(double Volume, uint uiSamplerChannel); String ResetChannel(uint uiSamplerChannel); - String SubscribeNotification(uint UDPPort); - String UnsubscribeNotification(String SessionID); + String SubscribeNotification(event_t Event); + String UnsubscribeNotification(event_t Event); void AnswerClient(String ReturnMessage); protected: int hSocket; @@ -113,4 +130,23 @@ } }; + +/** + * Instrument loader thread for the LinuxSampler Control Protocol (LSCP). + */ +class LSCPLoadInstrument : public Thread { + + public: + LSCPLoadInstrument(Engine* pEngine, String Filename, uint uiInstrument); + + protected: + // Instance variables. + Engine* pEngine; + String Filename; + uint uiInstrument; + + // Implementation of virtual method from class Thread. + int Main(); +}; + #endif // __LSCPSERVER_H_