Jack2 1.9.6
|
00001 /* 00002 Copyright (C) 2003 Bob Ham <rah@bash.sh> 00003 Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU Lesser General Public License as published by 00007 the Free Software Foundation; either version 2.1 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 00019 */ 00020 00021 #ifndef __jack_driver_interface_h__ 00022 #define __jack_driver_interface_h__ 00023 00024 #ifdef __cplusplus 00025 extern "C" 00026 { 00027 #endif 00028 00029 #include <limits.h> 00030 #include "jslist.h" 00031 #include "JackCompilerDeps.h" 00032 #include "JackSystemDeps.h" 00033 00034 #define JACK_DRIVER_NAME_MAX 15 00035 #define JACK_DRIVER_PARAM_NAME_MAX 15 00036 #define JACK_DRIVER_PARAM_STRING_MAX 127 00037 #define JACK_DRIVER_PARAM_DESC 255 00038 #define JACK_PATH_MAX 511 00039 00040 #define JACK_CONSTRAINT_FLAG_RANGE ((uint32_t)1) 00041 #define JACK_CONSTRAINT_FLAG_STRICT ((uint32_t)2) 00042 #define JACK_CONSTRAINT_FLAG_FAKE_VALUE ((uint32_t)4) 00045 typedef enum 00046 { 00047 JackDriverParamInt = 1, 00048 JackDriverParamUInt, 00049 JackDriverParamChar, 00050 JackDriverParamString, 00051 JackDriverParamBool 00052 } jack_driver_param_type_t; 00053 00055 typedef union 00056 { 00057 uint32_t ui; 00058 int32_t i; 00059 char c; 00060 char str[JACK_DRIVER_PARAM_STRING_MAX + 1]; 00061 } jack_driver_param_value_t; 00062 00063 typedef struct { 00064 jack_driver_param_value_t value; 00065 char short_desc[64]; 00066 } jack_driver_param_value_enum_t; 00067 00068 typedef struct { 00069 uint32_t flags; 00071 union { 00072 struct { 00073 jack_driver_param_value_t min; 00074 jack_driver_param_value_t max; 00075 } range; 00077 struct { 00078 uint32_t count; 00079 jack_driver_param_value_enum_t * possible_values_array; 00080 } enumeration; 00081 } constraint; 00082 } jack_driver_param_constraint_desc_t; 00083 00085 typedef struct { 00086 char name[JACK_DRIVER_NAME_MAX + 1]; 00087 char character; 00088 jack_driver_param_type_t type; 00089 jack_driver_param_value_t value; 00090 jack_driver_param_constraint_desc_t * constraint; 00091 char short_desc[64]; 00092 char long_desc[1024]; 00093 } 00094 jack_driver_param_desc_t; 00095 00097 typedef struct { 00098 char character; 00099 jack_driver_param_value_t value; 00100 } 00101 jack_driver_param_t; 00102 00103 00105 typedef struct { 00106 char name[JACK_DRIVER_NAME_MAX + 1]; 00107 char desc[JACK_DRIVER_PARAM_DESC + 1]; 00108 char file[JACK_PATH_MAX + 1]; 00109 uint32_t nparams; 00110 jack_driver_param_desc_t * params; 00111 } 00112 jack_driver_desc_t; 00113 00114 00115 SERVER_EXPORT int jack_parse_driver_params (jack_driver_desc_t * desc, int argc, char* argv[], JSList ** param_ptr); 00116 00117 #ifdef __cplusplus 00118 } 00119 #endif 00120 00121 #endif /* __jack_driver_interface_h__ */ 00122 00123