#include "lscp/socket.h"#include "lscp/event.h"Go to the source code of this file.
| #define LSCP_MIDI_CHANNEL_ALL 16 |
| typedef struct _lscp_buffer_fill_t lscp_buffer_fill_t |
Buffer fill cache struct.
| typedef struct _lscp_channel_info_t lscp_channel_info_t |
Channel info cache struct.
| typedef lscp_status_t(*) lscp_client_proc_t(struct _lscp_client_t *pClient, lscp_event_t event, const char *pchData, int cchData, void *pvData) |
Client event callback procedure prototype.
| typedef struct _lscp_client_t lscp_client_t |
Client opaque descriptor struct.
| typedef struct _lscp_engine_info_t lscp_engine_info_t |
Engine info cache struct.
| typedef struct _lscp_fxsend_info_t lscp_fxsend_info_t |
Effect send info cache struct.
| typedef enum _lscp_load_mode_t lscp_load_mode_t |
MIDI instrument load mode.
| typedef struct _lscp_midi_instrument_info_t lscp_midi_instrument_info_t |
MIDI instrument info cache struct.
| typedef struct _lscp_midi_instrument_t lscp_midi_instrument_t |
MIDI instrument parameter struct.
| typedef enum _lscp_midi_map_mode_t lscp_midi_map_mode_t |
MIDI instrument map mode.
| typedef struct _lscp_server_info_t lscp_server_info_t |
Server info cache struct.
| typedef enum _lscp_usage_t lscp_usage_t |
Buffer fill stream usage types.
| enum _lscp_load_mode_t |
| enum _lscp_usage_t |
| int lscp_add_channel | ( | lscp_client_t * | pClient | ) |
Adding a new sampler channel: ADD CHANNEL
| pClient | Pointer to client instance structure. |
| int lscp_add_midi_instrument_map | ( | lscp_client_t * | pClient, | |
| const char * | pszMapName | |||
| ) |
Create a new MIDI instrument map: ADD MIDI_INSTRUMENT_MAP [<name>]
| pClient | Pointer to client instance structure. | |
| pszMapName | MIDI instrument map name (optional) |
| lscp_status_t lscp_clear_midi_instruments | ( | lscp_client_t * | pClient, | |
| int | iMidiMap | |||
| ) |
Clear the MIDI instrumnet map: CLEAR MIDI_INSTRUMENTS ALL|<midi-map>
| pClient | Pointer to client instance structure. | |
| iMidiMap | MIDI instrument map number, or LSCP_MIDI_MAP_ALL . |
| const char* lscp_client_build | ( | void | ) |
Retrieve the current client library build timestamp string.
| lscp_client_t* lscp_client_create | ( | const char * | pszHost, | |
| int | iPort, | |||
| lscp_client_proc_t | pfnCallback, | |||
| void * | pvData | |||
| ) |
Create a client instance, estabilishing a connection to a server hostname, which must be listening on the given port. A client callback function is also supplied for server notification event handling.
| pszHost | Hostname of the linuxsampler listening server. | |
| iPort | Port number of the linuxsampler listening server. | |
| pfnCallback | Callback function to receive event notifications. | |
| pvData | User context opaque data, that will be passed to the callback function. |
| lscp_status_t lscp_client_destroy | ( | lscp_client_t * | pClient | ) |
Terminate and destroy a client instance.
| pClient | Pointer to client instance structure. |
| int lscp_client_get_errno | ( | lscp_client_t * | pClient | ) |
Get the last error/warning number received.
| pClient | Pointer to client instance structure. |
| lscp_event_t lscp_client_get_events | ( | lscp_client_t * | pClient | ) |
Getting current subscribed events.
| pClient | Pointer to client instance structure. |
| const char* lscp_client_get_result | ( | lscp_client_t * | pClient | ) |
Get the last received result string. In case of error or warning, this is the text of the error or warning message issued.
| pClient | Pointer to client instance structure. |
| int lscp_client_get_timeout | ( | lscp_client_t * | pClient | ) |
Get the client transaction timeout interval.
| pClient | Pointer to client instance structure. |
| lscp_status_t lscp_client_join | ( | lscp_client_t * | pClient | ) |
Wait for a client instance to terminate graciously.
| pClient | Pointer to client instance structure. |
| const char* lscp_client_package | ( | void | ) |
Retrieve the current client library version string.
| lscp_status_t lscp_client_query | ( | lscp_client_t * | pClient, | |
| const char * | pszQuery | |||
| ) |
Submit a command query line string to the server. The query string must be cr/lf and null terminated. Besides the return code, the specific server response to the command request is made available by the lscp_client_get_result and lscp_client_get_errno function calls.
| pClient | Pointer to client instance structure. | |
| pszQuery | Command request line to be sent to server, must be cr/lf and null terminated. |
| lscp_status_t lscp_client_set_timeout | ( | lscp_client_t * | pClient, | |
| int | iTimeout | |||
| ) |
Set the client transaction timeout interval.
| pClient | Pointer to client instance structure. | |
| iTimeout | Transaction timeout in milliseconds. |
| lscp_status_t lscp_client_subscribe | ( | lscp_client_t * | pClient, | |
| lscp_event_t | events | |||
| ) |
Register frontend for receiving event messages by the sampler backend. Caution: since liblscp v0.5.5.4 you have to call lscp_client_subscribe() for each event you want to subscribe. That is the old bitflag approach was abondoned at this point. You can however still register all older events with one lscp_client_subscribe() call at once. Thus, the old behavior of this functions was not broken. Those older events are namely:
SUBSCRIBE CHANNEL_COUNT | VOICE_COUNT | STREAM_COUNT
| BUFFER_FILL | CHANNEL_INFO | TOTAL_VOICE_COUNT
| AUDIO_OUTPUT_DEVICE_COUNT | AUDIO_OUTPUT_DEVICE_INFO
| MIDI_INPUT_DEVICE_COUNT | MIDI_INPUT_DEVICE_INFO
| MIDI_INSTRUMENT_MAP_COUNT | MIDI_INSTRUMENT_MAP_INFO
| MIDI_INSTRUMENT_COUNT | MIDI_INSTRUMENT_INFO
| MISCELLANEOUS
SUBSCRIBE CHANNEL_MIDI
| pClient | Pointer to client instance structure. | |
| events | LSCP event to subscribe. |
| lscp_status_t lscp_client_unsubscribe | ( | lscp_client_t * | pClient, | |
| lscp_event_t | events | |||
| ) |
Deregister frontend from receiving UDP event messages anymore. Caution: since liblscp v0.5.5.4 you have to call lscp_client_unsubscribe() for each event you want to unsubscribe. That is the old bitflag approach was abondoned at this point. You can however still register all older events with one lscp_client_subscribe() call at once. Thus, the old behavior of this functions was not broken. Those older events are namely:
UNSUBSCRIBE CHANNEL_COUNT | VOICE_COUNT | STREAM_COUNT
| BUFFER_FILL | CHANNEL_INFO | TOTAL_VOICE_COUNT
| AUDIO_OUTPUT_DEVICE_COUNT | AUDIO_OUTPUT_DEVICE_INFO
| MIDI_INPUT_DEVICE_COUNT | MIDI_INPUT_DEVICE_INFO
| MIDI_INSTRUMENT_MAP_COUNT | MIDI_INSTRUMENT_MAP_INFO
| MIDI_INSTRUMENT_COUNT | MIDI_INSTRUMENT_INFO
| MISCELLANEOUS
UNSUBSCRIBE CHANNEL_MIDI
| pClient | Pointer to client instance structure. | |
| events | LSCP event to unsubscribe. |
| const char* lscp_client_version | ( | void | ) |
Retrieve the current client library version string.
| int lscp_create_fxsend | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel, | |||
| int | iMidiController, | |||
| const char * | pszFxName | |||
| ) |
Add an effect send to a sampler channel: CREATE FX_SEND <sampler-channel> <midi-ctrl> [<name>]
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. | |
| iMidiController | MIDI controller used to alter the effect, usually a number between 0 and 127. | |
| pszName | Optional name for the effect send entity, does not have to be unique. |
| lscp_status_t lscp_destroy_fxsend | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel, | |||
| int | iFxSend | |||
| ) |
Remove an effect send from a sampler channel: DESTROY FX_SEND <sampler-channel> <fx-send-id>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. | |
| iFxSend | Effect send number. |
| lscp_status_t lscp_edit_channel_instrument | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Open an instrument editor application for the instrument on the given sampler channel: EDIT CHANNEL INSTRUMENT <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler Channel. |
| int lscp_get_available_engines | ( | lscp_client_t * | pClient | ) |
Getting all available engines count: GET AVAILABLE_ENGINES
| pClient | Pointer to client instance structure. |
| lscp_buffer_fill_t* lscp_get_channel_buffer_fill | ( | lscp_client_t * | pClient, | |
| lscp_usage_t | usage_type, | |||
| int | iSamplerChannel | |||
| ) |
Current fill state of disk stream buffers: GET CHANNEL BUFFER_FILL {BYTES|PERCENTAGE} <sampler-channel>
| pClient | Pointer to client instance structure. | |
| usage_type | Usage type to be returned, either LSCP_USAGE_BYTES, or LSCP_USAGE_PERCENTAGE. | |
| iSamplerChannel | Sampler channel number. |
| lscp_channel_info_t* lscp_get_channel_info | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Getting sampler channel informations: GET CHANNEL INFO <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| int lscp_get_channel_stream_count | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Current number of active disk streams: GET CHANNEL STREAM_COUNT <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| int lscp_get_channel_stream_usage | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Current least usage of active disk streams.
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| int lscp_get_channel_voice_count | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Current number of active voices: GET CHANNEL VOICE_COUNT <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| int lscp_get_channels | ( | lscp_client_t * | pClient | ) |
Current number of sampler channels: GET CHANNELS
| pClient | Pointer to client instance structure. |
| lscp_engine_info_t* lscp_get_engine_info | ( | lscp_client_t * | pClient, | |
| const char * | pszEngineName | |||
| ) |
Getting information about an engine. GET ENGINE INFO <engine-name>
| pClient | Pointer to client instance structure. | |
| pszEngineName | Engine name. |
| lscp_fxsend_info_t* lscp_get_fxsend_info | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel, | |||
| int | iFxSend | |||
| ) |
Getting effect send information GET FX_SEND INFO <sampler-channel> <fx-send-id>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. | |
| iFxSend | Effect send number. |
| int lscp_get_fxsends | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Get amount of effect sends on a sampler channel: GET FX_SENDS <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| lscp_midi_instrument_info_t* lscp_get_midi_instrument_info | ( | lscp_client_t * | pClient, | |
| lscp_midi_instrument_t * | pMidiInstr | |||
| ) |
Getting information about a MIDI instrument map entry: GET MIDI_INSTRUMENT INFO <midi-map> <midi-bank> <midi-prog>
| pClient | Pointer to client instance structure. | |
| pMidiInstr | MIDI instrument bank and program parameter key. |
| const char* lscp_get_midi_instrument_map_name | ( | lscp_client_t * | pClient, | |
| int | iMidiMap | |||
| ) |
Getting a MIDI instrument map name: GET MIDI_INSTRUMENT_MAP INFO <midi-map>
| pClient | Pointer to client instance structure. | |
| iMidiMap | MIDI instrument map number. |
| int lscp_get_midi_instrument_maps | ( | lscp_client_t * | pClient | ) |
Get amount of existing MIDI instrument maps: GET MIDI_INSTRUMENT_MAPS
| pClient | Pointer to client instance structure. |
| int lscp_get_midi_instruments | ( | lscp_client_t * | pClient, | |
| int | iMidiMap | |||
| ) |
Get the total count of MIDI instrument map entries: GET MIDI_INSTRUMENTS ALL|<midi-map>
| pClient | Pointer to client instance structure. | |
| iMidiMap | MIDI instrument map number, or LSCP_MIDI_MAP_ALL . |
| lscp_server_info_t* lscp_get_server_info | ( | lscp_client_t * | pClient | ) |
Getting information about the server. GET SERVER INFO
| pClient | Pointer to client instance structure. |
| int lscp_get_total_voice_count | ( | lscp_client_t * | pClient | ) |
Current total number of active voices: GET TOTAL_VOICE_COUNT
| pClient | Pointer to client instance structure. |
| int lscp_get_total_voice_count_max | ( | lscp_client_t * | pClient | ) |
Maximum amount of active voices: GET TOTAL_VOICE_COUNT_MAX
| pClient | Pointer to client instance structure. |
| float lscp_get_volume | ( | lscp_client_t * | pClient | ) |
Get global volume attenuation: GET VOLUME
| pClient | Pointer to client instance structure. |
| const char** lscp_list_available_engines | ( | lscp_client_t * | pClient | ) |
Getting all available engines: LIST AVAILABLE_ENGINES
| pClient | Pointer to client instance structure. |
| int* lscp_list_channels | ( | lscp_client_t * | pClient | ) |
List current sampler channels number identifiers: LIST CHANNELS
| pClient | Pointer to client instance structure. |
| int* lscp_list_fxsends | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
List all effect sends on a sampler channel: LIST FX_SENDS <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| int* lscp_list_midi_instrument_maps | ( | lscp_client_t * | pClient | ) |
Getting all created MIDI instrument maps: LIST MIDI_INSTRUMENT_MAPS
| pClient | Pointer to client instance structure. |
| lscp_midi_instrument_t* lscp_list_midi_instruments | ( | lscp_client_t * | pClient, | |
| int | iMidiMap | |||
| ) |
Getting indeces of all MIDI instrument map entries: LIST MIDI_INSTRUMENTS ALL|<midi-map>
| pClient | Pointer to client instance structure. | |
| iMidiMap | MIDI instrument map number, or LSCP_MIDI_MAP_ALL . |
| lscp_status_t lscp_load_engine | ( | lscp_client_t * | pClient, | |
| const char * | pszEngineName, | |||
| int | iSamplerChannel | |||
| ) |
Loading a sampler engine: LOAD ENGINE <engine-name> <sampler-channel>
| pClient | Pointer to client instance structure. | |
| pszEngineName | Engine name. | |
| iSamplerChannel | Sampler channel number. |
| lscp_status_t lscp_load_instrument | ( | lscp_client_t * | pClient, | |
| const char * | pszFileName, | |||
| int | iInstrIndex, | |||
| int | iSamplerChannel | |||
| ) |
Loading an instrument: LOAD INSTRUMENT <filename> <instr-index> <sampler-channel>
| pClient | Pointer to client instance structure. | |
| pszFileName | Instrument file name. | |
| iInstrIndex | Instrument index number. | |
| iSamplerChannel | Sampler Channel. |
| lscp_status_t lscp_load_instrument_non_modal | ( | lscp_client_t * | pClient, | |
| const char * | pszFileName, | |||
| int | iInstrIndex, | |||
| int | iSamplerChannel | |||
| ) |
Loading an instrument in the background (non modal): LOAD INSTRUMENT NON_MODAL <filename> <instr-index> <sampler-channel>
| pClient | Pointer to client instance structure. | |
| pszFileName | Instrument file name. | |
| iInstrIndex | Instrument index number. | |
| iSamplerChannel | Sampler Channel. |
| 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 | |||
| ) |
Create or replace a MIDI instrumnet map entry: MAP MIDI_INSTRUMENT <midi-map> <midi-bank> <midi-prog> <engine-name> <filename> <instr-index> <volume> [<load-mode> [<name>]}
| pClient | Pointer to client instance structure. | |
| pMidiInstr | MIDI instrument bank and program parameter key. | |
| pszEngineName | Engine name. | |
| pszFileName | Instrument file name. | |
| iInstrIndex | Instrument index number. | |
| fVolume | Reflects the master volume of the instrument as a positive floating point number, where a value less than 1.0 for attenuation, and greater than 1.0 for amplification. | |
| load_mode | Instrument load life-time strategy, either LSCP_LOAD_DEFAULT, or LSCP_LOAD_ON_DEMAND, or LSCP_LOAD_ON_DEMAND_HOLD, or LSCP_LOAD_PERSISTENT. | |
| pszName | Instrument custom name for the map entry (optional). |
| lscp_status_t lscp_remove_channel | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Removing a sampler channel: REMOVE CHANNEL <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| lscp_status_t lscp_remove_midi_instrument_map | ( | lscp_client_t * | pClient, | |
| int | iMidiMap | |||
| ) |
Delete one particular or all MIDI instrument maps: REMOVE MIDI_INSTRUMENT_MAP <midi-map>
| pClient | Pointer to client instance structure. | |
| iMidiMap | MIDI instrument map number. |
| lscp_status_t lscp_reset_channel | ( | lscp_client_t * | pClient, | |
| int | iSamplerChannel | |||
| ) |
Resetting a sampler channel: RESET CHANNEL <sampler-channel>
| pClient | Pointer to client instance structure. | |
| iSamplerChannel | Sampler channel number. |
| lscp_status_t lscp_reset_sampler | ( | lscp_client_t * | pClient | ) |
Resetting the sampler: RESET
| pClient | Pointer to client instance structure. |