2 terminatorX - realtime audio scratching software
3 Copyright (C) 1999-2003 Alexander König
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 Description: Header to tX_global.c / defines the heavily used
26 21 Jul 1999: Introduced the lowpass globals.
34 #endif /* __cplusplus */
44 #define BUTTON_TYPE_ICON 1
45 #define BUTTON_TYPE_TEXT 2
46 #define BUTTON_TYPE_BOTH 3
54 #ifdef ENABLE_DEBUG_OUTPUT
55 #define tX_debug(fmt, args...); { fprintf(stderr, "- tX_debug: "); fprintf(stderr, fmt , ## args); fprintf(stderr, "\n"); }
57 #define tX_debug(fmt, args...);
60 #define tX_error(fmt, args...); { fprintf(stderr, "* tX_error: "); fprintf(stderr, fmt , ## args); fprintf(stderr, "\n"); }
61 #define tX_warning(fmt, args...); { fprintf(stderr, "+ tX_warning: "); fprintf(stderr, fmt , ## args); fprintf(stderr, "\n"); }
67 } tX_audiodevice_type;
71 char xinput_device[256];
73 int store_globals; // if it should store the globals vals on exit
75 char *alternate_rc; // a diferent set of stored globals to load
76 int no_gui; // run without any gui
88 char last_fn[PATH_MAX];
91 int use_stdout_cmdline;
92 int use_stdout_from_conf_file;
102 char tables_filename[PATH_MAX];
103 char record_filename[PATH_MAX];
106 float flash_response;
110 char file_editor[PATH_MAX];
114 char current_path[PATH_MAX];
116 /* new audiodevice handling
117 we have *all* variables for *all* audiodevice types -
118 even if support for them is not compiled in - to keep
119 the .terminatorX3rc.bin in sync.
122 tX_audiodevice_type audiodevice_type; // TX_AUDIODEVICE_TYPE_OSS etc.
124 /* OSS specific options */
125 char oss_device[PATH_MAX];
127 int oss_buff_size; // 2^X Bytes
130 /* ALSA specific options */
131 char alsa_device_id[PATH_MAX];
132 int alsa_buffer_time;
133 int alsa_period_time;
136 char lrdf_path[PATH_MAX];
138 int compress_set_files;
140 int fullscreen_enabled;
145 int alsa_free_hwstats;
148 int restore_midi_connections;
150 char wav_display_bg_focus[8];
151 char wav_display_bg_no_focus[8];
153 char wav_display_fg_focus[8];
154 char wav_display_fg_no_focus[8];
156 char wav_display_cursor[8];
157 char wav_display_cursor_mute[8];
160 char vu_meter_loud[8];
161 char vu_meter_normal[8];
162 double vu_meter_border_intensity;
166 int auto_assign_midi;
169 extern tx_global globals;
171 extern void load_globals();
172 extern void store_globals();
173 extern void set_global_defaults();
174 extern char *encode_xml(char *dest, const char *src);
175 extern char *decode_xml(char *dest, const char *src);
179 /* some ugly XML macros... */
180 #define restore_int(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); }}
181 #define restore_float(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue;}}
182 #define restore_string(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {strcpy(i, decode_xml(tmp_xml_buffer, (const char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1))); }}
183 #define restore_bool(s, i); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {if (xmlStrcmp(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), (const xmlChar *) "true")==0) i=true; else i=false; }}
184 #define restore_id(s, sp); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); }}
186 #define restore_int_ac(s, i, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); init; }}
187 #define restore_float_ac(s, i, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue; init; }}
188 #define restore_string_ac(s, i, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {strcpy(i, decode_xml(tmp_xml_buffer, (const char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1))); init; }}
189 #define restore_bool_ac(s, i, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {if (xmlStrcmp(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), (const xmlChar *) "true")==0) i=true; else i=false; init; }}
191 //#define restore_int_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
192 //#define restore_float_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *) "id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
193 //#define restore_bool_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {if (xmlStrcmp(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), (const xmlChar *) "true")==0) i=true; else i=false; pid_attr=(char* ) xmlGetProp(cur, (xmlChar *)"id"); if (pid_attr) { sscanf(pid_attr, "%i", &pid); sp.set_persistence_id(pid); } init; }}
195 extern int _store_compress_xml;
197 #define tX_store(fmt, args...); { _store_compress_xml ? gzprintf(rz, fmt , ## args) : fprintf(rc, fmt , ## args); }
199 #define store_int(s, i); tX_store("%s<%s>%i</%s>\n", indent, s,(int) i, s);
200 #define store_float(s, i); tX_store("%s<%s>%lf</%s>\n", indent, s,(double) i, s);
201 #define store_string(s, i); tX_store("%s<%s>%s</%s>\n", indent, s, encode_xml(tmp_xml_buffer, i) , s);
202 #define store_bool(s, i); tX_store("%s<%s>%s</%s>\n", indent, s, i ? "true" : "false", s);
204 #define store_id(s, id); tX_store("%s<%s id=\"%i\"/>\n", indent, s, id);
205 #define store_int_id(s, i, id); tX_store("%s<%s id=\"%i\">%i</%s>\n", indent, s, id, (int) i, s);
206 #define store_float_id(s, i, id); tX_store("%s<%s id=\"%i\">%lf</%s>\n", indent, s, id, (double) i, s);
207 #define store_bool_id(s, i, id); tX_store("%s<%s id=\"%i\">%s</%s>\n", indent, s, id, i ? "true" : "false", s);
209 #define store_int_sp(name, i, sp); { tX_store("%s<%s ", indent, name); sp.store_meta(rc, rz); tX_store(">%i</%s>\n", (int) i, name); }
210 #define store_float_sp(name, i, sp); { tX_store("%s<%s ", indent, name); sp.store_meta(rc, rz); tX_store(">%lf</%s>\n", (double) i, name); }
211 #define store_bool_sp(name, i, sp); { tX_store("%s<%s ", indent, name); sp.store_meta(rc, rz); tX_store(">%s</%s>\n", i ? "true" : "false", name); }
213 #define restore_int_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) { sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%i", &i); init; } sp.restore_meta(cur); }
214 #define restore_float_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {sscanf((char *) xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), "%lf", &dvalue); i=dvalue; init; } sp.restore_meta(cur);}
215 #define restore_bool_id(s, i, sp, init); if ((!elementFound) && (!xmlStrcmp(cur->name, (const xmlChar *) s))) { elementFound=1; if (xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)) {if (xmlStrcmp(xmlNodeListGetString(doc, cur->xmlChildrenNode, 1), (const xmlChar *) "true")==0) i=true; else i=false; init; } sp.restore_meta(cur);}
219 #endif /* __cplusplus */