--- linuxsampler/trunk/src/network/lscpserver.h 2007/05/16 14:22:26 1187 +++ linuxsampler/trunk/src/network/lscpserver.h 2007/12/04 18:09:26 1541 @@ -24,6 +24,10 @@ #ifndef __LSCPSERVER_H_ #define __LSCPSERVER_H_ +#if defined(WIN32) +#include +typedef int socklen_t; +#else #include #include #include @@ -33,6 +37,7 @@ #include #include #include +#endif #include @@ -44,7 +49,7 @@ #include "../common/Thread.h" #include "../common/Mutex.h" #include "../common/Condition.h" -#include "../common/global.h" +#include "../common/global_private.h" #include "../drivers/midi/MidiInstrumentMapper.h" @@ -169,9 +174,8 @@ String CopyDbInstrumentDirectory(String Dir, String Dst); String SetDbInstrumentDirectoryDescription(String Dir, String Desc); String FindDbInstrumentDirectories(String Dir, std::map Parameters, bool Recursive = true); - String AddDbInstruments(String DbDir, String FilePath, int Index = -1); - String AddDbInstrumentsFlat(String DbDir, String FilePath); - String AddDbInstrumentsNonrecursive(String DbDir, String FsDir); + String AddDbInstruments(String DbDir, String FilePath, int Index = -1, bool bBackground = false); + String AddDbInstruments(String ScanMode, String DbDir, String FsDir, bool bBackground = false); String RemoveDbInstrument(String Instr); String GetDbInstrumentCount(String Dir, bool Recursive = false); String GetDbInstruments(String Dir, bool Recursive = false); @@ -181,13 +185,20 @@ String CopyDbInstrument(String Instr, String Dst); String SetDbInstrumentDescription(String Instr, String Desc); String FindDbInstruments(String Dir, std::map Parameters, bool Recursive = true); + String FormatInstrumentsDb(); + String EditSamplerChannelInstrument(uint uiSamplerChannel); + String GetDbInstrumentsJobInfo(int JobId); String ResetChannel(uint uiSamplerChannel); String ResetSampler(); String GetServerInfo(); + String GetTotalStreamCount(); String GetTotalVoiceCount(); String GetTotalVoiceCountMax(); String GetGlobalVolume(); String SetGlobalVolume(double dVolume); + String GetFileInstruments(String Filename); + String ListFileInstruments(String Filename); + String GetFileInstrumentInfo(String Filename, uint InstrumentID); String SubscribeNotification(LSCPEvent::event_t); String UnsubscribeNotification(LSCPEvent::event_t); String SetEcho(yyparse_param_t* pSession, double boolean_value); @@ -232,6 +243,12 @@ bool HasSoloChannel(); void MuteNonSoloChannels(); void UnmuteChannels(); + + /** + * Throws an exception if the specified file is not found or + * if directory is specified. + */ + static void VerifyFile(String Filename); static std::map bufferedNotifies; static Mutex NotifyMutex; @@ -252,8 +269,8 @@ public MidiDeviceCountListener, public MidiInstrumentCountListener, public MidiInstrumentInfoListener, public MidiInstrumentMapCountListener, public MidiInstrumentMapInfoListener, public FxSendCountListener, - public VoiceCountListener, public StreamCountListener, - public BufferFillListener, public TotalVoiceCountListener { + public VoiceCountListener, public StreamCountListener, public BufferFillListener, + public TotalStreamCountListener, public TotalVoiceCountListener { public: /** @@ -261,13 +278,13 @@ * @param NewCount The new number of sampler channels. */ virtual void ChannelCountChanged(int NewCount); - + /** * Invoked when the number of audio output devices has changed. * @param NewCount The new number of audio output devices. */ virtual void AudioDeviceCountChanged(int NewCount); - + /** * Invoked when the number of MIDI input devices has changed. * @param NewCount The new number of MIDI input devices. @@ -280,7 +297,7 @@ * @param NewCount The new number of MIDI instruments. */ virtual void MidiInstrumentCountChanged(int MapId, int NewCount); - + /** * Invoked when a MIDI instrument in a MIDI instrument map is changed. * @param MapId The numerical ID of the MIDI instrument map. @@ -288,7 +305,7 @@ * @param Program The MIDI program number of the instrument. */ virtual void MidiInstrumentInfoChanged(int MapId, int Bank, int Program); - + /** * Invoked when the number of MIDI instrument maps has changed. * @param NewCount The new number of MIDI instruments. @@ -300,7 +317,7 @@ * @param MapId The numerical ID of the MIDI instrument map. */ virtual void MidiInstrumentMapInfoChanged(int MapId); - + /** * Invoked when the number of effect sends * on the specified sampler channel has changed. @@ -338,56 +355,19 @@ * @param NewCount The new number of active voices. */ virtual void TotalVoiceCountChanged(int NewCount); + virtual void TotalStreamCountChanged(int NewCount); } eventHandler; #if HAVE_SQLITE3 class DbInstrumentsEventHandler : public InstrumentsDb::Listener { public: - - /** - * Invoked when the number of instrument directories - * in a specific directory has changed. - * @param Dir The absolute pathname of the directory in - * which the number of directories is changed. - */ virtual void DirectoryCountChanged(String Dir); - - /** - * Invoked when the settings of an instrument directory - * are changed. - * @param Dir The absolute pathname of the directory - * whose settings are changed. - */ virtual void DirectoryInfoChanged(String Dir); - - /** - * Invoked when an instrument directory is renamed. - * @param Dir The old absolute pathname of the directory. - * @param NewName The new name of the directory. - */ virtual void DirectoryNameChanged(String Dir, String NewName); - - /** - * Invoked when the number of instruments - * in a specific directory has changed. - * @param Dir The absolute pathname of the directory in - * which the number of instruments is changed. - */ virtual void InstrumentCountChanged(String Dir); - - /** - * Invoked when the settings of an instrument are changed. - * @param Instr The absolute pathname of the instrument - * whose settings are changed. - */ virtual void InstrumentInfoChanged(String Instr); - - /** - * Invoked when an instrument is renamed. - * @param Instr The old absolute pathname of the instrument. - * @param NewName The new name of the directory. - */ virtual void InstrumentNameChanged(String Instr, String NewName); + virtual void JobStatusChanged(int JobId); } dbInstrumentsEventHandler; #endif // HAVE_SQLITE3 };