JackControlAPI.h
/*
JACK control API
Copyright (C) 2008 Nedko Arnaudov
Copyright (C) 2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program 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 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __JackControlAPI__
#define __JackControlAPI__
#include "jslist.h"
#include "JackCompilerDeps.h"
typedef enum
{
JackParamInt = 1,
JackParamUInt,
JackParamChar,
JackParamString,
JackParamBool,
} jackctl_param_type_t;
typedef enum
{
JackMaster = 1,
JackSlave,
} jackctl_driver_type_t;
#define JACK_PARAM_MAX (JackParamBool + 1)
#define JACK_PARAM_STRING_MAX 127
/* intentionally similar to jack_driver_param_value_t */
union jackctl_parameter_value
{
uint32_t ui;
int32_t i;
char c;
char str[JACK_PARAM_STRING_MAX + 1];
bool b;
};
typedef struct jackctl_server jackctl_server_t;
typedef struct jackctl_driver jackctl_driver_t;
typedef struct jackctl_internal jackctl_internal_t;
typedef struct jackctl_parameter jackctl_parameter_t;
typedef struct jackctl_sigmask jackctl_sigmask_t;
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* Adjust editor indent */
#endif
SERVER_EXPORT jackctl_sigmask_t *
jackctl_setup_signals(
unsigned int flags);
SERVER_EXPORT void
jackctl_wait_signals(
jackctl_sigmask_t * signals);
SERVER_EXPORT jackctl_server_t *
jackctl_server_create(
bool (* on_device_acquire)(const char * device_name),
void (* on_device_release)(const char * device_name));
SERVER_EXPORT void
jackctl_server_destroy(
jackctl_server_t * server);
SERVER_EXPORT const JSList *
jackctl_server_get_drivers_list(
jackctl_server_t * server);
SERVER_EXPORT bool
jackctl_server_open(
jackctl_server_t * server,
jackctl_driver_t * driver);
SERVER_EXPORT bool
jackctl_server_start(
jackctl_server_t * server);
SERVER_EXPORT bool
jackctl_server_stop(
jackctl_server_t * server);
SERVER_EXPORT bool
jackctl_server_close(
jackctl_server_t * server);
SERVER_EXPORT const JSList *
jackctl_server_get_parameters(
jackctl_server_t * server);
SERVER_EXPORT const char *
jackctl_driver_get_name(
jackctl_driver_t * driver);
SERVER_EXPORT jackctl_driver_type_t
jackctl_driver_get_type(
jackctl_driver_t * driver);
SERVER_EXPORT const JSList *
jackctl_driver_get_parameters(
jackctl_driver_t * driver);
SERVER_EXPORT const char *
jackctl_parameter_get_name(
jackctl_parameter_t * parameter);
SERVER_EXPORT const char *
jackctl_parameter_get_short_description(
jackctl_parameter_t * parameter);
SERVER_EXPORT const char *
jackctl_parameter_get_long_description(
jackctl_parameter_t * parameter);
SERVER_EXPORT jackctl_param_type_t
jackctl_parameter_get_type(
jackctl_parameter_t * parameter);
SERVER_EXPORT char
jackctl_parameter_get_id(
jackctl_parameter_t * parameter);
SERVER_EXPORT bool
jackctl_parameter_is_set(
jackctl_parameter_t * parameter);
SERVER_EXPORT bool
jackctl_parameter_reset(
jackctl_parameter_t * parameter);
SERVER_EXPORT union jackctl_parameter_value
jackctl_parameter_get_value(
jackctl_parameter_t * parameter);
SERVER_EXPORT bool
jackctl_parameter_set_value(
jackctl_parameter_t * parameter,
const union jackctl_parameter_value * value_ptr);
SERVER_EXPORT union jackctl_parameter_value
jackctl_parameter_get_default_value(
jackctl_parameter_t * parameter);
SERVER_EXPORT union jackctl_parameter_value
jackctl_parameter_get_default_value(
jackctl_parameter *parameter_ptr);
SERVER_EXPORT bool
jackctl_parameter_has_range_constraint(
jackctl_parameter_t * parameter_ptr);
SERVER_EXPORT bool
jackctl_parameter_has_enum_constraint(
jackctl_parameter_t * parameter_ptr);
SERVER_EXPORT uint32_t
jackctl_parameter_get_enum_constraints_count(
jackctl_parameter_t * parameter_ptr);
SERVER_EXPORT union jackctl_parameter_value
jackctl_parameter_get_enum_constraint_value(
jackctl_parameter_t * parameter_ptr,
uint32_t index);
SERVER_EXPORT const char *
jackctl_parameter_get_enum_constraint_description(
jackctl_parameter_t * parameter_ptr,
uint32_t index);
SERVER_EXPORT void
jackctl_parameter_get_range_constraint(
jackctl_parameter_t * parameter_ptr,
union jackctl_parameter_value * min_ptr,
union jackctl_parameter_value * max_ptr);
SERVER_EXPORT bool
jackctl_parameter_constraint_is_strict(
jackctl_parameter_t * parameter_ptr);
SERVER_EXPORT bool
jackctl_parameter_constraint_is_fake_value(
jackctl_parameter_t * parameter_ptr);
SERVER_EXPORT const JSList *
jackctl_server_get_internals_list(
jackctl_server *server_ptr);
SERVER_EXPORT const char *
jackctl_internal_get_name(
jackctl_internal *internal_ptr);
SERVER_EXPORT const JSList *
jackctl_internal_get_parameters(
jackctl_internal *internal_ptr);
SERVER_EXPORT bool jackctl_server_load_internal(
jackctl_server * server,
jackctl_internal * internal);
SERVER_EXPORT bool jackctl_server_unload_internal(
jackctl_server * server,
jackctl_internal * internal);
SERVER_EXPORT bool jackctl_server_add_slave(jackctl_server_t * server,
jackctl_driver_t * driver);
SERVER_EXPORT bool jackctl_server_remove_slave(jackctl_server_t * server,
jackctl_driver_t * driver);
SERVER_EXPORT bool
jackctl_server_switch_master(jackctl_server_t * server,
jackctl_driver_t * driver);
SERVER_EXPORT int
jackctl_parse_driver_params(jackctl_driver * driver_ptr, int argc, char* argv[]);
#if 0
{ /* Adjust editor indent */
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
jackctl_parameter_get_long_description
SERVER_EXPORT const char * jackctl_parameter_get_long_description(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1146
jackctl_driver_type_t
jackctl_driver_type_t
Definition: control.h:50
JackParamInt
value type is a signed integer
Definition: control.h:42
jackctl_parameter_is_set
SERVER_EXPORT bool jackctl_parameter_is_set(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1256
jackctl_parameter_get_value
SERVER_EXPORT union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1261
jackctl_setup_signals
SERVER_EXPORT jackctl_sigmask_t * jackctl_setup_signals(unsigned int flags)
Definition: JackControlAPI.cpp:596
jackctl_parameter_value::str
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition: JackControlAPI.h:58
jackctl_parameter_get_default_value
SERVER_EXPORT union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1302
JackParamUInt
value type is an unsigned integer
Definition: control.h:43
jackctl_server_open
SERVER_EXPORT bool jackctl_server_open(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1001
jackctl_server
Definition: JackControlAPI.cpp:61
jackctl_parameter_get_range_constraint
SERVER_EXPORT void jackctl_parameter_get_range_constraint(jackctl_parameter *parameter_ptr, union jackctl_parameter_value *min_ptr, union jackctl_parameter_value *max_ptr)
Definition: JackControlAPI.cpp:1214
JackParamChar
value type is a char
Definition: control.h:44
jackctl_server_create
SERVER_EXPORT jackctl_server_t * jackctl_server_create(bool(*on_device_acquire)(const char *device_name), void(*on_device_release)(const char *device_name))
Definition: JackControlAPI.cpp:744
jackctl_parameter_reset
SERVER_EXPORT bool jackctl_parameter_reset(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1272
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition: JackControlAPI.h:55
jackctl_server_switch_master
SERVER_EXPORT bool jackctl_server_switch_master(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1413
JackParamBool
value type is a boolean
Definition: control.h:46
jackctl_internal_get_name
SERVER_EXPORT const char * jackctl_internal_get_name(jackctl_internal *internal_ptr)
Definition: JackControlAPI.cpp:1320
JackMaster
master driver
Definition: control.h:52
jackctl_parameter_value::i
int32_t i
member used for JackParamInt
Definition: JackControlAPI.h:56
jackctl_parameter_get_name
SERVER_EXPORT const char * jackctl_parameter_get_name(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1136
jackctl_server_stop
SERVER_EXPORT bool jackctl_server_stop(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:958
jackctl_parameter_value::b
bool b
member used for JackParamBool
Definition: JackControlAPI.h:59
jackctl_parameter_value
Type for parameter value.
Definition: JackControlAPI.h:53
jackctl_driver_get_parameters
SERVER_EXPORT const JSList * jackctl_driver_get_parameters(jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1126
JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition: control.h:45
jackctl_sigmask
Definition: JackControlAPI.cpp:576
jackctl_parameter_has_range_constraint
SERVER_EXPORT bool jackctl_parameter_has_range_constraint(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1151
jackctl_server_close
SERVER_EXPORT bool jackctl_server_close(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:968
jackctl_server_remove_slave
SERVER_EXPORT bool jackctl_server_remove_slave(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1390
jackctl_parameter_get_enum_constraint_description
SERVER_EXPORT const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter *parameter_ptr, uint32_t index)
Definition: JackControlAPI.cpp:1209
jackctl_server_get_internals_list
SERVER_EXPORT const JSList * jackctl_server_get_internals_list(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:1315
jackctl_parameter_get_short_description
SERVER_EXPORT const char * jackctl_parameter_get_short_description(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1141
jackctl_parameter_constraint_is_fake_value
SERVER_EXPORT bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter_ptr)
Definition: JackControlAPI.cpp:1241
jackctl_parameter_get_type
SERVER_EXPORT jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1246
JackSlave
slave driver
Definition: control.h:53
jackctl_server_get_drivers_list
SERVER_EXPORT const JSList * jackctl_server_get_drivers_list(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:953
jackctl_server_start
SERVER_EXPORT bool jackctl_server_start(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:1100
jackctl_parameter_constraint_is_strict
SERVER_EXPORT bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter_ptr)
Definition: JackControlAPI.cpp:1236
jackctl_parameter_get_enum_constraints_count
SERVER_EXPORT uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1161
jackctl_parameter_set_value
SERVER_EXPORT bool jackctl_parameter_set_value(jackctl_parameter *parameter_ptr, const union jackctl_parameter_value *value_ptr)
Definition: JackControlAPI.cpp:1290
jackctl_server_add_slave
SERVER_EXPORT bool jackctl_server_add_slave(jackctl_server *server_ptr, jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1367
JACK_PARAM_STRING_MAX
#define JACK_PARAM_STRING_MAX
Max length of string parameter value, excluding terminating null char.
Definition: control.h:60
jackctl_param_type_t
jackctl_param_type_t
Definition: control.h:40
jackctl_driver_get_name
SERVER_EXPORT const char * jackctl_driver_get_name(jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1116
jackctl_parameter_get_enum_constraint_value
SERVER_EXPORT union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter *parameter_ptr, uint32_t index)
Definition: JackControlAPI.cpp:1175
jackctl_server_unload_internal
SERVER_EXPORT bool jackctl_server_unload_internal(jackctl_server *server_ptr, jackctl_internal *internal)
Definition: JackControlAPI.cpp:1350
jackctl_parameter_get_id
SERVER_EXPORT char jackctl_parameter_get_id(jackctl_parameter_t *parameter_ptr)
Definition: JackControlAPI.cpp:1251
jackctl_internal_get_parameters
SERVER_EXPORT const JSList * jackctl_internal_get_parameters(jackctl_internal *internal_ptr)
Definition: JackControlAPI.cpp:1325
jackctl_server_destroy
SERVER_EXPORT void jackctl_server_destroy(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:943
jackctl_driver_get_type
SERVER_EXPORT jackctl_driver_type_t jackctl_driver_get_type(jackctl_driver *driver_ptr)
Definition: JackControlAPI.cpp:1121
jackctl_parameter
Definition: JackControlAPI.cpp:128
jackctl_parameter_value::c
char c
member used for JackParamChar
Definition: JackControlAPI.h:57
jackctl_server_get_parameters
SERVER_EXPORT const JSList * jackctl_server_get_parameters(jackctl_server *server_ptr)
Definition: JackControlAPI.cpp:995
jackctl_internal
Definition: JackControlAPI.cpp:121
jackctl_parameter_has_enum_constraint
SERVER_EXPORT bool jackctl_parameter_has_enum_constraint(jackctl_parameter *parameter_ptr)
Definition: JackControlAPI.cpp:1156
_JSList
Definition: linux/alsa/jslist.h:35
jackctl_wait_signals
SERVER_EXPORT void jackctl_wait_signals(jackctl_sigmask_t *sigmask)
Definition: JackControlAPI.cpp:678
jackctl_driver
Definition: JackControlAPI.cpp:114
jackctl_server_load_internal
SERVER_EXPORT bool jackctl_server_load_internal(jackctl_server *server_ptr, jackctl_internal *internal)
Definition: JackControlAPI.cpp:1330