Guitarix
gx_main.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  *
21  * This is gx_head main.
22  *
23  * ----------------------------------------------------------------------------
24  */
25 
26 #include "guitarix.h" // NOLINT
27 
28 #include <gtkmm/main.h> // NOLINT
29 #include <gxwmm/init.h> // NOLINT
30 #include <string> // NOLINT
31 #include "jsonrpc.h"
32 
33 #ifdef HAVE_AVAHI
34 #include "avahi_discover.h"
35 #endif
36 
37 
38 /****************************************************************
39  ** class PosixSignals
40  **
41  ** Block unix signals and catch them in a special thread.
42  ** Blocking is inherited by all threads created after an
43  ** instance of PosixSignals
44  */
45 
46 class PosixSignals {
47 private:
48  sigset_t waitset;
49  Glib::Thread *thread;
50  pthread_t pthr;
51  bool gui;
52  volatile bool exit;
53  void signal_helper_thread();
54  void quit_slot();
55  void gx_ladi_handler();
56  void create_thread();
57  bool gtk_level();
58  static void relay_sigchld(int);
59 public:
60  PosixSignals(bool gui);
61  ~PosixSignals();
62 };
63 
65  : waitset(),
66  thread(),
67  pthr(),
68  gui(gui_),
69  exit(false) {
71  sigemptyset(&waitset);
72  /* ----- block signal USR1 ---------
73  ** inherited by all threads which are created later
74  ** signals are processed synchronously by signal_helper_thread
75  */
76  sigaddset(&waitset, SIGUSR1);
77  sigaddset(&waitset, SIGCHLD);
78  sigaddset(&waitset, SIGINT);
79  sigaddset(&waitset, SIGQUIT);
80  sigaddset(&waitset, SIGTERM);
81  sigaddset(&waitset, SIGHUP);
82  sigaddset(&waitset, SIGKILL);
83 
84  // ----- leave alone these signals: generated by programming errors
85  // SIGABRT
86  // SIGSEGV
87 
88  sigprocmask(SIG_BLOCK, &waitset, NULL);
89  create_thread();
90  signal(SIGCHLD, relay_sigchld);
91 }
92 
94  if (thread) {
95  exit = true;
96  pthread_kill(pthr, SIGINT);
97  thread->join();
98  }
99  sigprocmask(SIG_UNBLOCK, &waitset, NULL);
100 }
101 
102 void PosixSignals::create_thread() {
103  try {
104  thread = Glib::Thread::create(
105  sigc::mem_fun(*this, &PosixSignals::signal_helper_thread), true);
106  } catch (Glib::ThreadError& e) {
107  throw GxFatalError(
108  boost::format(_("Thread create failed (signal): %1%")) % e.what());
109  }
110 }
111 
112 void PosixSignals::quit_slot() {
114 }
115 
116 void PosixSignals::gx_ladi_handler() {
118  _("signal_handler"), _("signal USR1 received, save settings"));
119  if (gx_preset::GxSettings::instance) {
120  bool cur_state = gx_preset::GxSettings::instance->get_auto_save_state();
121  gx_preset::GxSettings::instance->disable_autosave(false);
122  gx_preset::GxSettings::instance->auto_save_state();
123  gx_preset::GxSettings::instance->disable_autosave(cur_state);
124  }
125 }
126 
127 void PosixSignals::relay_sigchld(int) {
128  kill(getpid(), SIGCHLD);
129 }
130 
131 bool PosixSignals::gtk_level() {
132  if (! gui) {
133  return 1;
134  } else {
135  return Gtk::Main::level();
136  }
137 }
138 
139 // --- wait for USR1 signal to arrive and invoke ladi handler via mainloop
140 void PosixSignals::signal_helper_thread() {
141  pthr = pthread_self();
142  const char *signame;
143  guint source_id_usr1 = 0;
144  pthread_sigmask(SIG_BLOCK, &waitset, NULL);
145  bool seen = false;
146  while (true) {
147  int sig;
148  int ret = sigwait(&waitset, &sig);
149  if (exit) {
150  break;
151  }
152  if (ret != 0) {
153  assert(errno == EINTR);
154  continue;
155  }
156  switch (sig) {
157  case SIGUSR1:
158  if (gtk_level() < 1) {
159  gx_print_info(_("system startup"),
160  _("signal usr1 skipped"));
161  break;
162  }
163  // do not add a new call if another one is already pending
164  if (source_id_usr1 == 0 ||
165  g_main_context_find_source_by_id(NULL, source_id_usr1) == NULL) {
166  const Glib::RefPtr<Glib::IdleSource> idle_source = Glib::IdleSource::create();
167  idle_source->connect(
168  sigc::bind_return<bool>(
169  sigc::mem_fun(*this, &PosixSignals::gx_ladi_handler),false));
170  idle_source->attach();
171  source_id_usr1 = idle_source->get_id();
172  }
173  break;
174  case SIGCHLD:
175  Glib::signal_idle().connect_once(
176  sigc::ptr_fun(gx_child_process::gx_sigchld_handler));
177  break;
178  case SIGINT:
179  case SIGQUIT:
180  case SIGTERM:
181  case SIGHUP:
182  switch (sig) {
183  case SIGINT:
184  signame = _("ctrl-c");
185  break;
186  case SIGQUIT:
187  signame = "SIGQUIT";
188  break;
189  case SIGTERM:
190  signame = "SIGTERM";
191  break;
192  case SIGHUP:
193  signame = "SIGHUP";
194  break;
195  }
196  if (!seen && gtk_level() == 1) {
197  printf("\nquit (%s)\n", signame);
198  Glib::signal_idle().connect_once(sigc::mem_fun(*this, &PosixSignals::quit_slot));
199  } else {
201  (boost::format("\nQUIT (%1%)\n") % signame).str());
202  }
203  seen = true;
204  break;
205  default:
206  assert(false);
207  }
208  }
209 }
210 
211 
212 /****************************************************************
213  ** class ErrorPopup
214  ** show UI popup for kError messages
215  */
216 
217 class ErrorPopup {
218 private:
219  Glib::ustring msg;
220  bool active;
221  Gtk::MessageDialog *dialog;
222  void show_msg();
223  void on_response(int);
224 public:
225  ErrorPopup();
226  ~ErrorPopup();
227  void on_message(const Glib::ustring& msg, GxLogger::MsgType tp, bool plugged);
228 };
229 
231  : msg(),
232  active(false),
233  dialog(0) {
234 }
235 
237  delete dialog;
238 }
239 
240 void ErrorPopup::on_message(const Glib::ustring& msg_, GxLogger::MsgType tp, bool plugged) {
241  if (plugged) {
242  return;
243  }
244  if (tp == GxLogger::kError) {
245  if (active) {
246  msg += "\n" + msg_;
247  if (msg.size() > 1000) {
248  msg.substr(msg.size()-1000);
249  }
250  if (dialog) {
251  dialog->set_message(msg);
252  }
253  } else {
254  msg = msg_;
255  active = true;
256  show_msg();
257  }
258  }
259 }
260 
261 void ErrorPopup::on_response(int) {
262  delete dialog;
263  dialog = 0;
264  active = false;
265 }
266 
267 void ErrorPopup::show_msg() {
268  dialog = new Gtk::MessageDialog(msg, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE);
269  dialog->set_keep_above(true);
270  //Gtk::VBox *ma = dialog->get_message_area(); // not in Gtkmm 0.20
271  //FIXME: no comment :-)
272  Gtk::VBox *ma = dynamic_cast<Gtk::VBox*>(
273  *(++dynamic_cast<Gtk::HBox*>(
274  *dialog->get_vbox()->get_children().begin())->get_children().begin()));
275  // add an alignment parent to the label widget inside the message area
276  // should better define our own dialog instead of hacking MessageDialog...
277  Gtk::Alignment *align = new Gtk::Alignment();
278  align->show();
279  dynamic_cast<Gtk::Label*>(*ma->get_children().begin())->reparent(*align);
280  ma->pack_start(*manage(align));
281  align->set_padding(50,20,0,10);
282  Gtk::VBox *vbox = dynamic_cast<Gtk::VBox *>(dialog->get_child());
283  vbox->set_redraw_on_allocate(true);
284  g_signal_connect(GTK_WIDGET(vbox->gobj()), "expose-event",
285  G_CALLBACK(gx_cairo::error_box_expose), NULL);
286  // vbox->signal_expose_event().connect(
287  //sigc::group(&gx_cairo::error_box_expose,GTK_WIDGET(vbox->gobj()),sigc::_1,(void*)0),false);
288  dialog->set_title(_("GUITARIX ERROR"));
289  dialog->signal_response().connect(
290  sigc::mem_fun(*this, &ErrorPopup::on_response));
291  dialog->show();
292 }
293 
294 /****************************************************************
295  ** class GxSplashBox
296  ** show splash screen at start up
297  */
298 
299 class GxSplashBox: public Gtk::Window {
300  public:
301  explicit GxSplashBox();
302  ~GxSplashBox();
303  virtual void on_show();
304  virtual void on_message(const Glib::ustring& msg_, GxLogger::MsgType tp, bool plugged);
305 };
307 
309  : Gtk::Window(Gtk::WINDOW_POPUP) {
310  set_redraw_on_allocate(true);
311  set_app_paintable();
312  g_signal_connect(GTK_WIDGET(gobj()), "expose-event",
313  G_CALLBACK(gx_cairo::splash_expose), NULL);
314  //signal_expose_event().connect(
315  // sigc::group(&gx_cairo::splash_expose, GTK_WIDGET(gobj()),
316  // sigc::_1, (void*)0), false);
317  set_decorated(false);
318  set_type_hint(Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
319  set_position(Gtk::WIN_POS_CENTER );
320  set_default_size(613, 180);
321  show_all();
322 }
323 
324 void GxSplashBox::on_message(const Glib::ustring& msg_, GxLogger::MsgType tp, bool plugged) {
325  Gtk::Widget::hide();
326 }
327 
329  Gtk::Widget::on_show();
330  while(Gtk::Main::events_pending())
331  Gtk::Main::iteration(false);
332 }
333 
334 /****************************************************************
335  ** main()
336  */
337 #if 0
338 #ifndef NDEBUG
339 int debug_display_glade(gx_engine::GxEngine& engine, gx_system::CmdlineOptions& options,
340  gx_engine::ParamMap& pmap, const string& fname) {
341  pmap.set_init_values();
342  if (!options.get_rcset().empty()) {
343  std::string rcfile = options.get_style_filepath("gx_head_"+options.get_rcset()+".rc");
344  gtk_rc_parse(rcfile.c_str());
345  gtk_rc_reset_styles(gtk_settings_get_default());
346  }
347  Gtk::Window *w = 0;
348  gx_ui::GxUI ui;
349  Glib::RefPtr<gx_gui::GxBuilder> bld = gx_gui::GxBuilder::create_from_file(fname, &machine);
350  w = bld->get_first_window();
351  gx_ui::GxUI::updateAllGuis(true);
352  if (w) {
353  Gtk::Main::run(*w);
354  delete w;
355  }
356  return 0;
357 }
358 #endif
359 #endif
360 
361 #ifdef NDEBUG
362 // switch off GTK warnings in Release build
363 static void null_handler(const char *log_domain, GLogLevelFlags log_level,
364  const gchar *msg, gpointer user_data ) {
365  return ;
366 }
367 #endif
368 
369 static void mainHeadless(int argc, char *argv[]) {
370  Glib::init();
371  Gio::init();
372 
373  PosixSignals posixsig(false); // catch unix signals in special thread
375  options.parse(argc, argv);
376  options.process(argc, argv);
377  // ---------------- Check for working user directory -------------
378  bool need_new_preset;
379  if (gx_preset::GxSettings::check_settings_dir(options, &need_new_preset)) {
380  cerr <<
381  _("old config directory found (.gx_head)."
382  " state file and standard presets file have been copied to"
383  " the new directory (.config/guitarix).\n"
384  " Additional old preset files can be imported into the"
385  " new bank scheme by mouse drag and drop with a file"
386  " manager");
387  return;
388  }
389 
390  gx_engine::GxMachine machine(options);
391 
393  machine.loadstate();
394  //if (!in_session) {
395  // gx_settings.disable_autosave(options.get_opt_auto_save());
396  //}
397 
398  if (! machine.get_jack()->gx_jack_connection(true, true, 0, options)) {
399  cerr << "can't connect to jack\n";
400  return;
401  }
402  if (need_new_preset) {
403  machine.create_default_scratch_preset();
404  }
405  // ----------------------- Run Glib main loop ----------------------
406  cout << "Ctrl-C to quit\n";
407  Glib::RefPtr<Glib::MainLoop> loop = Glib::MainLoop::create();
408  machine.get_jack()->shutdown.connect(sigc::mem_fun(loop.operator->(),&Glib::MainLoop::quit));
409  int port = options.get_rpcport();
410  if (port == RPCPORT_DEFAULT) {
411  port = 7000;
412  }
413  machine.loadstate();
414  if (port != RPCPORT_NONE) {
415  machine.start_socket(sigc::mem_fun(loop.operator->(),&Glib::MainLoop::quit), options.get_rpcaddress(), port);
416  loop->run();
417  } else {
418  loop->run();
419  }
421 }
422 
423 static void exception_handler() {
424  try {
425  throw; // re-throw current exception
426  } catch (const GxFatalError& error) {
427  cerr << error.what() << endl;
428  gx_print_fatal(_("Guitarix fatal error"), error.what());
429  } catch (const Glib::OptionError &error) {
430  cerr << error.what() << endl;
431  cerr << _("use \"guitarix -h\" to get a help text") << endl;
432  gx_print_fatal(_("Guitarix Commandline Option Error"),
433  Glib::ustring::compose(
434  "%1\n%2",
435  error.what(),
436  _("use \"guitarix -h\" to get a help text")));
437  } catch (const Glib::Error& error) {
438  const GError *perr = error.gobj();
439  Glib::ustring msg = Glib::ustring::compose(
440  "Glib::Error[%1/%2]: %3",
441  g_quark_to_string(perr->domain),
442  perr->code,
443  (perr->message) ? perr->message : "(null)");
444  cerr << msg << endl;
445  gx_print_fatal(_("Guitarix fatal error"), msg);
446  } catch (const std::exception& except) {
447  Glib::ustring msg = Glib::ustring::compose(
448  "std::exception: %1", except.what());
449  cerr << msg << endl;
450  gx_print_fatal(_("Guitarix fatal error"), msg);
451  } catch(...) {
452  cerr << _("unknown error") << endl;
453  gx_print_fatal(_("Guitarix fatal error"),_("unknown error"));
454  }
455 }
456 
457 static void mainGtk(int argc, char *argv[]) {
458  Glib::init();
459  Gxw::init();
460 
461  PosixSignals posixsig(true); // catch unix signals in special thread
462  Glib::add_exception_handler(sigc::ptr_fun(exception_handler));
464  Gtk::Main main(argc, argv, options);
465  options.process(argc, argv);
466  GxSplashBox * Splash = NULL;
467 #ifdef NDEBUG
468  Splash = new GxSplashBox();
470  sigc::mem_fun(Splash, &GxSplashBox::on_message));
471  g_log_set_handler("Gtk",G_LOG_LEVEL_WARNING,null_handler,NULL);
472 #endif
473  GxExit::get_instance().signal_msg().connect(
474  sigc::ptr_fun(gx_gui::show_error_msg)); // show fatal errors in UI
475  ErrorPopup popup;
477  sigc::mem_fun(popup, &ErrorPopup::on_message));
478  // ---------------- Check for working user directory -------------
479  bool need_new_preset;
480  if (gx_preset::GxSettings::check_settings_dir(options, &need_new_preset)) {
481  Gtk::MessageDialog dialog(
482  _("old config directory found (.gx_head)."
483  " state file and standard presets file have been copied to"
484  " the new directory (.config/guitarix).\n"
485  " Additional old preset files can be imported into the"
486  " new bank scheme by mouse drag and drop with a file"
487  " manager"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE, true);
488  dialog.set_title("Guitarix");
489  dialog.run();
490  }
491 
492  gx_engine::GxMachine machine(options);
493 #if 0
494 #ifndef NDEBUG
495  if (argc > 1) {
496  delete Splash;
497  debug_display_glade(engine, options, gx_engine::parameter_map, argv[1]);
498  return;
499  }
500 #endif
501 #endif
502  // ----------------------- init GTK interface----------------------
503  MainWindow gui(machine, options, Splash, "");
504  if (need_new_preset) {
505  gui.create_default_scratch_preset();
506  }
507  machine.loadstate();
508  // ----------------------- run GTK main loop ----------------------
509  delete Splash;
510  gui.run();
512 }
513 
514 static void mainFront(int argc, char *argv[]) {
515  Glib::init();
516  Gxw::init();
517 
518  PosixSignals posixsig(true); // catch unix signals in special thread
519  Glib::add_exception_handler(sigc::ptr_fun(exception_handler));
521  Gtk::Main main(argc, argv, options);
522  options.process(argc, argv);
523  GxSplashBox * Splash = NULL;
524 #ifdef NDEBUG
525  Splash = new GxSplashBox();
526  g_log_set_handler("Gtk",G_LOG_LEVEL_WARNING,null_handler,NULL);
527 #endif
528  GxExit::get_instance().signal_msg().connect(
529  sigc::ptr_fun(gx_gui::show_error_msg)); // show fatal errors in UI
530  ErrorPopup popup;
532  sigc::mem_fun(popup, &ErrorPopup::on_message));
533  // ---------------- Check for working user directory -------------
534  bool need_new_preset;
535  if (gx_preset::GxSettings::check_settings_dir(options, &need_new_preset)) {
536  Gtk::MessageDialog dialog(
537  _("old config directory found (.gx_head)."
538  " state file and standard presets file have been copied to"
539  " the new directory (.config/guitarix).\n"
540  " Additional old preset files can be imported into the"
541  " new bank scheme by mouse drag and drop with a file"
542  " manager"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE, true);
543  dialog.set_title("Guitarix");
544  dialog.run();
545  }
546 
547  Glib::ustring title;
548 #ifdef HAVE_AVAHI
549  if (options.get_rpcaddress().empty() && options.get_rpcport() == RPCPORT_DEFAULT) {
550  SelectInstance si(options, Splash);
551  if (Splash) {
552  Splash->show();
553  }
554  Glib::ustring a;
555  int port;
556  Glib::ustring name;
557  Glib::ustring host;
558  if (!si.get_address_port(a, port, name, host)) {
559  cerr << "Failed to get address" << endl;
560  return;
561  }
562  options.set_rpcaddress(a);
563  options.set_rpcport(port);
564  title = Glib::ustring::compose("%1 / %2:%3", name, host, port);
565  }
566 #endif // HAVE_AVAHI
567  if (options.get_rpcport() == RPCPORT_DEFAULT) {
568  options.set_rpcport(7000);
569  }
570  if (options.get_rpcaddress().empty()) {
571  options.set_rpcaddress("localhost");
572  }
573  if (title.empty()) {
574  title = Glib::ustring::compose("%1:%2", options.get_rpcaddress(), options.get_rpcport());
575  }
576  gx_engine::GxMachineRemote machine(options);
577 
578  // ----------------------- init GTK interface----------------------
579  MainWindow gui(machine, options, Splash, title);
580  if (need_new_preset) {
581  gui.create_default_scratch_preset();
582  }
583  // ----------------------- run GTK main loop ----------------------
584  delete Splash;
585  machine.set_init_values();
586  gui.run();
587 }
588 
589 static bool is_headless(int argc, char *argv[]) {
590  for (int i = 0; i < argc; ++i) {
591  if (strcmp(argv[i], "-N") == 0 || strcmp(argv[i], "--nogui") == 0) {
592  return true;
593  }
594  }
595  return false;
596 }
597 
598 static bool is_frontend(int argc, char *argv[]) {
599  for (int i = 0; i < argc; ++i) {
600  if (strcmp(argv[i], "-G") == 0 || strcmp(argv[i], "--onlygui") == 0) {
601  return true;
602  }
603  }
604  return false;
605 }
606 
607 int main(int argc, char *argv[]) {
608 #ifdef DISABLE_NLS
609 // break
610 #elif defined(IS_MACOSX)
611 // break
612 #elif ENABLE_NLS
613  bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
614  bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
615  textdomain(GETTEXT_PACKAGE);
616 #endif
617 
618  try {
619  // ----------------------- init basic subsystems ----------------------
620 #ifndef G_DISABLE_DEPRECATED
621  if (!g_thread_supported ()) {
622  Glib::thread_init();
623  }
624 #endif
625  if (is_headless(argc, argv)) {
626  mainHeadless(argc, argv);
627  } else if (is_frontend(argc, argv)) {
628  mainFront(argc, argv);
629  } else {
630  mainGtk(argc, argv);
631  }
632  } catch (...) {
633  exception_handler();
634  }
635  return 0;
636 }
gx_print_fatal
void gx_print_fatal(const char *, const std::string &)
Definition: gx_logging.cpp:177
GxExit::get_instance
static GxExit & get_instance()
Definition: gx_logging.cpp:205
gx_preset::GxSettings::auto_save_state
void auto_save_state()
Definition: gx_preset.cpp:907
cabinet_impulse_former::init
void init(int samplingFreq)
Definition: cabinet_impulse_former.cc:37
gx_cairo::error_box_expose
gboolean error_box_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
Definition: gx_cairo_callbacks.cpp:199
gx_print_info
void gx_print_info(const char *, const std::string &)
Definition: gx_logging.cpp:183
gx_system::CmdlineOptions::get_idle_thread_timeout
int get_idle_thread_timeout() const
Definition: gx_system.h:509
gx_child_process::childprocs
GxChildProcs childprocs
Definition: gx_child_process.cpp:162
GxSplashBox::on_show
virtual void on_show()
Definition: gx_main.cpp:328
gx_engine::GxMachine
Definition: machine.h:230
avahi_discover.h
gx_cairo::splash_expose
gboolean splash_expose(GtkWidget *wi, GdkEventExpose *ev, gpointer user_data)
Definition: gx_cairo_callbacks.cpp:80
gx_jack::GxJack::rt_watchdog_set_limit
static void rt_watchdog_set_limit(int limit)
Definition: gx_jack.cpp:147
GxSplashBox::~GxSplashBox
~GxSplashBox()
Definition: gx_main.cpp:306
GxLogger::signal_message
msg_signal & signal_message()
Definition: gx_logging.cpp:77
gx_engine::GxMachineRemote
Definition: machine.h:391
gx_print_warning
void gx_print_warning(const char *, const std::string &)
Definition: gx_logging.cpp:161
gx_system::CmdlineOptions::get_rpcport
int get_rpcport() const
Definition: gx_system.h:493
RPCPORT_DEFAULT
#define RPCPORT_DEFAULT
Definition: gx_system.h:350
ErrorPopup::on_message
void on_message(const Glib::ustring &msg, GxLogger::MsgType tp, bool plugged)
Definition: gx_main.cpp:240
main
int main(int argc, char *argv[])
Definition: gx_main.cpp:607
GxExit::set_ui_thread
void set_ui_thread()
Definition: gx_logging.h:117
GxExit::signal_msg
sigc::signal< void, std::string > & signal_msg()
Definition: gx_logging.h:119
jsonrpc.h
gx_preset::GxSettings::disable_autosave
void disable_autosave(bool v)
Definition: gx_preset.h:179
gx_preset::GxSettings::check_settings_dir
static bool check_settings_dir(gx_system::CmdlineOptions &opt, bool *need_new_preset)
Definition: gx_preset.cpp:1112
GxExit::exit_program
void exit_program(std::string msg="", int errcode=1)
Definition: gx_logging.cpp:196
gx_system::CmdlineOptions::get_style_filepath
std::string get_style_filepath(const std::string &basename) const
Definition: gx_system.h:463
RPCPORT_NONE
#define RPCPORT_NONE
Definition: gx_system.h:351
GxSplashBox::GxSplashBox
GxSplashBox()
Definition: gx_main.cpp:308
gx_system::CmdlineOptions::get_rpcaddress
const Glib::ustring & get_rpcaddress()
Definition: gx_system.h:495
GxSplashBox
Definition: gx_main.cpp:299
GxSplashBox::on_message
virtual void on_message(const Glib::ustring &msg_, GxLogger::MsgType tp, bool plugged)
Definition: gx_main.cpp:324
PosixSignals
Definition: gx_main.cpp:46
PosixSignals::~PosixSignals
~PosixSignals()
Definition: gx_main.cpp:93
PosixSignals::PosixSignals
PosixSignals(bool gui)
Definition: gx_main.cpp:64
gx_engine::ParamMap::set_init_values
void set_init_values()
Definition: gx_paramtable.cpp:2086
gx_system::CmdlineOptions::set_rpcport
void set_rpcport(int port)
Definition: gx_system.h:494
ErrorPopup
Definition: gx_main.cpp:217
gx_system::CmdlineOptions::set_rpcaddress
void set_rpcaddress(const Glib::ustring &address)
Definition: gx_system.h:496
gx_preset::GxSettings::get_auto_save_state
bool get_auto_save_state()
Definition: gx_preset.h:178
gx_engine::ParamMap
Definition: gx_parameter.h:515
GxFatalError::what
virtual const char * what() const
Definition: gx_logging.h:94
gx_system::CmdlineOptions
Definition: gx_system.h:381
GxFatalError
Definition: gx_logging.h:90
SelectInstance
Definition: avahi_discover.h:81
gx_child_process::gx_sigchld_handler
void gx_sigchld_handler()
Definition: gx_child_process.cpp:92
GxLogger::get_logger
static GxLogger & get_logger()
Definition: gx_logging.cpp:50
gx_engine::GxEngine
Definition: gx_engine.h:69
GxLogger::kError
@ kError
Definition: gx_logging.h:44
gx_gui::show_error_msg
void show_error_msg(const string &msg)
gx_system::CmdlineOptions::get_rcset
const Glib::ustring & get_rcset() const
Definition: gx_system.h:484
MainWindow
Definition: gx_main_window.h:585
gx_child_process::GxChildProcs::killall
bool killall()
Definition: gx_child_process.cpp:56
guitarix.h
gx_system::CmdlineOptions::process
void process(int argc, char **argv)
Definition: gx_system.cpp:884
GxLogger::MsgType
MsgType
Definition: gx_logging.h:39
ErrorPopup::~ErrorPopup
~ErrorPopup()
Definition: gx_main.cpp:236
ErrorPopup::ErrorPopup
ErrorPopup()
Definition: gx_main.cpp:230