--- liblscp/trunk/lscp/client.h 2006/06/01 08:32:16 869 +++ liblscp/trunk/lscp/client.h 2006/12/17 00:59:40 975 @@ -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. *****************************************************************************/ @@ -42,8 +42,8 @@ /** Server info cache struct. */ typedef struct _lscp_server_info_t { - char * description; - char * version; + char * description; + char * version; } lscp_server_info_t; @@ -51,8 +51,8 @@ /** Engine info cache struct. */ typedef struct _lscp_engine_info_t { - char * description; - char * version; + char * description; + char * version; } lscp_engine_info_t; @@ -60,20 +60,21 @@ /** Channel info cache struct. */ typedef struct _lscp_channel_info_t { - char * engine_name; - int audio_device; - int audio_channels; - 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; + char * engine_name; + int audio_device; + int audio_channels; + char ** audio_routing; + char * instrument_file; + int instrument_nr; + char * instrument_name; + int instrument_status; + int midi_device; + int midi_port; + int midi_channel; + int midi_map; + float volume; + int mute; + int solo; } lscp_channel_info_t; @@ -81,8 +82,8 @@ /** Buffer fill cache struct. */ typedef struct _lscp_buffer_fill_t { - unsigned int stream_id; - unsigned long stream_usage; + unsigned int stream_id; + unsigned long stream_usage; } lscp_buffer_fill_t; @@ -90,12 +91,57 @@ /** Buffer fill stream usage types. */ typedef enum _lscp_usage_t { - LSCP_USAGE_BYTES = 0, - LSCP_USAGE_PERCENTAGE + LSCP_USAGE_BYTES = 0, + LSCP_USAGE_PERCENTAGE } lscp_usage_t; +/** MIDI instrument parameter struct. */ +typedef struct _lscp_midi_instrument_t +{ + int map; + int bank; + int prog; + +} 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; + + +/** MIDI instrument map mode. */ +typedef enum _lscp_midi_map_mode_t +{ + LSCP_MIDI_MAP_NONE = -1, + LSCP_MIDI_MAP_DEFAULT = -2, + LSCP_MIDI_MAP_ALL = -3 + +} lscp_midi_map_mode_t; + + //------------------------------------------------------------------------- // Client socket main structure. @@ -105,11 +151,11 @@ /** Client event callback procedure prototype. */ typedef lscp_status_t (*lscp_client_proc_t) ( - struct _lscp_client_t *pClient, - lscp_event_t event, - const char *pchData, - int cchData, - void *pvData + struct _lscp_client_t *pClient, + lscp_event_t event, + const char *pchData, + int cchData, + void *pvData ); //------------------------------------------------------------------------- @@ -175,6 +221,8 @@ lscp_status_t lscp_set_channel_midi_device (lscp_client_t *pClient, int iSamplerChannel, int iMidiDevice); lscp_status_t lscp_set_channel_midi_port (lscp_client_t *pClient, int iSamplerChannel, int iMidiPort); lscp_status_t lscp_set_channel_midi_channel (lscp_client_t *pClient, int iSamplerChannel, int iMidiChannel); +lscp_status_t lscp_set_channel_midi_map (lscp_client_t *pClient, int iSamplerChannel, int iMidiMap); + 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); @@ -186,6 +234,32 @@ 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. + +int lscp_add_midi_instrument_map (lscp_client_t *pClient, const char *pszMapName); +lscp_status_t lscp_remove_midi_instrument_map (lscp_client_t *pClient, int iMidiMap); + +int lscp_get_midi_instrument_maps (lscp_client_t *pClient); +int * lscp_list_midi_instrument_maps (lscp_client_t *pClient); + +const char * lscp_get_midi_instrument_map_name (lscp_client_t *pClient, int iMidiMap); +lscp_status_t lscp_set_midi_instrument_map_name (lscp_client_t *pClient, int iMidiMap, const char *pszMapName); + +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, int iMidiMap); +lscp_midi_instrument_t *lscp_list_midi_instruments (lscp_client_t *pClient, int iMidiMap); + +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, int iMidiMap); + + #if defined(__cplusplus) } #endif