--- liblscp/trunk/lscp/client.h 2004/07/02 14:36:43 167 +++ liblscp/trunk/lscp/client.h 2006/11/27 18:33:02 946 @@ -2,7 +2,7 @@ // /**************************************************************************** liblscp - LinuxSampler Control Protocol API - Copyright (C) 2004, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2004-2006, rncbc aka Rui Nuno Capela. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -14,9 +14,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ @@ -30,10 +30,24 @@ extern "C" { #endif +//------------------------------------------------------------------------- +// MIDI channel omni mode. + +#define LSCP_MIDI_CHANNEL_ALL 16 + //------------------------------------------------------------------------- // Client data structures. +/** Server info cache struct. */ +typedef struct _lscp_server_info_t +{ + char * description; + char * version; + +} lscp_server_info_t; + + /** Engine info cache struct. */ typedef struct _lscp_engine_info_t { @@ -52,11 +66,14 @@ char ** audio_routing; char * instrument_file; int instrument_nr; + char * instrument_name; int instrument_status; int midi_device; int midi_port; int midi_channel; float volume; + int mute; + int solo; } lscp_channel_info_t; @@ -79,6 +96,41 @@ } lscp_usage_t; +/** MIDI instrument parameter struct. */ +typedef struct _lscp_midi_instrument_t +{ + int bank_msb; + int bank_lsb; + int program; + +} lscp_midi_instrument_t; + + +/** MIDI instrument load mode. */ +typedef enum _lscp_load_mode_t +{ + LSCP_LOAD_DEFAULT = 0, + LSCP_LOAD_ON_DEMAND, + LSCP_LOAD_ON_DEMAND_HOLD, + LSCP_LOAD_PERSISTENT + +} lscp_load_mode_t; + + +/** MIDI instrument info cache struct. */ +typedef struct _lscp_midi_instrument_info_t +{ + char * name; + char * engine_name; + char * instrument_file; + int instrument_nr; + char * instrument_name; + lscp_load_mode_t load_mode; + float volume; + +} lscp_midi_instrument_info_t; + + //------------------------------------------------------------------------- // Client socket main structure. @@ -125,7 +177,7 @@ lscp_status_t lscp_client_subscribe (lscp_client_t *pClient, lscp_event_t events); lscp_status_t lscp_client_unsubscribe (lscp_client_t *pClient, lscp_event_t events); -lscp_event_t lscp_client_events (lscp_client_t *pClient); +lscp_event_t lscp_client_get_events (lscp_client_t *pClient); //------------------------------------------------------------------------- // Client command protocol functions. @@ -137,7 +189,9 @@ int * lscp_list_channels (lscp_client_t *pClient); int lscp_add_channel (lscp_client_t *pClient); lscp_status_t lscp_remove_channel (lscp_client_t *pClient, int iSamplerChannel); -const char ** lscp_get_available_engines (lscp_client_t *pClient); + +int lscp_get_available_engines (lscp_client_t *pClient); +const char ** lscp_list_available_engines (lscp_client_t *pClient); lscp_engine_info_t * lscp_get_engine_info (lscp_client_t *pClient, const char *pszEngineName); lscp_channel_info_t * lscp_get_channel_info (lscp_client_t *pClient, int iSamplerChannel); @@ -158,8 +212,30 @@ lscp_status_t lscp_set_channel_midi_channel (lscp_client_t *pClient, int iSamplerChannel, int iMidiChannel); lscp_status_t lscp_set_channel_volume (lscp_client_t *pClient, int iSamplerChannel, float fVolume); +lscp_status_t lscp_set_channel_mute (lscp_client_t *pClient, int iSamplerChannel, int iMute); +lscp_status_t lscp_set_channel_solo (lscp_client_t *pClient, int iSamplerChannel, int iSolo); + lscp_status_t lscp_reset_channel (lscp_client_t *pClient, int iSamplerChannel); +lscp_status_t lscp_reset_sampler (lscp_client_t *pClient); + +lscp_server_info_t * lscp_get_server_info (lscp_client_t *pClient); + +int lscp_get_total_voice_count (lscp_client_t *pClient); +int lscp_get_total_voice_count_max (lscp_client_t *pClient); + +//------------------------------------------------------------------------- +// MIDI instrument mapping control functions. + +lscp_status_t lscp_map_midi_instrument (lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr, const char *pszEngineName, const char *pszFileName, int iInstrIndex, float fVolume, lscp_load_mode_t load_mode, const char *pszName); +lscp_status_t lscp_unmap_midi_instrument (lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr); + +int lscp_get_midi_instruments (lscp_client_t *pClient); + +lscp_midi_instrument_info_t *lscp_get_midi_instrument_info(lscp_client_t *pClient, lscp_midi_instrument_t *pMidiInstr); + +lscp_status_t lscp_clear_midi_instruments (lscp_client_t *pClient); + #if defined(__cplusplus) }