JACK-AUDIO-CONNECTION-KIT  0.124.1
control.h
Go to the documentation of this file.
00001 /* -*- Mode: C ; c-basic-offset: 4 -*- */
00002 /*
00003   JACK control API
00004 
00005   Copyright (C) 2008 Nedko Arnaudov
00006   Copyright (C) 2008 GRAME
00007     
00008   This program is free software; you can redistribute it and/or modify
00009   it under the terms of the GNU General Public License as published by
00010   the Free Software Foundation; version 2 of the License.
00011 
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015   GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018   along with this program; if not, write to the Free Software
00019   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 
00021 */
00029 #ifndef __jack_control_h__
00030 #define __jack_control_h__
00031 
00032 #include <jack/jslist.h>
00033 
00034 #if !defined (__sun__)
00035 #include <stdbool.h>
00036 #endif
00037 
00039 typedef enum
00040 {
00041     JackParamInt = 1,                   
00042     JackParamUInt,                              
00043     JackParamChar,                              
00044     JackParamString,                    
00045     JackParamBool,                              
00046 } jackctl_param_type_t;
00047 
00049 #define JACK_PARAM_MAX (JackParamBool + 1)
00050 
00052 #define JACK_PARAM_STRING_MAX  127
00053 
00055 /* intentionally similar to jack_driver_param_value_t */
00056 union jackctl_parameter_value
00057 {
00058     uint32_t ui;                                
00059     int32_t i;                                  
00060     char c;                                             
00061     char str[JACK_PARAM_STRING_MAX + 1]; 
00062     bool b;                             
00063 };
00064 
00066 typedef struct jackctl_server jackctl_server_t;
00067 
00069 typedef struct jackctl_driver jackctl_driver_t;
00070 
00072 typedef struct jackctl_internal jackctl_internal_t;
00073 
00075 typedef struct jackctl_parameter jackctl_parameter_t;
00076 
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080 #if 0
00081 } /* Adjust editor indent */
00082 #endif
00083 
00098 sigset_t
00099 jackctl_setup_signals(
00100     unsigned int flags);
00101 
00107 void
00108 jackctl_wait_signals(
00109     sigset_t signals);
00110 
00121 jackctl_server_t *
00122 jackctl_server_create(
00123     bool (* on_device_acquire)(const char * device_name),
00124     void (* on_device_release)(const char * device_name));
00125 
00131 void
00132 jackctl_server_destroy(
00133         jackctl_server_t * server);
00134 
00143 bool
00144 jackctl_server_start(
00145     jackctl_server_t * server,
00146     jackctl_driver_t * driver);
00147 
00155 bool
00156 jackctl_server_stop(
00157         jackctl_server_t * server);
00158 
00168 const JSList *
00169 jackctl_server_get_drivers_list(
00170         jackctl_server_t * server);
00171 
00181 const JSList *
00182 jackctl_server_get_parameters(
00183         jackctl_server_t * server);
00184 
00194 const JSList *
00195 jackctl_server_get_internals_list(
00196         jackctl_server_t * server);
00197 
00206 bool
00207 jackctl_server_load_internal(
00208     jackctl_server_t * server,
00209     jackctl_internal_t * internal);
00210 
00219 bool
00220 jackctl_server_unload_internal(
00221     jackctl_server_t * server,
00222     jackctl_internal_t * internal);
00223 
00232 bool 
00233 jackctl_server_add_slave(jackctl_server_t * server,
00234                             jackctl_driver_t * driver);
00235 
00244 bool 
00245 jackctl_server_remove_slave(jackctl_server_t * server,
00246                             jackctl_driver_t * driver);
00247 
00256 bool 
00257 jackctl_server_switch_master(jackctl_server_t * server,
00258                             jackctl_driver_t * driver);
00259                             
00260 
00269 const char *
00270 jackctl_driver_get_name(
00271         jackctl_driver_t * driver);
00272 
00282 const JSList *
00283 jackctl_driver_get_parameters(
00284         jackctl_driver_t * driver);
00285 
00294 const char *
00295 jackctl_internal_get_name(
00296         jackctl_internal_t * internal);
00297 
00307 const JSList *
00308 jackctl_internal_get_parameters(
00309         jackctl_internal_t * internal);
00310 
00319 const char *
00320 jackctl_parameter_get_name(
00321         jackctl_parameter_t * parameter);
00322 
00331 const char *
00332 jackctl_parameter_get_short_description(
00333         jackctl_parameter_t * parameter);
00334 
00343 const char *
00344 jackctl_parameter_get_long_description(
00345         jackctl_parameter_t * parameter);
00346 
00354 jackctl_param_type_t
00355 jackctl_parameter_get_type(
00356         jackctl_parameter_t * parameter);
00357 
00365 char
00366 jackctl_parameter_get_id(
00367         jackctl_parameter_t * parameter);
00368 
00378 bool
00379 jackctl_parameter_is_set(
00380         jackctl_parameter_t * parameter);
00381 
00389 bool
00390 jackctl_parameter_reset(
00391         jackctl_parameter_t * parameter);
00392 
00400 union jackctl_parameter_value
00401 jackctl_parameter_get_value(
00402         jackctl_parameter_t * parameter);
00403 
00412 bool
00413 jackctl_parameter_set_value(
00414         jackctl_parameter_t * parameter,
00415         const union jackctl_parameter_value * value_ptr);
00416 
00424 union jackctl_parameter_value
00425 jackctl_parameter_get_default_value(
00426         jackctl_parameter_t * parameter);
00427     
00435 bool
00436 jackctl_parameter_has_range_constraint(
00437         jackctl_parameter_t * parameter);
00438 
00446 bool
00447 jackctl_parameter_has_enum_constraint(
00448         jackctl_parameter_t * parameter);
00449 
00457 uint32_t
00458 jackctl_parameter_get_enum_constraints_count(
00459         jackctl_parameter_t * parameter);
00460 
00469 union jackctl_parameter_value
00470 jackctl_parameter_get_enum_constraint_value(
00471         jackctl_parameter_t * parameter,
00472         uint32_t index);
00473 
00482 const char *
00483 jackctl_parameter_get_enum_constraint_description(
00484         jackctl_parameter_t * parameter,
00485         uint32_t index);
00486 
00494 void
00495 jackctl_parameter_get_range_constraint(
00496         jackctl_parameter_t * parameter,
00497         union jackctl_parameter_value * min_ptr,
00498         union jackctl_parameter_value * max_ptr);
00499 
00508 bool
00509 jackctl_parameter_constraint_is_strict(
00510         jackctl_parameter_t * parameter);
00511 
00521 bool
00522 jackctl_parameter_constraint_is_fake_value(
00523         jackctl_parameter_t * parameter);
00524 
00530 void
00531 jack_error(
00532         const char *format,
00533         ...);
00534 
00540 void
00541 jack_info(
00542         const char *format,
00543         ...);
00544 
00551 void
00552 jack_log(
00553         const char *format,
00554         ...);
00555 
00556 /* @} */
00557 
00558 #if 0
00559 { /* Adjust editor indent */
00560 #endif
00561 #ifdef __cplusplus
00562 } /* extern "C" */
00563 #endif
00564 
00565 #endif /* __jack_control_h__ */
00566