device.h
Go to the documentation of this file.
// device.h
//
/****************************************************************************
liblscp - LinuxSampler Control Protocol API
Copyright (C) 2004-2021, 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
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
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 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.
*****************************************************************************/
#ifndef __LSCP_DEVICE_H
#define __LSCP_DEVICE_H
#include "lscp/client.h"
#if defined(__cplusplus)
extern "C" {
#endif
//-------------------------------------------------------------------------
// Device driver information structures.
typedef enum _lscp_type_t
{
LSCP_TYPE_NONE = 0,
LSCP_TYPE_BOOL,
LSCP_TYPE_INT,
LSCP_TYPE_FLOAT,
LSCP_TYPE_STRING
} lscp_type_t;
typedef struct _lscp_param_t
{
char * key;
char * value;
} lscp_param_t;
typedef struct _lscp_param_info_t
{
lscp_type_t type;
char * description;
int mandatory;
int fix;
int multiplicity;
char ** depends;
char * defaultv;
char * range_min;
char * range_max;
char ** possibilities;
} lscp_param_info_t;
typedef struct _lscp_driver_info_t
{
char * description;
char * version;
char ** parameters;
} lscp_driver_info_t;
typedef struct _lscp_device_info_t
{
char * driver;
lscp_param_t *params;
} lscp_device_info_t;
typedef struct _lscp_device_port_info_t
{
char * name;
lscp_param_t *params;
} lscp_device_port_info_t;
//-------------------------------------------------------------------------
// Audio driver control functions.
int lscp_get_available_audio_drivers (lscp_client_t *pClient);
const char ** lscp_list_available_audio_drivers (lscp_client_t *pClient);
lscp_driver_info_t * lscp_get_audio_driver_info (lscp_client_t *pClient, const char *pszAudioDriver);
lscp_param_info_t * lscp_get_audio_driver_param_info(lscp_client_t *pClient, const char *pszAudioDriver, const char *pszParam, lscp_param_t *pDepList);
//-------------------------------------------------------------------------
// Audio device control functions.
int lscp_create_audio_device (lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams);
lscp_status_t lscp_destroy_audio_device (lscp_client_t *pClient, int iAudioDevice);
int lscp_get_audio_devices (lscp_client_t *pClient);
int * lscp_list_audio_devices (lscp_client_t *pClient);
lscp_device_info_t * lscp_get_audio_device_info (lscp_client_t *pClient, int iAudioDevice);
lscp_status_t lscp_set_audio_device_param (lscp_client_t *pClient, int iAudioDevice, lscp_param_t *pParam);
lscp_device_port_info_t *lscp_get_audio_channel_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel);
lscp_param_info_t * lscp_get_audio_channel_param_info (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, const char *pszParam);
lscp_status_t lscp_set_audio_channel_param (lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, lscp_param_t *pParam);
//-------------------------------------------------------------------------
// MIDI driver control functions.
int lscp_get_available_midi_drivers (lscp_client_t *pClient);
const char ** lscp_list_available_midi_drivers(lscp_client_t *pClient);
lscp_driver_info_t * lscp_get_midi_driver_info (lscp_client_t *pClient, const char *pszMidiDriver);
lscp_param_info_t * lscp_get_midi_driver_param_info (lscp_client_t *pClient, const char *pszMidiDriver, const char *pszParam, lscp_param_t *pDepList);
//-------------------------------------------------------------------------
// MIDI device control functions.
int lscp_create_midi_device (lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams);
lscp_status_t lscp_destroy_midi_device (lscp_client_t *pClient, int iMidiDevice);
int lscp_get_midi_devices (lscp_client_t *pClient);
int * lscp_list_midi_devices (lscp_client_t *pClient);
lscp_device_info_t * lscp_get_midi_device_info (lscp_client_t *pClient, int iMidiDevice);
lscp_status_t lscp_set_midi_device_param (lscp_client_t *pClient, int iMidiDevice, lscp_param_t *pParam);
lscp_device_port_info_t *lscp_get_midi_port_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort);
lscp_param_info_t * lscp_get_midi_port_param_info (lscp_client_t *pClient, int iMidiDevice, int iMidiPort, const char *pszParam);
lscp_status_t lscp_set_midi_port_param (lscp_client_t *pClient, int iMidiDevice, int iMidiPort, lscp_param_t *pParam);
//-------------------------------------------------------------------------
// Generic parameter list functions.
const char * lscp_get_param_value (lscp_param_t *pParams, const char *pszParam);
#if defined(__cplusplus)
}
#endif
#endif // __LSCP_DEVICE_H
// end of device.h
client.h
lscp_client_t
struct _lscp_client_t lscp_client_t
Definition client.h:162
lscp_list_available_midi_drivers
const char ** lscp_list_available_midi_drivers(lscp_client_t *pClient)
Definition device.c:685
lscp_get_audio_channel_info
lscp_device_port_info_t * lscp_get_audio_channel_info(lscp_client_t *pClient, int iAudioDevice, int iAudioChannel)
Definition device.c:569
lscp_list_audio_devices
int * lscp_list_audio_devices(lscp_client_t *pClient)
Definition device.c:483
lscp_param_t
struct _lscp_param_t lscp_param_t
lscp_set_audio_channel_param
lscp_status_t lscp_set_audio_channel_param(lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, lscp_param_t *pParam)
Definition device.c:626
lscp_get_audio_channel_param_info
lscp_param_info_t * lscp_get_audio_channel_param_info(lscp_client_t *pClient, int iAudioDevice, int iAudioChannel, const char *pszParam)
Definition device.c:597
lscp_device_port_info_t
struct _lscp_device_port_info_t lscp_device_port_info_t
lscp_device_info_t
struct _lscp_device_info_t lscp_device_info_t
lscp_set_audio_device_param
lscp_status_t lscp_set_audio_device_param(lscp_client_t *pClient, int iAudioDevice, lscp_param_t *pParam)
Definition device.c:542
lscp_get_midi_device_info
lscp_device_info_t * lscp_get_midi_device_info(lscp_client_t *pClient, int iMidiDevice)
Definition device.c:898
lscp_type_t
enum _lscp_type_t lscp_type_t
lscp_get_available_audio_drivers
int lscp_get_available_audio_drivers(lscp_client_t *pClient)
Definition device.c:278
lscp_create_audio_device
int lscp_create_audio_device(lscp_client_t *pClient, const char *pszAudioDriver, lscp_param_t *pParams)
Definition device.c:396
lscp_set_midi_port_param
lscp_status_t lscp_set_midi_port_param(lscp_client_t *pClient, int iMidiDevice, int iMidiPort, lscp_param_t *pParam)
Definition device.c:1006
lscp_param_info_t
struct _lscp_param_info_t lscp_param_info_t
lscp_get_midi_port_info
lscp_device_port_info_t * lscp_get_midi_port_info(lscp_client_t *pClient, int iMidiDevice, int iMidiPort)
Definition device.c:949
lscp_get_midi_port_param_info
lscp_param_info_t * lscp_get_midi_port_param_info(lscp_client_t *pClient, int iMidiDevice, int iMidiPort, const char *pszParam)
Definition device.c:977
lscp_get_midi_devices
int lscp_get_midi_devices(lscp_client_t *pClient)
Definition device.c:834
lscp_driver_info_t
struct _lscp_driver_info_t lscp_driver_info_t
lscp_get_available_midi_drivers
int lscp_get_available_midi_drivers(lscp_client_t *pClient)
Definition device.c:656
lscp_get_param_value
const char * lscp_get_param_value(lscp_param_t *pParams, const char *pszParam)
Definition device.c:1027
lscp_list_available_audio_drivers
const char ** lscp_list_available_audio_drivers(lscp_client_t *pClient)
Definition device.c:307
lscp_create_midi_device
int lscp_create_midi_device(lscp_client_t *pClient, const char *pszMidiDriver, lscp_param_t *pParams)
Definition device.c:776
lscp_set_midi_device_param
lscp_status_t lscp_set_midi_device_param(lscp_client_t *pClient, int iMidiDevice, lscp_param_t *pParam)
Definition device.c:922
lscp_get_audio_devices
int lscp_get_audio_devices(lscp_client_t *pClient)
Definition device.c:454
lscp_get_midi_driver_info
lscp_driver_info_t * lscp_get_midi_driver_info(lscp_client_t *pClient, const char *pszMidiDriver)
Definition device.c:720
lscp_list_midi_devices
int * lscp_list_midi_devices(lscp_client_t *pClient)
Definition device.c:863
lscp_get_audio_driver_param_info
lscp_param_info_t * lscp_get_audio_driver_param_info(lscp_client_t *pClient, const char *pszAudioDriver, const char *pszParam, lscp_param_t *pDepList)
Definition device.c:366
_lscp_type_t
_lscp_type_t
Definition device.h:38
LSCP_TYPE_BOOL
@ LSCP_TYPE_BOOL
Definition device.h:40
LSCP_TYPE_FLOAT
@ LSCP_TYPE_FLOAT
Definition device.h:42
LSCP_TYPE_NONE
@ LSCP_TYPE_NONE
Definition device.h:39
LSCP_TYPE_INT
@ LSCP_TYPE_INT
Definition device.h:41
LSCP_TYPE_STRING
@ LSCP_TYPE_STRING
Definition device.h:43
lscp_destroy_audio_device
lscp_status_t lscp_destroy_audio_device(lscp_client_t *pClient, int iAudioDevice)
Definition device.c:430
lscp_get_midi_driver_param_info
lscp_param_info_t * lscp_get_midi_driver_param_info(lscp_client_t *pClient, const char *pszMidiDriver, const char *pszParam, lscp_param_t *pDepList)
Definition device.c:746
lscp_get_audio_driver_info
lscp_driver_info_t * lscp_get_audio_driver_info(lscp_client_t *pClient, const char *pszAudioDriver)
Definition device.c:342
lscp_get_audio_device_info
lscp_device_info_t * lscp_get_audio_device_info(lscp_client_t *pClient, int iAudioDevice)
Definition device.c:518
lscp_destroy_midi_device
lscp_status_t lscp_destroy_midi_device(lscp_client_t *pClient, int iMidiDevice)
Definition device.c:810
_lscp_device_info_t
Definition device.h:86
_lscp_device_info_t::driver
char * driver
Definition device.h:87
_lscp_device_info_t::params
lscp_param_t * params
Definition device.h:88
_lscp_device_port_info_t
Definition device.h:95
_lscp_device_port_info_t::params
lscp_param_t * params
Definition device.h:97
_lscp_device_port_info_t::name
char * name
Definition device.h:96
_lscp_driver_info_t
Definition device.h:76
_lscp_driver_info_t::version
char * version
Definition device.h:78
_lscp_driver_info_t::parameters
char ** parameters
Definition device.h:79
_lscp_driver_info_t::description
char * description
Definition device.h:77
_lscp_param_info_t
Definition device.h:59
_lscp_param_info_t::type
lscp_type_t type
Definition device.h:60
_lscp_param_info_t::description
char * description
Definition device.h:61
_lscp_param_info_t::mandatory
int mandatory
Definition device.h:62
_lscp_param_info_t::range_max
char * range_max
Definition device.h:68
_lscp_param_info_t::defaultv
char * defaultv
Definition device.h:66
_lscp_param_info_t::range_min
char * range_min
Definition device.h:67
_lscp_param_info_t::fix
int fix
Definition device.h:63
_lscp_param_info_t::possibilities
char ** possibilities
Definition device.h:69
_lscp_param_info_t::depends
char ** depends
Definition device.h:65
_lscp_param_info_t::multiplicity
int multiplicity
Definition device.h:64
_lscp_param_t
Definition device.h:50
_lscp_param_t::value
char * value
Definition device.h:52
_lscp_param_t::key
char * key
Definition device.h:51
lscp_status_t
enum _lscp_status_t lscp_status_t