Loading...
Searching...
No Matches
control.h
Go to the documentation of this file.
/* -*- Mode: C ; c-basic-offset: 4 -*- */
/*
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 __jack_control_h__
#define __jack_control_h__
#include <jack/jslist.h>
#if !defined (__sun__)
#include <stdbool.h>
#endif
typedef enum
{
JackParamInt = 1,
JackParamUInt,
JackParamChar,
JackParamString,
JackParamBool,
} jackctl_param_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;
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* Adjust editor indent */
#endif
sigset_t
jackctl_setup_signals(
unsigned int flags);
void
jackctl_wait_signals(
sigset_t signals);
jackctl_server_t *
jackctl_server_create(
bool (* on_device_acquire)(const char * device_name),
void (* on_device_release)(const char * device_name));
void
jackctl_server_destroy(
jackctl_server_t * server);
bool
jackctl_server_start(
jackctl_server_t * server,
jackctl_driver_t * driver);
bool
jackctl_server_stop(
jackctl_server_t * server);
const JSList *
jackctl_server_get_drivers_list(
jackctl_server_t * server);
const JSList *
jackctl_server_get_parameters(
jackctl_server_t * server);
const JSList *
jackctl_server_get_internals_list(
jackctl_server_t * server);
bool
jackctl_server_load_internal(
jackctl_server_t * server,
jackctl_internal_t * internal);
bool
jackctl_server_unload_internal(
jackctl_server_t * server,
jackctl_internal_t * internal);
bool
jackctl_server_add_slave(jackctl_server_t * server,
jackctl_driver_t * driver);
bool
jackctl_server_remove_slave(jackctl_server_t * server,
jackctl_driver_t * driver);
bool
jackctl_server_switch_master(jackctl_server_t * server,
jackctl_driver_t * driver);
const char *
jackctl_driver_get_name(
jackctl_driver_t * driver);
const JSList *
jackctl_driver_get_parameters(
jackctl_driver_t * driver);
const char *
jackctl_internal_get_name(
jackctl_internal_t * internal);
const JSList *
jackctl_internal_get_parameters(
jackctl_internal_t * internal);
const char *
jackctl_parameter_get_name(
jackctl_parameter_t * parameter);
const char *
jackctl_parameter_get_short_description(
jackctl_parameter_t * parameter);
const char *
jackctl_parameter_get_long_description(
jackctl_parameter_t * parameter);
jackctl_param_type_t
jackctl_parameter_get_type(
jackctl_parameter_t * parameter);
char
jackctl_parameter_get_id(
jackctl_parameter_t * parameter);
bool
jackctl_parameter_is_set(
jackctl_parameter_t * parameter);
bool
jackctl_parameter_reset(
jackctl_parameter_t * parameter);
union jackctl_parameter_value
jackctl_parameter_get_value(
jackctl_parameter_t * parameter);
bool
jackctl_parameter_set_value(
jackctl_parameter_t * parameter,
const union jackctl_parameter_value * value_ptr);
union jackctl_parameter_value
jackctl_parameter_get_default_value(
jackctl_parameter_t * parameter);
bool
jackctl_parameter_has_range_constraint(
jackctl_parameter_t * parameter);
bool
jackctl_parameter_has_enum_constraint(
jackctl_parameter_t * parameter);
uint32_t
jackctl_parameter_get_enum_constraints_count(
jackctl_parameter_t * parameter);
union jackctl_parameter_value
jackctl_parameter_get_enum_constraint_value(
jackctl_parameter_t * parameter,
uint32_t index);
const char *
jackctl_parameter_get_enum_constraint_description(
jackctl_parameter_t * parameter,
uint32_t index);
void
jackctl_parameter_get_range_constraint(
jackctl_parameter_t * parameter,
union jackctl_parameter_value * min_ptr,
union jackctl_parameter_value * max_ptr);
bool
jackctl_parameter_constraint_is_strict(
jackctl_parameter_t * parameter);
bool
jackctl_parameter_constraint_is_fake_value(
jackctl_parameter_t * parameter);
void
jack_error(
const char *format,
...);
void
jack_info(
const char *format,
...);
void
jack_log(
const char *format,
...);
/* @} */
#if 0
{ /* Adjust editor indent */
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __jack_control_h__ */
jackctl_server_t
struct jackctl_server jackctl_server_t
Definition control.h:66
JACK_PARAM_STRING_MAX
#define JACK_PARAM_STRING_MAX
Max length of string parameter value, excluding terminating null char.
Definition control.h:52
jackctl_parameter_t
struct jackctl_parameter jackctl_parameter_t
Definition control.h:75
jackctl_internal_t
struct jackctl_internal jackctl_internal_t
Definition control.h:72
jackctl_param_type_t
jackctl_param_type_t
Definition control.h:40
jackctl_driver_t
struct jackctl_driver jackctl_driver_t
Definition control.h:69
jackctl_server_get_internals_list
const JSList * jackctl_server_get_internals_list(jackctl_server_t *server)
jackctl_parameter_get_name
const char * jackctl_parameter_get_name(jackctl_parameter_t *parameter)
jackctl_server_start
bool jackctl_server_start(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_get_long_description
const char * jackctl_parameter_get_long_description(jackctl_parameter_t *parameter)
jackctl_parameter_get_enum_constraint_value
union jackctl_parameter_value jackctl_parameter_get_enum_constraint_value(jackctl_parameter_t *parameter, uint32_t index)
jackctl_parameter_get_range_constraint
void jackctl_parameter_get_range_constraint(jackctl_parameter_t *parameter, union jackctl_parameter_value *min_ptr, union jackctl_parameter_value *max_ptr)
jackctl_parameter_get_enum_constraints_count
uint32_t jackctl_parameter_get_enum_constraints_count(jackctl_parameter_t *parameter)
jack_info
void jack_info(const char *format,...)
jackctl_server_create
jackctl_server_t * jackctl_server_create(bool(*on_device_acquire)(const char *device_name), void(*on_device_release)(const char *device_name))
jackctl_driver_get_parameters
const JSList * jackctl_driver_get_parameters(jackctl_driver_t *driver)
jackctl_server_load_internal
bool jackctl_server_load_internal(jackctl_server_t *server, jackctl_internal_t *internal)
jackctl_parameter_value::i
int32_t i
member used for JackParamInt
Definition control.h:59
jack_log
void jack_log(const char *format,...)
jackctl_parameter_get_type
jackctl_param_type_t jackctl_parameter_get_type(jackctl_parameter_t *parameter)
jackctl_parameter_get_enum_constraint_description
const char * jackctl_parameter_get_enum_constraint_description(jackctl_parameter_t *parameter, uint32_t index)
jackctl_server_switch_master
bool jackctl_server_switch_master(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_value::str
char str[JACK_PARAM_STRING_MAX+1]
member used for JackParamString
Definition control.h:61
jackctl_parameter_get_short_description
const char * jackctl_parameter_get_short_description(jackctl_parameter_t *parameter)
jackctl_parameter_is_set
bool jackctl_parameter_is_set(jackctl_parameter_t *parameter)
jackctl_server_get_parameters
const JSList * jackctl_server_get_parameters(jackctl_server_t *server)
jackctl_parameter_value::c
char c
member used for JackParamChar
Definition control.h:60
jackctl_parameter_has_enum_constraint
bool jackctl_parameter_has_enum_constraint(jackctl_parameter_t *parameter)
jackctl_internal_get_name
const char * jackctl_internal_get_name(jackctl_internal_t *internal)
jackctl_internal_get_parameters
const JSList * jackctl_internal_get_parameters(jackctl_internal_t *internal)
jackctl_parameter_get_id
char jackctl_parameter_get_id(jackctl_parameter_t *parameter)
jackctl_wait_signals
void jackctl_wait_signals(sigset_t signals)
jackctl_parameter_value::b
bool b
member used for JackParamBool
Definition control.h:62
jackctl_parameter_get_value
union jackctl_parameter_value jackctl_parameter_get_value(jackctl_parameter_t *parameter)
jackctl_parameter_get_default_value
union jackctl_parameter_value jackctl_parameter_get_default_value(jackctl_parameter_t *parameter)
jackctl_driver_get_name
const char * jackctl_driver_get_name(jackctl_driver_t *driver)
jackctl_setup_signals
sigset_t jackctl_setup_signals(unsigned int flags)
jackctl_server_destroy
void jackctl_server_destroy(jackctl_server_t *server)
jackctl_parameter_set_value
bool jackctl_parameter_set_value(jackctl_parameter_t *parameter, const union jackctl_parameter_value *value_ptr)
jackctl_server_unload_internal
bool jackctl_server_unload_internal(jackctl_server_t *server, jackctl_internal_t *internal)
jackctl_parameter_constraint_is_strict
bool jackctl_parameter_constraint_is_strict(jackctl_parameter_t *parameter)
jack_error
void jack_error(const char *format,...)
JackParamInt
@ JackParamInt
value type is a signed integer
Definition control.h:41
JackParamUInt
@ JackParamUInt
value type is an unsigned integer
Definition control.h:42
JackParamBool
@ JackParamBool
value type is a boolean
Definition control.h:45
JackParamChar
@ JackParamChar
value type is a char
Definition control.h:43
JackParamString
@ JackParamString
value type is a string with max size of JACK_PARAM_STRING_MAX+1 chars
Definition control.h:44
jackctl_server_remove_slave
bool jackctl_server_remove_slave(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_reset
bool jackctl_parameter_reset(jackctl_parameter_t *parameter)
jackctl_server_get_drivers_list
const JSList * jackctl_server_get_drivers_list(jackctl_server_t *server)
jackctl_server_add_slave
bool jackctl_server_add_slave(jackctl_server_t *server, jackctl_driver_t *driver)
jackctl_parameter_has_range_constraint
bool jackctl_parameter_has_range_constraint(jackctl_parameter_t *parameter)
jackctl_server_stop
bool jackctl_server_stop(jackctl_server_t *server)
jackctl_parameter_constraint_is_fake_value
bool jackctl_parameter_constraint_is_fake_value(jackctl_parameter_t *parameter)
jackctl_parameter_value::ui
uint32_t ui
member used for JackParamUInt
Definition control.h:58
jslist.h
JSList
struct _JSList JSList
Definition jslist.h:30
jackctl_parameter_value
Type for parameter value.
Definition control.h:57