example_client.c File Reference
`#include "lscp/client.h"`
`#include "lscp/device.h"`
`#include <time.h>`

## Macros

#define | SERVER_PORT 8888
#define | CLIENT_TEST(p, t, x)

## Typedefs

typedef int * | isplit
typedef char ** | szsplit
typedef lscp_status_t | status
typedef lscp_driver_info_t * | driver_info
typedef lscp_device_info_t * | device_info
typedef lscp_device_port_info_t * | device_port_info
typedef lscp_param_info_t * | param_info
typedef lscp_server_info_t * | server_info
typedef lscp_engine_info_t * | engine_info
typedef lscp_channel_info_t * | channel_info
typedef lscp_buffer_fill_t * | buffer_fill
typedef lscp_fxsend_info_t * | fxsend_info
typedef lscp_midi_instrument_t * | midi_instruments
typedef lscp_midi_instrument_info_t * | midi_instrument_info

## Functions

lscp_status_t | client_callback (lscp_client_t *pClient, lscp_event_t event, const char *pchData, int cchData, void *pvData)
int | client_test_int (int i)
int | client_test_status (lscp_status_t s)
int | client_test_isplit (int *piSplit)
int | client_test_szsplit (char **ppszSplit)
int | client_test_params (lscp_param_t *pParams)
int | client_test_midi_instruments (lscp_midi_instrument_t *pInstrs)
int | client_test_param_info (lscp_param_info_t *pParamInfo)
int | client_test_driver_info (lscp_driver_info_t *pDriverInfo)
int | client_test_device_info (lscp_device_info_t *pDeviceInfo)
int | client_test_device_port_info (lscp_device_port_info_t *pDevicePortInfo)
int | client_test_server_info (lscp_server_info_t *pServerInfo)
int | client_test_engine_info (lscp_engine_info_t *pEngineInfo)
int | client_test_channel_info (lscp_channel_info_t *pChannelInfo)
int | client_test_fxsend_info (lscp_fxsend_info_t *pFxSendInfo)
int | client_test_buffer_fill (lscp_buffer_fill_t *pBufferFill)
int | client_test_load_mode (lscp_load_mode_t load_mode)
int | client_test_midi_instrument_info (lscp_midi_instrument_info_t *pInstrInfo)
void | client_test_start (clock_t *pclk)
float | client_test_elapsed (clock_t *pclk)
void | client_test_engine (lscp_client_t *pClient, const char *pszEngine, const char *pszAudioDriver, int iAudioDevice, const char *pszMidiDriver, int iMidiDevice)
void | client_test_midi_port (lscp_client_t *pClient, int iMidiDevice, int iMidiPort)
void | client_test_audio_channel (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel)
void | client_test_midi_device (lscp_client_t *pClient, int iMidiDevice)
void | client_test_audio_device (lscp_client_t *pClient, int iAudioDevice)
void | client_test_midi_driver (lscp_client_t *pClient, const char *pszMidiDriver)
void | client_test_audio_driver (lscp_client_t *pClient, const char *pszAudioDriver)
void | client_test_all (lscp_client_t *pClient, int step)
void | client_usage (void)
void | client_prompt (void)
int | main (int argc, char *argv[])

## Macro Definition Documentation

#define CLIENT_TEST | ( |  | p,
|  |  | t,
|  |  | x
| ) |  |

Value:
{ clock_t c; void *v; g_test_count++; \
printf("\n" #x ":\n"); client_test_start(&c); v = (void *) (x); \
printf(" elapsed=%gs errno=%d result='%s...' ret=", \
client_test_elapsed(&c), \
lscp_client_get_errno(p), \
lscp_client_get_result(p)); \
if (client_test_##t((t)(v))) { g_test_fails++; getchar(); } \
else if (g_test_step) getchar(); }
lscp_client_get_result
const char * lscp_client_get_result(lscp_client_t *pClient)
Definition: client.c:590
lscp_client_get_errno
int lscp_client_get_errno(lscp_client_t *pClient)
Definition: client.c:607
client_test_start
void client_test_start(clock_t *pclk)
Definition: example_client.c:337
client_test_elapsed
float client_test_elapsed(clock_t *pclk)
Definition: example_client.c:338

Referenced by client_test_all(), client_test_audio_channel(), client_test_audio_device(), client_test_audio_driver(), client_test_engine(), client_test_midi_device(), client_test_midi_driver(), and client_test_midi_port().

#define SERVER_PORT 8888

Referenced by main().

## Typedef Documentation

typedef lscp_buffer_fill_t* buffer_fill

typedef lscp_channel_info_t* channel_info

typedef lscp_device_info_t* device_info

typedef lscp_device_port_info_t* device_port_info

typedef lscp_driver_info_t* driver_info

typedef lscp_engine_info_t* engine_info

typedef lscp_fxsend_info_t* fxsend_info

typedef int* isplit

typedef lscp_midi_instrument_info_t* midi_instrument_info

typedef lscp_midi_instrument_t* midi_instruments

typedef lscp_param_info_t* param_info

typedef lscp_server_info_t* server_info

typedef lscp_status_t status

typedef char** szsplit

## Function Documentation

lscp_status_t client_callback | ( | lscp_client_t * | pClient,
|  | lscp_event_t | event,
|  | const char * | pchData,
|  | int | cchData,
|  | void * | pvData
| ) |  |

References lscp_event_to_text(), LSCP_FAILED, and LSCP_OK.

Referenced by main().

void client_prompt | ( | void |  | ) |

Referenced by main().

void client_test_all | ( | lscp_client_t * | pClient,
|  | int | step
| ) |  |

References _lscp_midi_instrument_t::bank, CLIENT_TEST, client_test_audio_device(), client_test_audio_driver(), client_test_engine(), client_test_midi_device(), client_test_midi_driver(), lscp_add_midi_instrument_map(), lscp_clear_midi_instruments(), lscp_create_audio_device(), lscp_create_midi_device(), lscp_destroy_audio_device(), lscp_destroy_midi_device(), lscp_get_audio_devices(), lscp_get_available_audio_drivers(), lscp_get_available_engines(), lscp_get_available_midi_drivers(), lscp_get_midi_devices(), lscp_get_midi_instrument_info(), lscp_get_midi_instruments(), lscp_get_server_info(), lscp_get_volume(), lscp_list_audio_devices(), lscp_list_available_audio_drivers(), lscp_list_available_engines(), lscp_list_available_midi_drivers(), lscp_list_midi_devices(), lscp_list_midi_instruments(), LSCP_LOAD_ON_DEMAND, lscp_map_midi_instrument(), LSCP_MIDI_MAP_ALL, lscp_remove_midi_instrument_map(), lscp_reset_sampler(), lscp_set_midi_instrument_map_name(), lscp_set_volume(), lscp_unmap_midi_instrument(), _lscp_midi_instrument_t::map, and _lscp_midi_instrument_t::prog.

Referenced by main().

void client_test_audio_channel | ( | lscp_client_t * | pClient,
|  | int | iAudioDevice,
|  | int | iAudioChannel
| ) |  |

References CLIENT_TEST, _lscp_param_t::key, lscp_get_audio_channel_info(), lscp_get_audio_channel_param_info(), and _lscp_device_port_info_t::params.

Referenced by client_test_audio_device().

void client_test_audio_device | ( | lscp_client_t * | pClient,
|  | int | iAudioDevice
| ) |  |

References CLIENT_TEST, client_test_audio_channel(), lscp_get_audio_device_info(), lscp_get_param_value(), and _lscp_device_info_t::params.

Referenced by client_test_all().

void client_test_audio_driver | ( | lscp_client_t * | pClient,
|  | const char * | pszAudioDriver
| ) |  |

References CLIENT_TEST, lscp_get_audio_driver_info(), lscp_get_audio_driver_param_info(), and _lscp_driver_info_t::parameters.

Referenced by client_test_all().

int client_test_buffer_fill | ( | lscp_buffer_fill_t * | pBufferFill | ) |

int client_test_channel_info | ( | lscp_channel_info_t * | pChannelInfo | ) |

References _lscp_channel_info_t::audio_channels, _lscp_channel_info_t::audio_device, _lscp_channel_info_t::audio_routing, client_test_isplit(), _lscp_channel_info_t::engine_name, _lscp_channel_info_t::instrument_file, _lscp_channel_info_t::instrument_name, _lscp_channel_info_t::instrument_nr, _lscp_channel_info_t::instrument_status, _lscp_channel_info_t::midi_channel, _lscp_channel_info_t::midi_device, _lscp_channel_info_t::midi_map, _lscp_channel_info_t::midi_port, _lscp_channel_info_t::mute, _lscp_channel_info_t::solo, and _lscp_channel_info_t::volume.

int client_test_device_info | ( | lscp_device_info_t * | pDeviceInfo | ) |

References client_test_params(), _lscp_device_info_t::driver, and _lscp_device_info_t::params.

int client_test_device_port_info | ( | lscp_device_port_info_t * | pDevicePortInfo | ) |

References client_test_params(), _lscp_device_port_info_t::name, and _lscp_device_port_info_t::params.

int client_test_driver_info | ( | lscp_driver_info_t * | pDriverInfo | ) |

References client_test_szsplit(), _lscp_driver_info_t::description, _lscp_driver_info_t::parameters, and _lscp_driver_info_t::version.

float client_test_elapsed | ( | clock_t * | pclk | ) |

void client_test_engine | ( | lscp_client_t * | pClient,
|  | const char * | pszEngine,
|  | const char * | pszAudioDriver,
|  | int | iAudioDevice,
|  | const char * | pszMidiDriver,
|  | int | iMidiDevice
| ) |  |

References CLIENT_TEST, lscp_add_channel(), lscp_create_fxsend(), lscp_destroy_fxsend(), lscp_get_channel_buffer_fill(), lscp_get_channel_info(), lscp_get_channel_stream_count(), lscp_get_channel_stream_usage(), lscp_get_channel_voice_count(), lscp_get_channels(), lscp_get_engine_info(), lscp_get_fxsend_info(), lscp_get_fxsends(), lscp_get_total_voice_count(), lscp_get_total_voice_count_max(), lscp_list_channels(), lscp_list_fxsends(), lscp_load_engine(), lscp_load_instrument(), lscp_remove_channel(), lscp_reset_channel(), lscp_set_channel_audio_channel(), lscp_set_channel_audio_device(), lscp_set_channel_audio_type(), lscp_set_channel_midi_channel(), lscp_set_channel_midi_device(), lscp_set_channel_midi_port(), lscp_set_channel_midi_type(), lscp_set_channel_mute(), lscp_set_channel_solo(), lscp_set_channel_volume(), lscp_set_fxsend_audio_channel(), lscp_set_fxsend_level(), lscp_set_fxsend_midi_controller(), LSCP_USAGE_BYTES, and LSCP_USAGE_PERCENTAGE.

Referenced by client_test_all().

int client_test_engine_info | ( | lscp_engine_info_t * | pEngineInfo | ) |

References _lscp_engine_info_t::description, and _lscp_engine_info_t::version.

int client_test_fxsend_info | ( | lscp_fxsend_info_t * | pFxSendInfo | ) |

References _lscp_fxsend_info_t::audio_routing, client_test_isplit(), _lscp_fxsend_info_t::level, _lscp_fxsend_info_t::midi_controller, and _lscp_fxsend_info_t::name.

int client_test_int | ( | int | i | ) |

int client_test_isplit | ( | int * | piSplit | ) |

Referenced by client_test_channel_info(), and client_test_fxsend_info().

int client_test_load_mode | ( | lscp_load_mode_t | load_mode | ) |

References LSCP_LOAD_ON_DEMAND, LSCP_LOAD_ON_DEMAND_HOLD, and LSCP_LOAD_PERSISTENT.

Referenced by client_test_midi_instrument_info().

void client_test_midi_device | ( | lscp_client_t * | pClient,
|  | int | iMidiDevice
| ) |  |

References CLIENT_TEST, client_test_midi_port(), lscp_get_midi_device_info(), lscp_get_param_value(), and _lscp_device_info_t::params.

Referenced by client_test_all().

void client_test_midi_driver | ( | lscp_client_t * | pClient,
|  | const char * | pszMidiDriver
| ) |  |

References CLIENT_TEST, lscp_get_midi_driver_info(), lscp_get_midi_driver_param_info(), and _lscp_driver_info_t::parameters.

Referenced by client_test_all().

int client_test_midi_instrument_info | ( | lscp_midi_instrument_info_t * | pInstrInfo | ) |

References client_test_load_mode(), _lscp_midi_instrument_info_t::engine_name, _lscp_midi_instrument_info_t::instrument_file, _lscp_midi_instrument_info_t::instrument_name, _lscp_midi_instrument_info_t::instrument_nr, _lscp_midi_instrument_info_t::load_mode, _lscp_midi_instrument_info_t::name, and _lscp_midi_instrument_info_t::volume.

int client_test_midi_instruments | ( | lscp_midi_instrument_t * | pInstrs | ) |

References _lscp_midi_instrument_t::prog.

void client_test_midi_port | ( | lscp_client_t * | pClient,
|  | int | iMidiDevice,
|  | int | iMidiPort
| ) |  |

References CLIENT_TEST, _lscp_param_t::key, lscp_get_midi_port_info(), lscp_get_midi_port_param_info(), and _lscp_device_port_info_t::params.

Referenced by client_test_midi_device().

int client_test_param_info | ( | lscp_param_info_t * | pParamInfo | ) |

References client_test_szsplit(), _lscp_param_info_t::defaultv, _lscp_param_info_t::depends, _lscp_param_info_t::description, _lscp_param_info_t::fix, LSCP_TYPE_BOOL, LSCP_TYPE_FLOAT, LSCP_TYPE_INT, LSCP_TYPE_STRING, _lscp_param_info_t::mandatory, _lscp_param_info_t::multiplicity, _lscp_param_info_t::possibilities, _lscp_param_info_t::range_max, _lscp_param_info_t::range_min, and _lscp_param_info_t::type.

int client_test_params | ( | lscp_param_t * | pParams | ) |

References _lscp_param_t::key.

Referenced by client_test_device_info(), and client_test_device_port_info().

int client_test_server_info | ( | lscp_server_info_t * | pServerInfo | ) |

References _lscp_server_info_t::description, _lscp_server_info_t::protocol_version, and _lscp_server_info_t::version.

void client_test_start | ( | clock_t * | pclk | ) |

int client_test_status | ( | lscp_status_t | s | ) |

References LSCP_ERROR, LSCP_FAILED, LSCP_OK, LSCP_QUIT, LSCP_TIMEOUT, and LSCP_WARNING.

int client_test_szsplit | ( | char ** | ppszSplit | ) |

Referenced by client_test_driver_info(), and client_test_param_info().

void client_usage | ( | void |  | ) |

References lscp_client_build(), lscp_client_package(), and lscp_client_version().

Referenced by main().

int main | ( | int | argc,
|  | char * | argv[]
| ) |  |

References client_callback(), client_prompt(), client_test_all(), client_usage(), lscp_client_create(), lscp_client_destroy(), lscp_client_get_errno(), lscp_client_get_result(), lscp_client_query(), lscp_client_subscribe(), lscp_client_unsubscribe(), LSCP_EVENT_MISCELLANEOUS, LSCP_QUIT, and SERVER_PORT.