liblscp  0.9.90
Data Structures | Macros | Functions
client.c File Reference
#include <locale.h>
#include "common.h"
#include <sys/time.h>
#include <sys/errno.h>

Data Structures

struct  _locale_t
 

Macros

#define LSCP_TIMEOUT_MSECS   500
 
#define USE_GETADDRINFO   1
 

Functions

const char * lscp_client_package (void)
 
const char * lscp_client_version (void)
 
const char * lscp_client_build (void)
 
lscp_client_tlscp_client_create (const char *pszHost, int iPort, lscp_client_proc_t pfnCallback, void *pvData)
 
lscp_status_t lscp_client_join (lscp_client_t *pClient)
 
lscp_status_t lscp_client_destroy (lscp_client_t *pClient)
 
lscp_status_t lscp_client_set_timeout (lscp_client_t *pClient, int iTimeout)
 
int lscp_client_get_timeout (lscp_client_t *pClient)
 
bool lscp_client_connection_lost (lscp_client_t *pClient)
 
lscp_status_t lscp_client_query (lscp_client_t *pClient, const char *pszQuery)
 
const char * lscp_client_get_result (lscp_client_t *pClient)
 
int lscp_client_get_errno (lscp_client_t *pClient)
 
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_get_events (lscp_client_t *pClient)
 
lscp_status_t lscp_load_instrument (lscp_client_t *pClient, const char *pszFileName, int iInstrIndex, int iSamplerChannel)
 
lscp_status_t lscp_load_instrument_non_modal (lscp_client_t *pClient, const char *pszFileName, int iInstrIndex, int iSamplerChannel)
 
lscp_status_t lscp_load_engine (lscp_client_t *pClient, const char *pszEngineName, int iSamplerChannel)
 
int lscp_get_channels (lscp_client_t *pClient)
 
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)
 
int lscp_get_available_engines (lscp_client_t *pClient)
 
const char ** lscp_list_available_engines (lscp_client_t *pClient)
 
lscp_engine_info_tlscp_get_engine_info (lscp_client_t *pClient, const char *pszEngineName)
 
lscp_channel_info_tlscp_get_channel_info (lscp_client_t *pClient, int iSamplerChannel)
 
int lscp_get_channel_voice_count (lscp_client_t *pClient, int iSamplerChannel)
 
int lscp_get_channel_stream_count (lscp_client_t *pClient, int iSamplerChannel)
 
int lscp_get_channel_stream_usage (lscp_client_t *pClient, int iSamplerChannel)
 
lscp_buffer_fill_tlscp_get_channel_buffer_fill (lscp_client_t *pClient, lscp_usage_t usage_type, int iSamplerChannel)
 
lscp_status_t lscp_set_channel_audio_type (lscp_client_t *pClient, int iSamplerChannel, const char *pszAudioDriver)
 
lscp_status_t lscp_set_channel_audio_device (lscp_client_t *pClient, int iSamplerChannel, int iAudioDevice)
 
lscp_status_t lscp_set_channel_audio_channel (lscp_client_t *pClient, int iSamplerChannel, int iAudioOut, int iAudioIn)
 
lscp_status_t lscp_set_channel_midi_type (lscp_client_t *pClient, int iSamplerChannel, const char *pszMidiDriver)
 
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)
 
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_tlscp_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)
 
float lscp_get_volume (lscp_client_t *pClient)
 
lscp_status_t lscp_set_volume (lscp_client_t *pClient, float fVolume)
 
int lscp_get_voices (lscp_client_t *pClient)
 
lscp_status_t lscp_set_voices (lscp_client_t *pClient, int iMaxVoices)
 
int lscp_get_streams (lscp_client_t *pClient)
 
lscp_status_t lscp_set_streams (lscp_client_t *pClient, int iMaxStreams)
 
int lscp_create_fxsend (lscp_client_t *pClient, int iSamplerChannel, int iMidiController, const char *pszFxName)
 
lscp_status_t lscp_destroy_fxsend (lscp_client_t *pClient, int iSamplerChannel, int iFxSend)
 
int lscp_get_fxsends (lscp_client_t *pClient, int iSamplerChannel)
 
int * lscp_list_fxsends (lscp_client_t *pClient, int iSamplerChannel)
 
lscp_fxsend_info_tlscp_get_fxsend_info (lscp_client_t *pClient, int iSamplerChannel, int iFxSend)
 
lscp_status_t lscp_set_fxsend_name (lscp_client_t *pClient, int iSamplerChannel, int iFxSend, const char *pszFxName)
 
lscp_status_t lscp_set_fxsend_audio_channel (lscp_client_t *pClient, int iSamplerChannel, int iFxSend, int iAudioSrc, int iAudioDst)
 
lscp_status_t lscp_set_fxsend_midi_controller (lscp_client_t *pClient, int iSamplerChannel, int iFxSend, int iMidiController)
 
lscp_status_t lscp_set_fxsend_level (lscp_client_t *pClient, int iSamplerChannel, int iFxSend, float fLevel)
 
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_tlscp_list_midi_instruments (lscp_client_t *pClient, int iMidiMap)
 
lscp_midi_instrument_info_tlscp_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)
 
lscp_status_t lscp_edit_channel_instrument (lscp_client_t *pClient, int iSamplerChannel)
 

Macro Definition Documentation

◆ LSCP_TIMEOUT_MSECS

#define LSCP_TIMEOUT_MSECS   500

Referenced by lscp_client_create().

◆ USE_GETADDRINFO

#define USE_GETADDRINFO   1

Function Documentation

◆ lscp_add_channel()

int lscp_add_channel ( lscp_client_t pClient)

Adding a new sampler channel: ADD CHANNEL

Parameters
pClientPointer to client instance structure.
Returns
The new sampler channel number identifier, or -1 in case of failure.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_add_midi_instrument_map()

int lscp_add_midi_instrument_map ( lscp_client_t pClient,
const char *  pszMapName 
)

Create a new MIDI instrument map: ADD MIDI_INSTRUMENT_MAP [<name>]

Parameters
pClientPointer to client instance structure.
pszMapNameMIDI instrument map name (optional)
Returns
The new MIDI instrument map number identifier, or -1 in case of failure.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_clear_midi_instruments()

lscp_status_t lscp_clear_midi_instruments ( lscp_client_t pClient,
int  iMidiMap 
)

Clear the MIDI instrumnet map: CLEAR MIDI_INSTRUMENTS ALL|<midi-map>

Parameters
pClientPointer to client instance structure.
iMidiMapMIDI instrument map number, or LSCP_MIDI_MAP_ALL .
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, and lscp_client_query().

◆ lscp_client_build()

const char* lscp_client_build ( void  )

Retrieve the current client library build string.

References LSCP_BUILD.

◆ lscp_client_connection_lost()

bool lscp_client_connection_lost ( lscp_client_t pClient)

Check whether connection to server is lost.

Parameters
pClientPointer to client instance structure.
Returns
true if client lost connection to server, false otherwise.

References lscp_client_get_errno().

◆ lscp_client_create()

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.

Parameters
pszHostHostname of the linuxsampler listening server.
iPortPort number of the linuxsampler listening server.
pfnCallbackCallback function to receive event notifications.
pvDataUser context opaque data, that will be passed to the callback function.
Returns
The new client instance pointer if successfull, which shall be used on all subsequent client calls, NULL otherwise.

References closesocket, INVALID_SOCKET, lscp_cond_init, LSCP_EVENT_NONE, lscp_mutex_init, lscp_socket_agent_init(), lscp_socket_getopts(), lscp_socket_herror(), lscp_socket_perror(), LSCP_TIMEOUT_MSECS, and SOCKET_ERROR.

◆ lscp_client_destroy()

lscp_status_t lscp_client_destroy ( lscp_client_t pClient)

Terminate and destroy a client instance.

Parameters
pClientPointer to client instance structure.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References lscp_cond_destroy, LSCP_FAILED, lscp_mutex_destroy, lscp_mutex_lock, lscp_mutex_unlock, LSCP_OK, and lscp_socket_agent_free().

◆ lscp_client_get_errno()

int lscp_client_get_errno ( lscp_client_t pClient)

Get the last error/warning number received.

Parameters
pClientPointer to client instance structure.
Returns
The numerical value of the last error or warning response code received.

Referenced by lscp_client_connection_lost().

◆ lscp_client_get_events()

lscp_event_t lscp_client_get_events ( lscp_client_t pClient)

Getting current subscribed events.

Parameters
pClientPointer to client instance structure.
Returns
The current subscrived bit-wise OR'ed event flags.

References LSCP_EVENT_NONE.

◆ lscp_client_get_result()

const char* lscp_client_get_result ( lscp_client_t pClient)

◆ lscp_client_get_timeout()

int lscp_client_get_timeout ( lscp_client_t pClient)

Get the client transaction timeout interval.

Parameters
pClientPointer to client instance structure.
Returns
The current timeout value milliseconds, -1 in case of failure.

◆ lscp_client_join()

lscp_status_t lscp_client_join ( lscp_client_t pClient)

Wait for a client instance to terminate graciously.

Parameters
pClientPointer to client instance structure.

References LSCP_FAILED, LSCP_OK, and lscp_socket_agent_join().

◆ lscp_client_package()

const char* lscp_client_package ( void  )

Retrieve the current client library version string.

References LSCP_PACKAGE.

◆ lscp_client_query()

lscp_status_t lscp_client_query ( lscp_client_t pClient,
const char *  pszQuery 
)

◆ lscp_client_set_timeout()

lscp_status_t lscp_client_set_timeout ( lscp_client_t pClient,
int  iTimeout 
)

Set the client transaction timeout interval.

Parameters
pClientPointer to client instance structure.
iTimeoutTransaction timeout in milliseconds.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_FAILED, and LSCP_OK.

◆ lscp_client_subscribe()

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

The old events occupy the lower 16 bits (as bit flags), and all younger events enumerate the whole upper 16 bits range. The new, enumerated events are namely:

SUBSCRIBE CHANNEL_MIDI
Parameters
pClientPointer to client instance structure.
eventsLSCP event to subscribe.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_EVENT_NONE, LSCP_FAILED, lscp_mutex_lock, and LSCP_OK.

◆ lscp_client_unsubscribe()

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

The old events occupy the lower 16 bits (as bit flags), and all younger events enumerate the whole upper 16 bits range. The new, enumerated events are namely:

UNSUBSCRIBE CHANNEL_MIDI
Parameters
pClientPointer to client instance structure.
eventsLSCP event to unsubscribe.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_EVENT_CHANNEL_COUNT, LSCP_FAILED, lscp_mutex_lock, and LSCP_OK.

◆ lscp_client_version()

const char* lscp_client_version ( void  )

Retrieve the current client library version string.

References LSCP_VERSION.

◆ lscp_create_fxsend()

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> [<fx-name>]

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iMidiControllerMIDI controller used to alter the effect, usually a number between 0 and 127.
pszFxNameOptional name for the effect send entity, does not have to be unique.
Returns
The new effect send number identifier, or -1 in case of failure.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_destroy_fxsend()

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>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iFxSendEffect send number.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_edit_channel_instrument()

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>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler Channel.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_get_available_engines()

int lscp_get_available_engines ( lscp_client_t pClient)

Getting all available engines count: GET AVAILABLE_ENGINES

Parameters
pClientPointer to client instance structure.
Returns
The current total number of sampler engines on success, -1 otherwise.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_channel_buffer_fill()

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>

Parameters
pClientPointer to client instance structure.
usage_typeUsage type to be returned, either LSCP_USAGE_BYTES, or LSCP_USAGE_PERCENTAGE.
iSamplerChannelSampler channel number.
Returns
A pointer to a lscp_buffer_fill_t structure, with the information of the current disk stream buffer fill usage, for the given sampler channel, or NULL in case of failure.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_get_channel_stream_count(), lscp_mutex_lock, lscp_mutex_unlock, LSCP_OK, LSCP_USAGE_BYTES, _lscp_buffer_fill_t::stream_id, and _lscp_buffer_fill_t::stream_usage.

◆ lscp_get_channel_info()

lscp_channel_info_t* lscp_get_channel_info ( lscp_client_t pClient,
int  iSamplerChannel 
)

Getting sampler channel informations: GET CHANNEL INFO <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
A pointer to a lscp_channel_info_t structure, with all the information of the given sampler channel, or NULL in case of failure.

References LSCP_BUFSIZ, and lscp_mutex_lock.

◆ lscp_get_channel_stream_count()

int lscp_get_channel_stream_count ( lscp_client_t pClient,
int  iSamplerChannel 
)

Current number of active disk streams: GET CHANNEL STREAM_COUNT <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
The number of active disk streams on success, -1 otherwise.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

Referenced by lscp_get_channel_buffer_fill().

◆ lscp_get_channel_stream_usage()

int lscp_get_channel_stream_usage ( lscp_client_t pClient,
int  iSamplerChannel 
)

Current least usage of active disk streams.

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
The usage percentage of the least filled active disk stream on success, -1 otherwise.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_channel_voice_count()

int lscp_get_channel_voice_count ( lscp_client_t pClient,
int  iSamplerChannel 
)

Current number of active voices: GET CHANNEL VOICE_COUNT <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
The number of voices currently active, -1 in case of failure.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_channels()

int lscp_get_channels ( lscp_client_t pClient)

Current number of sampler channels: GET CHANNELS

Parameters
pClientPointer to client instance structure.
Returns
The current total number of sampler channels on success, -1 otherwise.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_engine_info()

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>

Parameters
pClientPointer to client instance structure.
pszEngineNameEngine name.
Returns
A pointer to a lscp_engine_info_t structure, with all the information of the given sampler engine, or NULL in case of failure.

References _lscp_engine_info_t::description, LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, LSCP_OK, and _lscp_engine_info_t::version.

◆ lscp_get_fxsend_info()

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>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iFxSendEffect send number.
Returns
A pointer to a lscp_fxsend_info_t structure, with the information of the given FX send, or NULL in case of failure.

References LSCP_BUFSIZ, and lscp_mutex_lock.

◆ lscp_get_fxsends()

int lscp_get_fxsends ( lscp_client_t pClient,
int  iSamplerChannel 
)

Get amount of effect sends on a sampler channel: GET FX_SENDS <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
The current total number of effect sends of the sampler channel on success, -1 otherwise.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_midi_instrument_info()

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>

Parameters
pClientPointer to client instance structure.
pMidiInstrMIDI instrument bank and program parameter key.
Returns
A pointer to a lscp_midi_instrument_info_t structure, with all the information of the given MIDI instrument map entry, or NULL in case of failure.

References _lscp_midi_instrument_t::bank, LSCP_BUFSIZ, lscp_mutex_lock, _lscp_midi_instrument_t::map, and _lscp_midi_instrument_t::prog.

◆ lscp_get_midi_instrument_map_name()

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>

Parameters
pClientPointer to client instance structure.
iMidiMapMIDI instrument map number.
Returns
The MIDI instrument map name on success, NULL on failure.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_midi_instrument_maps()

int lscp_get_midi_instrument_maps ( lscp_client_t pClient)

Get amount of existing MIDI instrument maps: GET MIDI_INSTRUMENT_MAPS

Parameters
pClientPointer to client instance structure.
Returns
The current total number of MIDI instrument maps on success, -1 otherwise.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_midi_instruments()

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>

Parameters
pClientPointer to client instance structure.
iMidiMapMIDI instrument map number, or LSCP_MIDI_MAP_ALL .
Returns
The current total number of MIDI instrument map entries on success, -1 otherwise.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_server_info()

lscp_server_info_t* lscp_get_server_info ( lscp_client_t pClient)

Getting information about the server. GET SERVER INFO

Parameters
pClientPointer to client instance structure.
Returns
A pointer to a lscp_server_info_t structure, with all the information of the current connected server, or NULL in case of failure.

References _lscp_server_info_t::description, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, LSCP_OK, _lscp_server_info_t::protocol_version, and _lscp_server_info_t::version.

◆ lscp_get_streams()

int lscp_get_streams ( lscp_client_t pClient)

Get global disk streams limit setting:

GET STREAMS

This value reflects the maximum amount of disk streams a sampler engine processes simultaniously.

Parameters
pClientPointer to client instance structure.
Returns
The current global maximum amount of disk streams limit or a negative value on error (e.g. if sampler doesn't support this command).

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_total_voice_count()

int lscp_get_total_voice_count ( lscp_client_t pClient)

Current total number of active voices: GET TOTAL_VOICE_COUNT

Parameters
pClientPointer to client instance structure.
Returns
The total number of voices currently active, -1 in case of failure.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_total_voice_count_max()

int lscp_get_total_voice_count_max ( lscp_client_t pClient)

Maximum amount of active voices: GET TOTAL_VOICE_COUNT_MAX

Parameters
pClientPointer to client instance structure.
Returns
The maximum amount of voices currently active, -1 in case of failure.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_voices()

int lscp_get_voices ( lscp_client_t pClient)

Get global voice limit setting:

GET VOICES

This value reflects the maximum amount of voices a sampler engine processes simultaniously before voice stealing kicks in.

Parameters
pClientPointer to client instance structure.
Returns
The current global maximum amount of voices limit or a negative value on error (e.g. if sampler doesn't support this command).

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_get_volume()

float lscp_get_volume ( lscp_client_t pClient)

Get global volume attenuation: GET VOLUME

Parameters
pClientPointer to client instance structure.
Returns
The global volume as positive floating point value usually in the range between 0.0 and 1.0; in case of failure 0.0 is returned.

References lscp_mutex_lock.

◆ lscp_list_available_engines()

const char** lscp_list_available_engines ( lscp_client_t pClient)

Getting all available engines: LIST AVAILABLE_ENGINES

Parameters
pClientPointer to client instance structure.
Returns
A NULL terminated array of engine name strings, or NULL in case of failure.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_list_channels()

int* lscp_list_channels ( lscp_client_t pClient)

List current sampler channels number identifiers: LIST CHANNELS

Parameters
pClientPointer to client instance structure.
Returns
An array of the sampler channels identifiers as positive integers, terminated with -1 on success, NULL otherwise.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_list_fxsends()

int* lscp_list_fxsends ( lscp_client_t pClient,
int  iSamplerChannel 
)

List all effect sends on a sampler channel: LIST FX_SENDS <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
An array of the effect sends identifiers as positive integers, terminated with -1 on success, NULL otherwise.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_list_midi_instrument_maps()

int* lscp_list_midi_instrument_maps ( lscp_client_t pClient)

Getting all created MIDI instrument maps: LIST MIDI_INSTRUMENT_MAPS

Parameters
pClientPointer to client instance structure.
Returns
An array of the MIDI instrument map identifiers as positive integers, terminated with -1 on success, NULL otherwise.

References lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_list_midi_instruments()

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>

Parameters
pClientPointer to client instance structure.
iMidiMapMIDI instrument map number, or LSCP_MIDI_MAP_ALL .
Returns
An array of lscp_midi_instrument_t, terminated with the {-1,-1,-1} triplet, NULL otherwise.

References LSCP_BUFSIZ, lscp_client_get_result(), lscp_mutex_lock, lscp_mutex_unlock, and LSCP_OK.

◆ lscp_load_engine()

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>

Parameters
pClientPointer to client instance structure.
pszEngineNameEngine name.
iSamplerChannelSampler channel number.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_load_instrument()

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>

Parameters
pClientPointer to client instance structure.
pszFileNameInstrument file name.
iInstrIndexInstrument index number.
iSamplerChannelSampler Channel.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_load_instrument_non_modal()

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>

Parameters
pClientPointer to client instance structure.
pszFileNameInstrument file name.
iInstrIndexInstrument index number.
iSamplerChannelSampler Channel.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_map_midi_instrument()

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>]}

Parameters
pClientPointer to client instance structure.
pMidiInstrMIDI instrument bank and program parameter key.
pszEngineNameEngine name.
pszFileNameInstrument file name.
iInstrIndexInstrument index number.
fVolumeReflects 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_modeInstrument load life-time strategy, either LSCP_LOAD_DEFAULT, or LSCP_LOAD_ON_DEMAND, or LSCP_LOAD_ON_DEMAND_HOLD, or LSCP_LOAD_PERSISTENT.
pszNameInstrument custom name for the map entry (optional).
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References _lscp_midi_instrument_t::bank, LSCP_BUFSIZ, LSCP_FAILED, _lscp_midi_instrument_t::map, and _lscp_midi_instrument_t::prog.

◆ lscp_remove_channel()

lscp_status_t lscp_remove_channel ( lscp_client_t pClient,
int  iSamplerChannel 
)

Removing a sampler channel: REMOVE CHANNEL <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_remove_midi_instrument_map()

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>

Parameters
pClientPointer to client instance structure.
iMidiMapMIDI instrument map number.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_reset_channel()

lscp_status_t lscp_reset_channel ( lscp_client_t pClient,
int  iSamplerChannel 
)

Resetting a sampler channel: RESET CHANNEL <sampler-channel>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_reset_sampler()

lscp_status_t lscp_reset_sampler ( lscp_client_t pClient)

Resetting the sampler: RESET

Parameters
pClientPointer to client instance structure.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References lscp_client_query().

◆ lscp_set_channel_audio_channel()

lscp_status_t lscp_set_channel_audio_channel ( lscp_client_t pClient,
int  iSamplerChannel,
int  iAudioOut,
int  iAudioIn 
)

Setting audio output channel: SET CHANNEL AUDIO_OUTPUT_CHANNEL <sampler-channel> <audio-output-chan> <audio-input-chan>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iAudioOutAudio output device channel to be routed from.
iAudioInAudio output device channel to be routed into.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_audio_device()

lscp_status_t lscp_set_channel_audio_device ( lscp_client_t pClient,
int  iSamplerChannel,
int  iAudioDevice 
)

Setting audio output device: SET CHANNEL AUDIO_OUTPUT_DEVICE <sampler-channel> <device-id>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iAudioDeviceAudio output device number identifier.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_audio_type()

lscp_status_t lscp_set_channel_audio_type ( lscp_client_t pClient,
int  iSamplerChannel,
const char *  pszAudioDriver 
)

Setting audio output type: SET CHANNEL AUDIO_OUTPUT_TYPE <sampler-channel> <audio-output-type>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
pszAudioDriverAudio output driver type (e.g. "ALSA" or "JACK").
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_midi_channel()

lscp_status_t lscp_set_channel_midi_channel ( lscp_client_t pClient,
int  iSamplerChannel,
int  iMidiChannel 
)

Setting MIDI input channel: SET CHANNEL MIDI_INPUT_CHANNEL <sampler-channel> <midi-input-chan>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iMidiChannelMIDI channel address number to listen (0-15) or LSCP_MIDI_CHANNEL_ALL (16) to listen on all channels.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), LSCP_FAILED, and LSCP_MIDI_CHANNEL_ALL.

◆ lscp_set_channel_midi_device()

lscp_status_t lscp_set_channel_midi_device ( lscp_client_t pClient,
int  iSamplerChannel,
int  iMidiDevice 
)

Setting MIDI input device: SET CHANNEL MIDI_INPUT_DEVICE <sampler-channel> <device-id>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iMidiDeviceMIDI input device number identifier.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_midi_map()

lscp_status_t lscp_set_channel_midi_map ( lscp_client_t pClient,
int  iSamplerChannel,
int  iMidiMap 
)

Setting MIDI instrument map: SET CHANNEL MIDI_INSTRUMENT_MAP <sampler-channel> <midi-map>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iMidiMapMIDI instrument map number, or either LSCP_MIDI_MAP_NONE or LSCP_MIDI_MAP_DEFAULT .
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), LSCP_FAILED, LSCP_MIDI_MAP_DEFAULT, and LSCP_MIDI_MAP_NONE.

◆ lscp_set_channel_midi_port()

lscp_status_t lscp_set_channel_midi_port ( lscp_client_t pClient,
int  iSamplerChannel,
int  iMidiPort 
)

Setting MIDI input port: SET CHANNEL MIDI_INPUT_PORT <sampler-channel> <midi-input-port>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iMidiPortMIDI input driver virtual port number.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_midi_type()

lscp_status_t lscp_set_channel_midi_type ( lscp_client_t pClient,
int  iSamplerChannel,
const char *  pszMidiDriver 
)

Setting MIDI input type: SET CHANNEL MIDI_INPUT_TYPE <sampler-channel> <midi-input-type>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
pszMidiDriverMIDI input driver type (e.g. "ALSA").
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_mute()

lscp_status_t lscp_set_channel_mute ( lscp_client_t pClient,
int  iSamplerChannel,
int  iMute 
)

Muting a sampler channel: SET CHANNEL MUTE <sampler-channel> <mute>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iMuteSampler channel mute state as a boolean value, either 1 (one) to mute the channel or 0 (zero) to unmute the channel.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_solo()

lscp_status_t lscp_set_channel_solo ( lscp_client_t pClient,
int  iSamplerChannel,
int  iSolo 
)

Soloing a sampler channel: SET CHANNEL SOLO <sampler-channel> <solo>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iSoloSampler channel solo state as a boolean value, either 1 (one) to solo the channel or 0 (zero) to unsolo the channel.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_channel_volume()

lscp_status_t lscp_set_channel_volume ( lscp_client_t pClient,
int  iSamplerChannel,
float  fVolume 
)

Setting channel volume: SET CHANNEL VOLUME <sampler-channel> <volume>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
fVolumeSampler channel volume as a positive floating point number, where a value less than 1.0 for attenuation, and greater than 1.0 for amplification.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, and LSCP_FAILED.

◆ lscp_set_fxsend_audio_channel()

lscp_status_t lscp_set_fxsend_audio_channel ( lscp_client_t pClient,
int  iSamplerChannel,
int  iFxSend,
int  iAudioSrc,
int  iAudioDst 
)

Alter effect send's audio routing: SET FX_SEND AUDIO_OUTPUT_CHANNEL <sampler-chan> <fx-send-id> <audio-src> <audio-dst>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iFxSendEffect send number.
iAudioSrcAudio output device channel to be routed from.
iAudioDstAudio output device channel to be routed into.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_fxsend_level()

lscp_status_t lscp_set_fxsend_level ( lscp_client_t pClient,
int  iSamplerChannel,
int  iFxSend,
float  fLevel 
)

Alter effect send's audio level: SET FX_SEND LEVEL <sampler-chan> <fx-send-id> <level>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iFxSendEffect send number.
fLevelEffect send volume level.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, and LSCP_FAILED.

◆ lscp_set_fxsend_midi_controller()

lscp_status_t lscp_set_fxsend_midi_controller ( lscp_client_t pClient,
int  iSamplerChannel,
int  iFxSend,
int  iMidiController 
)

Alter effect send's MIDI controller: SET FX_SEND MIDI_CONTROLLER <sampler-chan> <fx-send-id> <midi-ctrl>

Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iFxSendEffect send number.
iMidiControllerMIDI controller used to alter the effect, usually a number between 0 and 127.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_fxsend_name()

lscp_status_t lscp_set_fxsend_name ( lscp_client_t pClient,
int  iSamplerChannel,
int  iFxSend,
const char *  pszFxName 
)

Alter effect send's name:

SET FX_SEND NAME <sampler-chan> <fx-send-id> <name>
Parameters
pClientPointer to client instance structure.
iSamplerChannelSampler channel number.
iFxSendEffect send number.
pszFxNameEffect send's new name.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_midi_instrument_map_name()

lscp_status_t lscp_set_midi_instrument_map_name ( lscp_client_t pClient,
int  iMidiMap,
const char *  pszMapName 
)

Renaming a MIDI instrument map: SET MIDI_INSTRUMENT_MAP NAME <midi-map> <map-name>

Parameters
pClientPointer to client instance structure.
iMidiMapMIDI instrument map number.
pszMapNameMIDI instrument map name.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_streams()

lscp_status_t lscp_set_streams ( lscp_client_t pClient,
int  iMaxStreams 
)

Setting global disk streams limit setting:

SET STREAMS <max-streams>

This value reflects the maximum amount of dist streams a sampler engine instance processes simultaniously. Note that this value will be passed to all sampler engine instances, that is the total amount of maximum disk streams on the running system is thus

Parameters
iMaxStreamsmultiplied with the current amount of sampler engine instances.
pClientPointer to client instance structure.
iMaxStreamsGlobal streams limit setting as positive integer value (larger or equal to 0).
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_voices()

lscp_status_t lscp_set_voices ( lscp_client_t pClient,
int  iMaxVoices 
)

Setting global voice limit setting:

SET VOICES <max-voices>

This value reflects the maximum amount of voices a sampler engine processes simultaniously before voice stealing kicks in. Note that this value will be passed to all sampler engine instances, that is the total amount of maximum voices on the running system is thus

Parameters
iMaxVoicesmultiplied with the current amount of sampler engine instances.
pClientPointer to client instance structure.
iMaxVoicesGlobal voice limit setting as integer value larger or equal to 1.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, lscp_client_query(), and LSCP_FAILED.

◆ lscp_set_volume()

lscp_status_t lscp_set_volume ( lscp_client_t pClient,
float  fVolume 
)

Setting global volume attenuation: SET VOLUME <volume>

Parameters
pClientPointer to client instance structure.
fVolumeGlobal volume parameter as positive floating point value usually be in the range between 0.0 and 1.0, that is for attenuating the overall volume.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References LSCP_BUFSIZ, and LSCP_FAILED.

◆ lscp_unmap_midi_instrument()

lscp_status_t lscp_unmap_midi_instrument ( lscp_client_t pClient,
lscp_midi_instrument_t pMidiInstr 
)

Remove an entry from the MIDI instrument map: UNMAP MIDI_INSTRUMENT <midi-map> <midi-bank> <midi-prog>

Parameters
pClientPointer to client instance structure.
pMidiInstrMIDI instrument bank and program parameter key.
Returns
LSCP_OK on success, LSCP_FAILED otherwise.

References _lscp_midi_instrument_t::bank, LSCP_BUFSIZ, lscp_client_query(), LSCP_FAILED, _lscp_midi_instrument_t::map, and _lscp_midi_instrument_t::prog.