00001 /* -*- mode: c; c-file-style: "bsd"; -*- */ 00002 /* 00003 JACK control API implementation 00004 00005 Copyright (C) 2008 Nedko Arnaudov 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 00020 */ 00021 00022 #include <stdbool.h> 00023 #include <stdint.h> 00024 #include <string.h> 00025 #include <errno.h> 00026 #include <dirent.h> 00027 #include <stdio.h> 00028 #include <assert.h> 00029 00030 //#include <config.h> 00031 //#include <jack/internal.h> 00032 //#include <jack/engine.h> 00033 //#include <jack/driver.h> 00034 00035 #include "jackctl.h" 00036 00037 struct jackctl_server 00038 { 00039 char * name; 00040 JSList * drivers; 00041 JSList * parameters; 00042 00043 jack_engine_t * engine; 00044 00045 unsigned int xruns; 00046 00047 /* bool, whether to be "realtime" */ 00048 union jackctl_parameter_value realtime; 00049 union jackctl_parameter_value default_realtime; 00050 00051 /* int32_t */ 00052 union jackctl_parameter_value realtime_priority; 00053 union jackctl_parameter_value default_realtime_priority; 00054 00055 /* bool, if true - do not attempt to lock memory, even in realtime mode. */ 00056 union jackctl_parameter_value no_mem_lock; 00057 union jackctl_parameter_value default_no_mem_lock; 00058 00059 /* bool, whether to exit once all clients have closed their connections */ 00060 union jackctl_parameter_value temporary; 00061 union jackctl_parameter_value default_temporary; 00062 00063 /* bool, whether to be verbose */ 00064 union jackctl_parameter_value verbose; 00065 union jackctl_parameter_value default_verbose; 00066 00067 /* int32_t, msecs; if zero, use period size. */ 00068 union jackctl_parameter_value client_timeout; 00069 union jackctl_parameter_value default_client_timeout; 00070 00071 /* uint32_t, maximum number of ports the JACK server can manage */ 00072 union jackctl_parameter_value port_max; 00073 union jackctl_parameter_value default_port_max; 00074 00075 /* bool, whether to unlock libraries GTK+, QT, FLTK, Wine */ 00076 union jackctl_parameter_value do_unlock; 00077 union jackctl_parameter_value default_do_unlock; 00078 00079 /* int32_t */ 00080 union jackctl_parameter_value frame_time_offset; 00081 union jackctl_parameter_value default_frame_time_offset; 00082 00083 /* bool, whether to prevent from ever kicking out clients because they were too slow */ 00084 union jackctl_parameter_value nozombies; 00085 union jackctl_parameter_value default_nozombies; 00086 }; 00087 00088 struct jackctl_driver 00089 { 00090 char * filename; 00091 jack_driver_desc_t * desc_ptr; 00092 JSList * parameters; 00093 JSList * set_parameters; 00094 }; 00095 00096 struct jackctl_parameter 00097 { 00098 const char * name; 00099 const char * short_description; 00100 const char * long_description; 00101 jackctl_param_type_t type; 00102 bool is_set; 00103 union jackctl_parameter_value * value_ptr; 00104 union jackctl_parameter_value * default_value_ptr; 00105 00106 union jackctl_parameter_value value; 00107 union jackctl_parameter_value default_value; 00108 struct jackctl_driver * driver_ptr; 00109 char id; 00110 jack_driver_param_t * driver_parameter_ptr; 00111 }; 00112 00113 00114 00115 #undef parameter_ptr