Guitarix
gx_system.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009, 2010 Hermann Meyer, James Warden, Andreas Degert
3  * Copyright (C) 2011 Pete Shorthose
4  *
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.
9  *
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.
14  *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  * ---------------------------------------------------------------------------
19  *
20  * This is the gx_head system interface
21  *
22  * ----------------------------------------------------------------------------
23  */
24 
25 #include <dirent.h>
26 #include <iostream>
27 #include <iomanip> // NOLINT
28 
29 #include "engine.h"
30 
31 namespace gx_system {
32 
33 /****************************************************************
34  ** Measuring times (only when debugging)
35  */
36 
37 #ifndef NDEBUG
38 
40  period.reset();
41  duration.reset();
42  duration1.reset();
43  duration2.reset();
44  FPUStatus1 = 0;
45  FPUStatus2 = 0;
46  MXStatus1 = 0;
47  MXStatus2 = 0;
48 }
49 
50 void Measure::print_accum(const Accum& accum, const char* prefix, bool verbose, int total) const {
51  streamsize prec = cout.precision();
52  ios_base::fmtflags flags = cout.flags();
53  cout << prefix << "mean: " << fixed << setprecision(4) << ns2ms(accum.mean());
54  if (total > 0) {
55  cout << " (" << setprecision(2) << 100.0*accum.mean()/static_cast<float>(total) << "%)";
56  }
57  cout << ", min: " << setprecision(4) << ns2ms(accum.minimum())
58  << ", max: " << ns2ms(accum.maximum());
59  if (total > 0) {
60  cout << " (" << setprecision(2) << 100.0*accum.maximum()/static_cast<float>(total) << "%)";
61  }
62  if (verbose) {
63  cout << ", stddev: " << setprecision(4) << ns2ms(accum.stddev())
64  << ", n: " << accum.count();
65  }
66  cout << endl;
67  cout.precision(prec);
68  cout.flags(flags);
69 }
70 
71 static void print_status(const char *title, unsigned int status) {
72  // print list of names for active bits in "status"
73  // bits for mmx and x87 have different symbolic names in
74  // header files but are actually identical so that this function
75  // can be used for both types status word
76  Glib::ustring s;
77  if (status & FE_INVALID) {
78  if (!s.empty()) {
79  s += ",";
80  }
81  s += "invalid";
82  }
83 #ifdef FE_DENORM
84  if (status & FE_DENORM) {
85  if (!s.empty()) {
86  s += ",";
87  }
88  s += "denormal";
89  }
90 #endif
91  if (status & FE_DIVBYZERO) {
92  if (!s.empty()) {
93  s += ",";
94  }
95  s += "zerodivide";
96  }
97  if (status & FE_OVERFLOW) {
98  if (!s.empty()) {
99  s += ",";
100  }
101  s += "overflow";
102  }
103  if (status & FE_UNDERFLOW) {
104  if (!s.empty()) {
105  s += ",";
106  }
107  s += "underflow";
108  }
109  if (!s.empty()) {
110  cout << title << s << endl;
111  }
112 }
113 
114 void Measure::print(bool verbose) const {
115  if (verbose) {
116  print_accum(period, "period ", verbose);
117  print_accum(duration1, "duration1 ", verbose, period.mean());
118  print_accum(duration2, "duration2 ", verbose, period.mean());
119  print_accum(duration, "duration ", verbose, period.mean());
120  } else {
121  print_accum(duration, "duration ", false, period.mean());
122  }
123  print_status("FPU status: ", FPUStatus1 | FPUStatus2);
124  print_status("MX status: ", MXStatus1 | MXStatus2);
125 }
126 
128  : m(), pmeasure(m), t1s(), t1e(), t2s(), t1old(), FPUStatus(), MXStatus() {
129 }
130 
131 void MeasureThreadsafe::print(bool verbose) {
132  Measure *p = pmeasure;
133  Measure *pn;
134  if (p == m) {
135  pn = m+1;
136  } else {
137  pn = m;
138  }
139  atomic_set(&pmeasure, pn);
140  p->print(verbose);
141  p->reset();
142 }
143 
145 
147  char *p = getenv("GUITARIX_MEASURE");
148  if (!p) {
149  return;
150  }
151  bool verbose = false;
152  if (strcmp(p, "1") == 0) {
153  verbose = true;
154  }
155  Glib::signal_timeout().connect(
156  sigc::bind_return(
157  sigc::bind(
158  sigc::mem_fun(measure, &MeasureThreadsafe::print),
159  verbose),
160  true),
161  1000);
162 }
163 
164 #endif
165 
166 
167 /****************************************************************
168  ** class SkinHandling
169  */
170 
171 void SkinHandling::set_styledir(const string& style_dir) {
172  // fetch all skin names in directory
173  DIR *d;
174  d = opendir(style_dir.c_str());
175  if (!d) {
176  return;
177  }
178  // look for gx_head_*.rc and extract *-part
179  struct dirent *de;
180  skin_list.clear();
181  while ((de = readdir(d)) != 0) {
182  char *p = de->d_name;
183  if (strncmp(p, "gx_head_", 8) != 0) {
184  continue;
185  }
186  if (strncmp(p, "gx_head_gx", 10) == 0) {
187  continue;
188  }
189  p += 8;
190  int n = strlen(p) - 3;
191  if (strcmp(p+n, ".rc") != 0) {
192  continue;
193  }
194  skin_list.push_back(string(p, n));
195  }
196  closedir(d);
197  sort(skin_list.begin(), skin_list.end());
198 }
199 
200 bool SkinHandling::is_in_list(const string& name) {
201  return index(name) < skin_list.size();
202 }
203 
204 unsigned int SkinHandling::index(const Glib::ustring& name) {
205  unsigned int i = 0;
206  for (; i < skin_list.size(); ++i) {
207  if (skin_list[i] == name) {
208  break;
209  }
210  }
211  return i;
212 }
213 
214 const Glib::ustring& SkinHandling::operator[](unsigned int idx) {
215  if (idx < skin_list.size()) {
216  return skin_list[idx];
217  } else {
218  return empty;
219  }
220 }
221 
222 
223 /****************************************************************
224  ** class PathList
225  */
226 
227 PathList::PathList(const char *env_name): dirs() {
228  if (!env_name) {
229  return;
230  }
231  const char *p = getenv(env_name);
232  if (!p) {
233  return;
234  }
235  while (true) {
236  const char *q = strchr(p, ':');
237  if (q) {
238  int n = q - p;
239  if (n) {
240  add(std::string(p, n));
241  }
242  p = q+1;
243  } else {
244  if (*p) {
245  add(p);
246  }
247  break;
248  }
249  }
250 }
251 
252 bool PathList::contains(const string& d) const {
253  Glib::RefPtr<Gio::File> f = Gio::File::create_for_path(d);
254  for (pathlist::const_iterator i = dirs.begin();
255  i != dirs.end(); ++i) {
256  if (f->equal(*i)) {
257  return true;
258  }
259  }
260  return false;
261 }
262 
263 
264 bool PathList::find_dir(std::string* d, const std::string& filename) const {
265  for (pathlist::const_iterator i = dirs.begin();
266  i != dirs.end(); ++i) {
267  string p = (*i)->get_path();
268  string fn = Glib::build_filename(p, filename);
269  if (access(fn.c_str(), R_OK) == 0) {
270  *d = p;
271  return true;
272  }
273  }
274  return false;
275 }
276 
277 
278 /****************************************************************
279  ** class PrefixConverter
280  */
281 
282 void PrefixConverter::add(char s, const std::string& d) {
283  assert(s != '%');
284  dirs[s] = (d[d.size()-1] == '/' ? d.substr(0,d.size()-1) : d);
285 }
286 
287 std::string PrefixConverter::replace_symbol(const std::string& dir) const {
288  if (dir.size() < 2 || dir[0] != '%') {
289  return dir;
290  }
291  symbol_path_map::const_iterator i = dirs.find(dir[1]);
292  if (i != dirs.end()) {
293  return Glib::build_filename(i->second, dir.substr(2));
294  }
295  if (dir.compare(0, 2, "%%")) {
296  return dir.substr(1);
297  }
298  return dir;
299 }
300 
301 std::string PrefixConverter::replace_path(const std::string& dir) const {
302  for (symbol_path_map::const_iterator i = dirs.begin(); i != dirs.end(); ++i) {
303  size_t n = i->second.size();
304  if (dir.compare(0, n, i->second) == 0) {
305  std::string tail = dir.substr(n);
306  if (Glib::build_filename(i->second, tail) == dir) {
307  std::string sym = "%";
308  sym.push_back(i->first);
309  return sym + tail;
310  }
311  }
312  }
313  if (dir.size() < 2 || dir[0] != '%') {
314  return dir;
315  }
316  return "%" + dir;
317 }
318 
319 
320 /*****************************************************************
321  ** class DirectoryListing
322  */
323 
324 IRFileListing::IRFileListing(const std::string& path) {
325  Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(path);
326  if (file->query_exists()) {
327  Glib::RefPtr<Gio::FileEnumerator> child_enumeration =
328  file->enumerate_children(G_FILE_ATTRIBUTE_STANDARD_NAME
329  "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
330  "," G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
331  Glib::RefPtr<Gio::FileInfo> file_info;
332  while ((file_info = child_enumeration->next_file())) {
333  // fprintf(stderr,"G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE == %s\n",file_info->get_attribute_string(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE).c_str());
334  if ((file_info->get_attribute_string(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE) == "audio/x-wav") ||
335  (file_info->get_attribute_string(G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE) == "audio/x-aiff")){
336  listing.push_back(
337  FileName(
338  file_info->get_attribute_byte_string(G_FILE_ATTRIBUTE_STANDARD_NAME),
339  file_info->get_attribute_string(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME)));
340  }
341  }
342  } else {
344  "jconvolver",
345  boost::format(_("Error reading file path %1%")) % path);
346  }
347 }
348 
349 static void list_subdirs(const Glib::RefPtr<Gio::File>& file, std::vector<FileName>& dirs, const Glib::ustring& prefix) {
350  Glib::RefPtr<Gio::FileEnumerator> child_enumeration =
351  file->enumerate_children(G_FILE_ATTRIBUTE_STANDARD_NAME
352  "," G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME);
353  Glib::RefPtr<Gio::FileInfo> file_info;
354  while ((file_info = child_enumeration->next_file())) {
355  if (file_info->get_file_type() == Gio::FILE_TYPE_DIRECTORY) {
356  Glib::RefPtr<Gio::File> child = file->get_child(
357  file_info->get_attribute_byte_string(G_FILE_ATTRIBUTE_STANDARD_NAME));
358  dirs.push_back(
359  FileName(
360  child->get_path(),
361  prefix+file_info->get_attribute_string(G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME)));
362  list_subdirs(child, dirs, prefix+" ");
363  }
364  }
365 }
366 
367 void list_subdirs(PathList pl, std::vector<FileName>& dirs) {
368  for (PathList::iterator i = pl.begin(); i != pl.end(); ++i) {
369  std::string fn = (*i)->get_path();
370  dirs.push_back(FileName(fn, fn));
371  list_subdirs(*i, dirs, " ");
372  }
373 }
374 
375 
376 /****************************************************************
377  ** class BasicOptions
378  */
379 
380 BasicOptions *BasicOptions::instance = 0;
381 
383  : user_dir(),
384  user_IR_dir(),
385  sys_IR_dir(GX_SOUND_DIR),
386  IR_pathlist(),
387  IR_prefixmap(),
388  builder_dir(GX_BUILDER_DIR) {
389  user_dir = Glib::build_filename(Glib::get_user_config_dir(), "guitarix");
390  user_IR_dir = Glib::build_filename(user_dir, "IR");
391 
392  make_ending_slash(user_dir);
393  make_ending_slash(user_IR_dir);
394  make_ending_slash(sys_IR_dir);
396 
397  // for legacy presets
398  IR_pathlist.add(get_user_IR_dir());
399  IR_pathlist.add(get_sys_IR_dir());
400 
401  // for current presets
402  IR_prefixmap.add('U', get_user_IR_dir());
403  IR_prefixmap.add('S', get_sys_IR_dir());
404 
405  instance = this;
406 }
407 
409  instance = 0;
410 }
411 
412 void BasicOptions::make_ending_slash(string& dirpath) {
413  if (dirpath.empty()) {
414  return;
415  }
416  if (dirpath[dirpath.size()-1] != '/') {
417  dirpath += "/";
418  }
419 }
420 
421 
422 /****************************************************************
423  ** class CmdlineOptions
424  */
425 
426 static inline const char *shellvar(const char *name) {
427  const char *p = getenv(name);
428  return p ? p : "";
429 }
430 
431 #define TCLR(s) "\033[1;32m" s "\033[0m" // light green
432 #define TCLR2(s) TCLR(s), s
433 
435  : BasicOptions(),
436  main_group("",""),
437  optgroup_style("style", TCLR2("GTK style configuration options")),
438  optgroup_jack("jack", TCLR2("JACK configuration options")),
439  optgroup_overload("overload", TCLR2("Switch to bypass mode on overload condition")),
440  optgroup_file("file", TCLR2("File options")),
441  optgroup_debug("debug", TCLR2("Debug options")),
442  version(false), clear(false),
443  jack_input(shellvar("GUITARIX2JACK_INPUTS")),
444  jack_midi(shellvar("GUITARIX2JACK_MIDI")),
445  jack_outputs(),
446  jack_uuid(),
447  jack_uuid2(),
448  jack_noconnect(false),
449  jack_single(false),
450  jack_servername(),
451  load_file(shellvar("GUITARIX_LOAD_FILE")),
452  style_dir(GX_STYLE_DIR),
453  factory_dir(GX_FACTORY_DIR),
454  pixmap_dir(GX_PIXMAPS_DIR),
455  old_user_dir(),
456  preset_dir(),
457  pluginpreset_dir(),
458  lv2_preset_dir(),
459  temp_dir(),
460  plugin_dir(),
461  loop_dir(),
462  rcset(shellvar("GUITARIX_RC_STYLE")),
463  nogui(false),
464  rpcport(RPCPORT_DEFAULT),
465  rpcaddress(),
466  onlygui(false),
467  liveplaygui(false),
468  hideonquit(false),
469  mute(false),
470  setbank(),
471  tuner_tet(),
472  tuner_ref(),
473  sporadic_overload(0),
474  idle_thread_timeout(0),
475  convolver_watchdog(true),
476  xrun_watchdog(false),
477  lterminal(false),
478  a_save(false),
479  auto_save(false),
480 #ifndef NDEBUG
481  dump_parameter(false),
482 #endif
483  skin(style_dir),
484  mainwin_x(-1),
485  mainwin_y(-1),
486  mainwin_height(-1),
487  window_height(600),
488  preset_window_height(220),
489  mul_buffer(1),
490  skin_name("Guitarix"),
491  no_warn_latency(false),
492  system_order_rack_h(false),
493  system_show_value(false),
494  system_show_tooltips(true),
495  system_animations(true),
496  system_show_presets(false),
497  system_show_toolbar(false),
498  system_show_rack(false),
499  reload_lv2_presets(true) {
500  const char* home = getenv("HOME");
501  if (!home) {
502  throw GxFatalError(_("no HOME environment variable"));
503  }
504  old_user_dir = string(home) + "/.gx_head/";
505  plugin_dir = Glib::build_filename(get_user_dir(), "plugins");
506  preset_dir = Glib::build_filename(get_user_dir(), "banks");
507  pluginpreset_dir = Glib::build_filename(get_user_dir(), "pluginpresets");
508  lv2_preset_dir = Glib::build_filename(get_user_dir(), "pluginpresets/lv2");
509  loop_dir = Glib::build_filename(get_pluginpreset_dir(), "loops");
510  temp_dir = Glib::build_filename(get_user_dir(), "temp");
511  const char *tmp = getenv("GUITARIX2JACK_OUTPUTS1");
512  if (tmp && *tmp) {
513  jack_outputs.push_back(tmp);
514  }
515  tmp = getenv("GUITARIX2JACK_OUTPUTS2");
516  if (tmp && *tmp) {
517  jack_outputs.push_back(tmp);
518  }
519 
520  read_ui_vars();
521 
522  // ---- parse command line arguments
523  set_summary(
524  "All parameters are optional. Examples:\n"
525  "\tguitarix\n"
526  "\tguitarix -r gx4-black -i system:capture_3\n"
527  "\tguitarix -c -o system:playback_1 -o system:playback_2");
528 
529  // main group
530  Glib::OptionEntry opt_version;
531  opt_version.set_short_name('v');
532  opt_version.set_long_name("version");
533  opt_version.set_description("Print version string and exit");
534  Glib::OptionEntry opt_nogui;
535  opt_nogui.set_short_name('N');
536  opt_nogui.set_long_name("nogui");
537  opt_nogui.set_description("start without GUI");
538  Glib::OptionEntry opt_rpcport;
539  opt_rpcport.set_short_name('p');
540  opt_rpcport.set_long_name("rpcport");
541  opt_rpcport.set_description("start a JSON-RPC server listening on port PORT");
542  opt_rpcport.set_arg_description("PORT");
543  Glib::OptionEntry opt_rpchost;
544  opt_rpchost.set_short_name('H');
545  opt_rpchost.set_long_name("rpchost");
546  opt_rpchost.set_description("set hostname to connect to");
547  opt_rpchost.set_arg_description("HOSTNAME");
548  Glib::OptionEntry opt_onlygui;
549  opt_onlygui.set_short_name('G');
550  opt_onlygui.set_long_name("onlygui");
551  opt_onlygui.set_description("start only GUI");
552  Glib::OptionEntry opt_liveplaygui;
553  opt_liveplaygui.set_short_name('L');
554  opt_liveplaygui.set_long_name("liveplaygui");
555  opt_liveplaygui.set_description("start with Live Play GUI");
556  Glib::OptionEntry opt_hideonquit;
557  opt_hideonquit.set_short_name('E');
558  opt_hideonquit.set_long_name("hideonquit");
559  opt_hideonquit.set_description("only hide GUI instead quit engine");
560  Glib::OptionEntry opt_mute;
561  opt_mute.set_short_name('M');
562  opt_mute.set_long_name("mute");
563  opt_mute.set_description("start with engine muted");
564  Glib::OptionEntry opt_bank;
565  opt_bank.set_short_name('b');
566  opt_bank.set_long_name("bank");
567  opt_bank.set_description("set bank and preset to load at startup");
568  opt_bank.set_arg_description("BANK:PRESET (A:0-Z:9)");
569  Glib::OptionEntry opt_tuner_tet;
570  opt_tuner_tet.set_short_name('t');
571  opt_tuner_tet.set_long_name("tuner_tet");
572  opt_tuner_tet.set_description("set tuner temperament at startup");
573  opt_tuner_tet.set_arg_description("tuner temperament (12, 19, 24, 31, 53)");
574  Glib::OptionEntry opt_tuner_ref;
575  opt_tuner_ref.set_short_name('F');
576  opt_tuner_ref.set_long_name("reference_pitch");
577  opt_tuner_ref.set_description("set tuner reference pitch at startup");
578  opt_tuner_ref.set_arg_description("tuner reference pitch (225 - 453)");
579  main_group.add_entry(opt_version, version);
580  main_group.add_entry(opt_nogui, nogui);
581  main_group.add_entry(opt_rpcport, rpcport);
582  main_group.add_entry(opt_rpchost, rpcaddress);
583  main_group.add_entry(opt_onlygui, onlygui);
584  main_group.add_entry(opt_liveplaygui, liveplaygui);
585  main_group.add_entry(opt_hideonquit, hideonquit);
586  main_group.add_entry(opt_mute, mute);
587  main_group.add_entry(opt_bank, setbank);
588  main_group.add_entry(opt_tuner_tet, tuner_tet);
589  main_group.add_entry(opt_tuner_ref, tuner_ref);
590  set_main_group(main_group);
591 
592  // style options
593  Glib::OptionEntry opt_clear;
594  opt_clear.set_short_name('c');
595  opt_clear.set_long_name("clear");
596  opt_clear.set_description("Use 'default' GTK style");
597  Glib::OptionEntry opt_rcset;
598  opt_rcset.set_short_name('r');
599  opt_rcset.set_long_name("rcset");
600  opt_rcset.set_description(get_opskin());
601  opt_rcset.set_arg_description("STYLE");
602  optgroup_style.add_entry(opt_clear, clear);
603  optgroup_style.add_entry(opt_rcset, rcset);
604 
605  // JACK options
606  Glib::OptionEntry opt_jack_input;
607  opt_jack_input.set_short_name('i');
608  opt_jack_input.set_long_name("jack-input");
609  opt_jack_input.set_description("Guitarix JACK input");
610  opt_jack_input.set_arg_description("PORT");
611  Glib::OptionEntry opt_jack_output;
612  opt_jack_output.set_short_name('o');
613  opt_jack_output.set_long_name("jack-output");
614  opt_jack_output.set_description("Guitarix JACK outputs");
615  opt_jack_output.set_arg_description("PORT");
616  Glib::OptionEntry opt_jack_midi;
617  opt_jack_midi.set_short_name('m');
618  opt_jack_midi.set_long_name("jack-midi");
619  opt_jack_midi.set_description("Guitarix JACK midi control");
620  opt_jack_midi.set_arg_description("PORT");
621  Glib::OptionEntry opt_jack_noconnect;
622  opt_jack_noconnect.set_short_name('J');
623  opt_jack_noconnect.set_long_name("jack-no-conect");
624  opt_jack_noconnect.set_description("dissable self-connect JACK ports");
625  Glib::OptionEntry opt_jack_instance;
626  opt_jack_instance.set_short_name('n');
627  opt_jack_instance.set_long_name("name");
628  opt_jack_instance.set_description("instance name (default gx_head)");
629  opt_jack_instance.set_arg_description("NAME");
630  Glib::OptionEntry opt_jack_single;
631  opt_jack_single.set_short_name('D');
632  opt_jack_single.set_long_name("disable-multi-client");
633  opt_jack_single.set_description("run guitarix as single client");
634  Glib::OptionEntry opt_jack_uuid;
635  opt_jack_uuid.set_short_name('U');
636  opt_jack_uuid.set_long_name("jack-uuid");
637  opt_jack_uuid.set_description("JackSession ID");
638  opt_jack_uuid.set_arg_description("UUID");
639  Glib::OptionEntry opt_jack_uuid2;
640  opt_jack_uuid2.set_short_name('A');
641  opt_jack_uuid2.set_long_name("jack-uuid2");
642  opt_jack_uuid2.set_description("JackSession ID");
643  opt_jack_uuid2.set_arg_description("UUID2");
644  Glib::OptionEntry opt_jack_servername;
645  opt_jack_servername.set_short_name('s');
646  opt_jack_servername.set_long_name("server-name");
647  opt_jack_servername.set_description("JACK server name to connect to");
648  opt_jack_servername.set_arg_description("NAME");
649  optgroup_jack.add_entry(opt_jack_input, jack_input);
650  optgroup_jack.add_entry(opt_jack_output, jack_outputs);
651  optgroup_jack.add_entry(opt_jack_midi, jack_midi);
652  optgroup_jack.add_entry(opt_jack_noconnect, jack_noconnect);
653  optgroup_jack.add_entry(opt_jack_instance, jack_instance);
654  optgroup_jack.add_entry(opt_jack_single, jack_single);
655  optgroup_jack.add_entry(opt_jack_uuid, jack_uuid);
656  optgroup_jack.add_entry(opt_jack_uuid2, jack_uuid2);
657  optgroup_jack.add_entry(opt_jack_servername, jack_servername);
658 
659  // Engine overload options
660  Glib::OptionEntry opt_watchdog_idle;
661  opt_watchdog_idle.set_short_name('I');
662  opt_watchdog_idle.set_long_name("idle-timeout");
663  opt_watchdog_idle.set_description(
664  "starved idle thread probe (default: disabled)");
665  opt_watchdog_idle.set_arg_description("SECONDS");
666  Glib::OptionEntry opt_watchdog_convolver;
667  opt_watchdog_convolver.set_short_name('C');
668  opt_watchdog_convolver.set_long_name("no-convolver-overload");
669  opt_watchdog_convolver.set_description(
670  "disable overload on convolver missed deadline");
671  opt_watchdog_convolver.set_flags(Glib::OptionEntry::FLAG_REVERSE);
672  Glib::OptionEntry opt_watchdog_xrun;
673  opt_watchdog_xrun.set_short_name('X');
674  opt_watchdog_xrun.set_long_name("xrun-overload");
675  opt_watchdog_xrun.set_description(
676  "JACK xrun (default: false)");
677  Glib::OptionEntry opt_sporadic_overload;
678  opt_sporadic_overload.set_short_name('S');
679  opt_sporadic_overload.set_long_name("sporadic");
680  opt_sporadic_overload.set_description(
681  "allow single overload events per interval (default: disabled)");
682  opt_sporadic_overload.set_arg_description("SECONDS");
683  optgroup_overload.add_entry(opt_watchdog_idle, idle_thread_timeout);
684  optgroup_overload.add_entry(opt_watchdog_convolver, convolver_watchdog);
685  optgroup_overload.add_entry(opt_watchdog_xrun, xrun_watchdog);
686  optgroup_overload.add_entry(opt_sporadic_overload, sporadic_overload);
687 
688  // FILE options
689  Glib::OptionEntry opt_load_file;
690  opt_load_file.set_short_name('f');
691  opt_load_file.set_long_name("load-file");
692  opt_load_file.set_description(_("load state file on startup"));
693  opt_load_file.set_arg_description("FILE");
694  optgroup_file.add_entry_filename(opt_load_file, load_file);
695  Glib::OptionEntry opt_plugin_dir;
696  opt_plugin_dir.set_short_name('P');
697  opt_plugin_dir.set_long_name("plugin-dir");
698  opt_plugin_dir.set_description(_("directory with guitarix plugins (.so files)"));
699  opt_plugin_dir.set_arg_description("DIR");
700  optgroup_file.add_entry_filename(opt_plugin_dir, plugin_dir);
701  Glib::OptionEntry opt_save_on_exit;
702  opt_save_on_exit.set_short_name('K');
703  opt_save_on_exit.set_long_name("disable-save-on-exit");
704  opt_save_on_exit.set_description(_("disable auto save to state file when quit"));
705  optgroup_file.add_entry(opt_save_on_exit, a_save);
706  Glib::OptionEntry opt_auto_save;
707  opt_auto_save.set_short_name('a');
708  opt_auto_save.set_long_name("auto-save");
709  opt_auto_save.set_description(_("enable auto save (only in server mode)"));
710  optgroup_file.add_entry(opt_auto_save, auto_save);
711 
712  // DEBUG options
713  Glib::OptionEntry opt_builder_dir;
714  opt_builder_dir.set_short_name('B');
715  opt_builder_dir.set_long_name("builder-dir");
716  opt_builder_dir.set_description(_("directory from which .glade files are loaded"));
717  opt_builder_dir.set_arg_description("DIR");
718  optgroup_debug.add_entry_filename(opt_builder_dir, builder_dir);
719  Glib::OptionEntry opt_style_dir;
720  opt_style_dir.set_short_name('S');
721  opt_style_dir.set_long_name("style-dir");
722  opt_style_dir.set_description(_("directory with skin style definitions (.rc files)"));
723  opt_style_dir.set_arg_description("DIR");
724  optgroup_debug.add_entry_filename(opt_style_dir, style_dir);
725  Glib::OptionEntry opt_log_terminal;
726  opt_log_terminal.set_short_name('t');
727  opt_log_terminal.set_long_name("log-terminal");
728  opt_log_terminal.set_description(_("print log on terminal"));
729  optgroup_debug.add_entry(opt_log_terminal, lterminal);
730 #ifndef NDEBUG
731  Glib::OptionEntry opt_dump_parameter;
732  opt_dump_parameter.set_short_name('d');
733  opt_dump_parameter.set_long_name("dump-parameter");
734  opt_dump_parameter.set_description(_("dump parameter table in json format"));
735  optgroup_debug.add_entry(opt_dump_parameter, dump_parameter);
736 #endif
737 
738  // collecting all option groups
739  add_group(optgroup_style);
740  add_group(optgroup_jack);
741  add_group(optgroup_overload);
742  add_group(optgroup_file);
743  add_group(optgroup_debug);
744 }
745 
747  write_ui_vars();
748 }
749 
750 void CmdlineOptions::read_ui_vars() {
751  ifstream i(Glib::build_filename(get_user_dir(), "ui_rc").c_str());
752  if (i.fail()) {
753  return;
754  }
755  JsonParser jp(&i);
756  try {
757  jp.next(JsonParser::begin_object);
758  while (jp.peek() != JsonParser::end_object) {
759  jp.next(JsonParser::value_key);
760  if (jp.current_value() == "system.mainwin_x") {
761  jp.next(JsonParser::value_number);
762  mainwin_x = jp.current_value_int();
763  } else if (jp.current_value() == "system.mainwin_y") {
764  jp.next(JsonParser::value_number);
765  mainwin_y = jp.current_value_int();
766  } else if (jp.current_value() == "system.mainwin_height") {
767  jp.next(JsonParser::value_number);
768  mainwin_height = jp.current_value_int();
769  } else if (jp.current_value() == "system.mainwin_rack_height") {
770  jp.next(JsonParser::value_number);
771  window_height = jp.current_value_int();
772  } else if (jp.current_value() == "system.preset_window_height") {
773  jp.next(JsonParser::value_number);
774  preset_window_height = jp.current_value_int();
775  } else if (jp.current_value() == "system.mul_buffer") {
776  jp.next(JsonParser::value_number);
777  mul_buffer = jp.current_value_int();
778  } else if (jp.current_value() == "ui.skin_name") {
779  jp.next(JsonParser::value_string);
780  skin_name = jp.current_value();
781  } else if (jp.current_value() == "ui.latency_nowarn") {
782  jp.next(JsonParser::value_number);
783  no_warn_latency = jp.current_value_int();
784  } else if (jp.current_value() == "system.order_rack_h") {
785  jp.next(JsonParser::value_number);
786  system_order_rack_h = jp.current_value_int();
787  } else if (jp.current_value() == "system.show_value") {
788  jp.next(JsonParser::value_number);
789  system_show_value = jp.current_value_int();
790  } else if (jp.current_value() == "system.show_tooltips") {
791  jp.next(JsonParser::value_number);
792  system_show_tooltips = jp.current_value_int();
793  } else if (jp.current_value() == "system.animations") {
794  jp.next(JsonParser::value_number);
795  system_animations = jp.current_value_int();
796  } else if (jp.current_value() == "system.show_presets") {
797  jp.next(JsonParser::value_number);
798  system_show_presets = jp.current_value_int();
799  } else if (jp.current_value() == "system.show_toolbar") {
800  jp.next(JsonParser::value_number);
801  system_show_toolbar = jp.current_value_int();
802  } else if (jp.current_value() == "system.show_rack") {
803  jp.next(JsonParser::value_number);
804  system_show_rack = jp.current_value_int();
805  }
806  }
807  jp.next(JsonParser::end_object);
808  jp.close();
809  } catch (JsonException&) {
810  gx_print_warning("main", "can't read/parse ui_rc");
811  }
812  i.close();
813 }
814 
815 void CmdlineOptions::write_ui_vars() {
816  ofstream o(Glib::build_filename(get_user_dir(), "ui_rc").c_str());
817  if (o.fail()) {
818  return;
819  }
820  JsonWriter jw(&o);
821  try {
822  jw.begin_object(true);
823  jw.write_kv("system.mainwin_x", mainwin_x);
824  jw.write_kv("system.mainwin_y", mainwin_y);
825  jw.write_kv("system.mainwin_height", mainwin_height);
826  jw.write_kv("system.mainwin_rack_height", window_height);
827  jw.write_kv("system.preset_window_height", preset_window_height);
828  jw.write_kv("system.mul_buffer", mul_buffer);
829  jw.write_kv("ui.skin_name", skin_name);
830  jw.write_kv("ui.latency_nowarn", no_warn_latency);
831  jw.write_kv("system.order_rack_h", system_order_rack_h);
832  jw.write_kv("system.show_value", system_show_value);
833  jw.write_kv("system.show_tooltips", system_show_tooltips);
834  jw.write_kv("system.animations", system_animations);
835  jw.write_kv("system.show_presets", system_show_presets);
836  jw.write_kv("system.show_toolbar", system_show_toolbar);
837  jw.write_kv("system.show_rack", system_show_rack);
838  jw.end_object(true);
839  jw.close();
840  } catch (JsonException&) {
841  gx_print_warning("main", "can't write ui_rc");
842  }
843  o.close();
844 }
845 
846 Glib::ustring CmdlineOptions::get_jack_output(unsigned int n) const {
847  if (n >= jack_outputs.size()) {
848  return "";
849  }
850  return jack_outputs.at(n);
851 }
852 
853 string CmdlineOptions::get_opskin() {
854  // GTK options: rc style (aka skin)
855  string opskin("Style to use");
856 
857  // initialize number of skins. We just count the number of rc files
858  unsigned int n = skin.skin_list.size();
859  if (n < 1) {
860  return opskin;
861  }
862 
863  vector<Glib::ustring>::iterator it;
864 
865  for (it = skin.skin_list.begin(); it != skin.skin_list.end(); ++it) {
866  opskin += ", '" + *it + "'";
867  }
868  return opskin;
869 }
870 
871 static void log_terminal(const string& msg, GxLogger::MsgType tp, bool plugged) {
872  const char *t;
873  switch (tp) {
874  case GxLogger::kInfo: t = "I"; break;
875  case GxLogger::kWarning: t = "W"; break;
876  case GxLogger::kError: t = "E"; break;
877  default: t = "?"; break;
878  }
879  if (!plugged) {
880  cerr << t << " " << msg << endl;
881  }
882 }
883 
884 void CmdlineOptions::process(int argc, char** argv) {
885  path_to_program = Gio::File::create_for_path(argv[0])->get_path();
886  if (version) {
887  std::cout << "Guitarix version \033[1;32m"
888  << GX_VERSION << endl
889  << "\033[0m Copyright " << static_cast<char>(0x40) << " 2010 "
890  << "Hermman Meyer - James Warden - Andreas Degert"
891  << endl;
892  exit(0);
893  }
894 #ifdef NDEBUG
895  if (argc > 1) {
896  throw GxFatalError(
897  string("unknown argument on command line: ")+argv[1]);
898  }
899 #endif
900  if (clear && !rcset.empty()) {
901  throw Glib::OptionError(
902  Glib::OptionError::BAD_VALUE,
903  _("-c and -r cannot be used together"));
904  }
905  if (nogui && liveplaygui) {
906  throw Glib::OptionError(
907  Glib::OptionError::BAD_VALUE,
908  _("-N and -L cannot be used together"));
909  }
910  if (onlygui && !setbank.empty()) {
911  throw Glib::OptionError(
912  Glib::OptionError::BAD_VALUE,
913  _("-G and -b cannot be used together"));
914  }
915  if (lterminal) {
917  sigc::ptr_fun(log_terminal));
918  if (nogui) {
920  }
921  }
922 
924  make_ending_slash(style_dir);
925  make_ending_slash(factory_dir);
926  make_ending_slash(pixmap_dir);
927  make_ending_slash(preset_dir);
928  make_ending_slash(pluginpreset_dir);
929  make_ending_slash(lv2_preset_dir);
930  make_ending_slash(loop_dir);
931  make_ending_slash(temp_dir);
932  make_ending_slash(plugin_dir);
933 
934  skin.set_styledir(style_dir);
935  unsigned int n = skin.skin_list.size();
936  if (n < 1) {
937  gx_print_fatal(_("main"), string(_("number of skins is 0")));
938  }
939  if (!rcset.empty()) {
940  if (skin.is_in_list(rcset)) {
941  skin_name = rcset;
942  } else {
943  throw Glib::OptionError(
944  Glib::OptionError::BAD_VALUE,
945  (boost::format(_("invalid style '%1%' on command line"))
946  % rcset).str());
947  }
948  }
949  if (jack_outputs.size() > 2) {
951  _("main"),
952  _("Warning --> provided more than 2 output ports, ignoring extra ports"));
953  }
954 }
955 
956 
957 /****************************************************************
958  ** misc functions
959  */
960 
961 // ---- gx_head system function
962 int gx_system_call(const string& cmd,
963  const bool devnull,
964  const bool escape) {
965  string str = cmd;
966 
967  if (devnull)
968  str.append(" 1>/dev/null 2>&1");
969 
970  if (escape)
971  str.append("&");
972 
973  // cerr << " ********* \n system command = " << str.c_str() << endl;
974 
975  sigset_t waitset;
976  sigemptyset(&waitset);
977  sigaddset(&waitset, SIGCHLD);
978  sigprocmask(SIG_UNBLOCK, &waitset, NULL);
979  int rc = system(str.c_str());
980  sigprocmask(SIG_BLOCK, &waitset, NULL);
981  return rc;
982 }
983 
984 void strip(Glib::ustring& s) {
985  size_t n = s.find_first_not_of(' ');
986  if (n == Glib::ustring::npos) {
987  s.erase();
988  return;
989  }
990  if (n != 0) {
991  s.erase(0, n);
992  }
993  s.erase(s.find_last_not_of(' ')+1);
994 }
995 
996 /*
997 ** encoding / decoding filenames
998 */
999 
1000 static inline bool check_char(unsigned char c) {
1001  static const char *badchars = "/%?*<>\\:#&$'\"(){}[]~;`|.";
1002  if (c < 32) {
1003  return false;
1004  }
1005  for (const char *p = badchars; *p; p++) {
1006  if (c == *p) {
1007  return false;
1008  }
1009  }
1010  return true;
1011 }
1012 
1013 std::string encode_filename(const std::string& s) {
1014  std::string res;
1015  res.reserve(s.size());
1016  for (unsigned int i = 0; i < s.size(); i++) {
1017  unsigned char c = s[i];
1018  if (!check_char(c)) {
1019  res.append(1, '%');
1020  static const unsigned char code[16] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
1021  res.append(1, code[c / 16]);
1022  res.append(1, code[c % 16]);
1023  } else {
1024  res.append(1, c);
1025  }
1026  }
1027  return res;
1028 }
1029 
1030 static inline bool dct(unsigned char c, int &n) {
1031  if (c < '0') {
1032  return false;
1033  }
1034  if (c <= '9') {
1035  n = c - '0';
1036  return true;
1037  }
1038  if (c < 'a') {
1039  return false;
1040  }
1041  if (c <= 'f') {
1042  n = c - 'a';
1043  return true;
1044  }
1045  return false;
1046 }
1047 
1048 std::string decode_filename(const std::string& s) {
1049  std::string res;
1050  res.reserve(s.size());
1051  for (unsigned int i = 0; i < s.size(); i++) {
1052  unsigned char c = s[i];
1053  if (c == '%') {
1054  int n1, n2;
1055  if (s.size() - i < 3 || !dct(s[i+1],n1) || !dct(s[i+2],n2)) {
1056  // error, don't do any decoding
1057  return s;
1058  }
1059  res.push_back(n1*16 + n2);
1060  i += 2;
1061  } else {
1062  res.push_back(c);
1063  }
1064  }
1065  return res;
1066 }
1067 
1068 
1069 } /* end of gx_system namespace */
gx_print_fatal
void gx_print_fatal(const char *, const std::string &)
Definition: gx_logging.cpp:177
gx_system::Measure::FPUStatus2
unsigned int FPUStatus2
Definition: gx_system.h:185
gx_system::Accum::maximum
float maximum() const
Definition: gx_system.h:168
gx_system::JsonParser::value_key
@ value_key
Definition: gx_json.h:130
gx_system::Measure::MXStatus2
unsigned int MXStatus2
Definition: gx_system.h:186
gx_system::BasicOptions::BasicOptions
BasicOptions()
Definition: gx_system.cpp:382
gx_system::IRFileListing::IRFileListing
IRFileListing(const std::string &path)
Definition: gx_system.cpp:324
gx_system::JsonParser::begin_object
@ begin_object
Definition: gx_json.h:124
gx_system::SkinHandling::operator[]
const Glib::ustring & operator[](unsigned int idx)
Definition: gx_system.cpp:214
gx_system::encode_filename
std::string encode_filename(const std::string &s)
Definition: gx_system.cpp:1013
gx_system::JsonParser::value_string
@ value_string
Definition: gx_json.h:128
gx_system::Measure
Definition: gx_system.h:178
gx_system::CmdlineOptions::get_pluginpreset_dir
const std::string & get_pluginpreset_dir() const
Definition: gx_system.h:476
gx_system::atomic_set
void atomic_set(volatile int *p, int v)
Definition: gx_system.h:90
gx_system::CmdlineOptions::dump_parameter
bool dump_parameter
Definition: gx_system.h:436
gx_system::BasicOptions
Definition: gx_system.h:353
gx_system::Accum::stddev
float stddev() const
Definition: gx_system.h:166
gx_system::Measure::print
void print(bool verbose) const
Definition: gx_system.cpp:114
gx_system::Measure::period
Accum period
Definition: gx_system.h:179
gx_system::MeasureThreadsafe
Definition: gx_system.h:194
gx_system::CmdlineOptions::system_show_toolbar
bool system_show_toolbar
Definition: gx_system.h:454
gx_system::CmdlineOptions::CmdlineOptions
CmdlineOptions()
Definition: gx_system.cpp:434
gx_system::measure
MeasureThreadsafe measure
Definition: gx_system.cpp:144
gx_system::SkinHandling::set_styledir
void set_styledir(const std::string &styledir)
Definition: gx_system.cpp:171
gx_system::CmdlineOptions::system_show_rack
bool system_show_rack
Definition: gx_system.h:455
GxLogger::signal_message
msg_signal & signal_message()
Definition: gx_logging.cpp:77
gx_system::PathList::find_dir
bool find_dir(std::string *d, const std::string &filename) const
Definition: gx_system.cpp:264
gx_print_warning
void gx_print_warning(const char *, const std::string &)
Definition: gx_logging.cpp:161
gx_system::BasicOptions::make_ending_slash
static void make_ending_slash(std::string &dirpath)
Definition: gx_system.cpp:412
RPCPORT_DEFAULT
#define RPCPORT_DEFAULT
Definition: gx_system.h:350
gx_system::BasicOptions::get_user_IR_dir
const std::string & get_user_IR_dir() const
Definition: gx_system.h:375
gx_system::PrefixConverter::replace_path
std::string replace_path(const std::string &dir) const
Definition: gx_system.cpp:301
GxLogger::kInfo
@ kInfo
Definition: gx_logging.h:42
gx_system::CmdlineOptions::mainwin_x
int mainwin_x
Definition: gx_system.h:441
gx_system::CmdlineOptions::system_order_rack_h
bool system_order_rack_h
Definition: gx_system.h:449
gx_system::SkinHandling::is_in_list
bool is_in_list(const std::string &name)
Definition: gx_system.cpp:200
gx_system::BasicOptions::builder_dir
std::string builder_dir
Definition: gx_system.h:362
GxLogger::unplug_queue
void unplug_queue()
Definition: gx_logging.cpp:82
gx_system::decode_filename
std::string decode_filename(const std::string &s)
Definition: gx_system.cpp:1048
gx_system::BasicOptions::get_sys_IR_dir
const std::string & get_sys_IR_dir() const
Definition: gx_system.h:376
gx_system::CmdlineOptions::mainwin_y
int mainwin_y
Definition: gx_system.h:442
gx_system::PathList::iterator
std::list< Glib::RefPtr< Gio::File > >::const_iterator iterator
Definition: gx_system.h:292
gx_system::Accum::count
int count() const
Definition: gx_system.h:164
gx_system::CmdlineOptions::no_warn_latency
bool no_warn_latency
Definition: gx_system.h:448
gx_system::MeasureThreadsafe::MeasureThreadsafe
MeasureThreadsafe()
Definition: gx_system.cpp:127
gx_system::MeasureThreadsafe::print
void print(bool verbose=false)
Definition: gx_system.cpp:131
gx_system::Measure::FPUStatus1
unsigned int FPUStatus1
Definition: gx_system.h:183
gx_system::Accum
Definition: gx_system.h:145
gx_system::Accum::reset
void reset()
Definition: gx_system.h:156
gx_system::CmdlineOptions::skin
SkinHandling skin
Definition: gx_system.h:438
gx_system::PathList
Definition: gx_system.h:289
gx_system::Measure::print_accum
void print_accum(const Accum &accum, const char *prefix, bool verbose, int total=0) const
Definition: gx_system.cpp:50
gx_system::BasicOptions::get_user_dir
const std::string & get_user_dir() const
Definition: gx_system.h:374
gx_print_error
void gx_print_error(const char *, const std::string &)
Definition: gx_logging.cpp:166
gx_system::Accum::minimum
float minimum() const
Definition: gx_system.h:167
gx_system::Measure::duration1
Accum duration1
Definition: gx_system.h:181
gx_system::Accum::mean
float mean() const
Definition: gx_system.h:165
gx_system::JsonParser::end_object
@ end_object
Definition: gx_json.h:125
gx_system::CmdlineOptions::skin_name
Glib::ustring skin_name
Definition: gx_system.h:447
gx_system::BasicOptions::~BasicOptions
~BasicOptions()
Definition: gx_system.cpp:408
gx_system::CmdlineOptions::system_show_tooltips
bool system_show_tooltips
Definition: gx_system.h:451
gx_system::PrefixConverter::add
void add(char s, const std::string &d)
Definition: gx_system.cpp:282
GxLogger::kWarning
@ kWarning
Definition: gx_logging.h:43
gx_system
Definition: gx_json.h:33
gx_system::CmdlineOptions::mul_buffer
int mul_buffer
Definition: gx_system.h:446
gx_system::Measure::duration
Accum duration
Definition: gx_system.h:180
gx_system::JsonParser::value_number
@ value_number
Definition: gx_json.h:129
GxFatalError
Definition: gx_logging.h:90
gx_system::PathList::PathList
PathList(const char *env_name=0)
Definition: gx_system.cpp:227
gx_system::Measure::MXStatus1
unsigned int MXStatus1
Definition: gx_system.h:184
gx_system::CmdlineOptions::mainwin_height
int mainwin_height
Definition: gx_system.h:443
GxLogger::get_logger
static GxLogger & get_logger()
Definition: gx_logging.cpp:50
gx_system::CmdlineOptions::window_height
int window_height
Definition: gx_system.h:444
gx_system::Measure::duration2
Accum duration2
Definition: gx_system.h:182
gx_system::CmdlineOptions::~CmdlineOptions
~CmdlineOptions()
Definition: gx_system.cpp:746
gx_system::CmdlineOptions::system_show_value
bool system_show_value
Definition: gx_system.h:450
gx_system::Measure::reset
void reset()
Definition: gx_system.cpp:39
gx_system::PathList::end
iterator end()
Definition: gx_system.h:302
gx_system::CmdlineOptions::system_show_presets
bool system_show_presets
Definition: gx_system.h:453
gx_system::add_time_measurement
void add_time_measurement()
Definition: gx_system.cpp:146
gx_system::list_subdirs
void list_subdirs(PathList pl, std::vector< FileName > &dirs)
Definition: gx_system.cpp:367
gx_system::CmdlineOptions::get_jack_output
Glib::ustring get_jack_output(unsigned int n) const
Definition: gx_system.cpp:846
TCLR2
#define TCLR2(s)
Definition: gx_system.cpp:432
engine.h
GxLogger::kError
@ kError
Definition: gx_logging.h:44
gx_system::SkinHandling::skin_list
std::vector< Glib::ustring > skin_list
Definition: gx_system.h:278
gx_system::Measure::ns2ms
float ns2ms(int n) const
Definition: gx_system.h:187
gx_system::FileName
Definition: gx_system.h:326
gx_system::PathList::add
void add(const std::string &d)
Definition: gx_system.h:297
gx_system::PathList::begin
iterator begin()
Definition: gx_system.h:301
gx_system::CmdlineOptions::preset_window_height
int preset_window_height
Definition: gx_system.h:445
gx_system::strip
void strip(Glib::ustring &s)
Definition: gx_system.cpp:984
gx_system::PathList::contains
bool contains(const std::string &d) const
Definition: gx_system.cpp:252
gx_system::PrefixConverter::replace_symbol
std::string replace_symbol(const std::string &dir) const
Definition: gx_system.cpp:287
gx_system::SkinHandling::index
unsigned int index(const Glib::ustring &name)
Definition: gx_system.cpp:204
gx_system::CmdlineOptions::process
void process(int argc, char **argv)
Definition: gx_system.cpp:884
GxLogger::MsgType
MsgType
Definition: gx_logging.h:39
gx_system::CmdlineOptions::system_animations
bool system_animations
Definition: gx_system.h:452
gx_system::gx_system_call
int gx_system_call(const std::string &, bool devnull=false, bool escape=false)
Definition: gx_system.cpp:962