Guitarix
gx_system.h
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 the System namespace ------- */
22
23#pragma once
24
25#ifndef SRC_HEADERS_GX_SYSTEM_H_
26#define SRC_HEADERS_GX_SYSTEM_H_
27
28#ifndef NDEBUG
29#include <fenv.h>
30
31#ifdef __i386__
32#define FE_DENORM __FE_DENORM
33inline void clear_fpu_status_bits() { __asm__ ("fnclex"); }
34inline unsigned int get_fpu_status_bits() {
35 unsigned int fpu_status __attribute__ ((__mode__ (__HI__)));
36 __asm__("fnstsw %0" : "=m" (*&fpu_status));
37 return fpu_status;
38}
39#else
40inline void clear_fpu_status_bits() { feclearexcept(FE_ALL_EXCEPT); }
41inline unsigned int get_fpu_status_bits() {
42 fexcept_t flagp;
43 int ret = fegetexceptflag(&flagp, FE_ALL_EXCEPT);
44 assert(ret == 0);
45 return flagp;
46}
47#endif //__i386__
48#endif // !NDEBUG
49#ifdef __SSE__
50
51/* On Intel set FZ (Flush to Zero) and DAZ (Denormals Are Zero)
52 flags to avoid costly denormals */
53#ifdef __SSE3__
54#ifndef _PMMINTRIN_H_INCLUDED
55#include <pmmintrin.h>
56#endif //ndef
57inline void AVOIDDENORMALS() {
58 _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
59 _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
60}
61#else
62#ifndef _XMMINTRIN_H_INCLUDED
63#include <xmmintrin.h>
64#endif //ndef
65inline void AVOIDDENORMALS() { _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); }
66#endif //__SSE3__
67
68#else
69#ifndef _XMMINTRIN_H_INCLUDED
70inline void _MM_SET_EXCEPTION_STATE(unsigned int __mask) {}
71inline unsigned int _MM_GET_EXCEPTION_STATE(void) { return 0; }
72#endif //ndef
73inline void AVOIDDENORMALS() {}
74
75#endif //__SSE__
76
77
78/* constant defines */
79#define ASCII_START (48)
80#define GDK_NO_MOD_MASK (GdkModifierType)0
81#define SYSTEM_OK (0)
82
83
84namespace gx_system {
85
86/****************************************************************
87 ** "atomic" value access
88 */
89
90inline void atomic_set(volatile int* p, int v) {
91 g_atomic_int_set(p, v);
92}
93
94inline void atomic_set(volatile unsigned int* p, unsigned int v) {
95 g_atomic_int_set(reinterpret_cast<volatile int*>(p), v);
96}
97
98inline int atomic_get(volatile int& p) {
99 return g_atomic_int_get(&p);
100}
101
102inline unsigned int atomic_get(volatile unsigned int& p) {
103 return g_atomic_int_get(reinterpret_cast<volatile int*>(&p));
104}
105
106inline void atomic_inc(volatile int* p) {
107 g_atomic_int_inc(p);
108}
109
110inline void atomic_inc(volatile unsigned int* p) {
111 g_atomic_int_inc(reinterpret_cast<volatile int*>(p));
112}
113
114inline bool atomic_compare_and_exchange(volatile int *p, int oldv, int newv) {
115#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 68 && GLIB_MICRO_VERSION < 1)
116 return g_atomic_int_compare_and_exchange(p, oldv, newv);
117#else
118 return g_atomic_int_compare_and_exchange(const_cast<int*>(p), oldv, newv);
119#endif
120}
121
122template <class T>
123inline void atomic_set(T **p, T *v) {
124 g_atomic_pointer_set(p, v);
125}
126
127template <class T>
128inline void atomic_set_0(T **p) {
129 g_atomic_pointer_set(p, 0);
130}
131
132template <class T>
133inline T *atomic_get(T*& p) {
134 return static_cast<T*>(g_atomic_pointer_get(&p));
135}
136
137template <class T>
138inline bool atomic_compare_and_exchange(T **p, T *oldv, T *newv) {
139 return g_atomic_pointer_compare_and_exchange(reinterpret_cast<void**>(p), static_cast<void*>(oldv), newv);
140}
141
142
143/****************************************************************
144 ** Measuring times
145 */
146
147#ifndef NDEBUG
148
149class Accum {
150 private:
151 int n;
152 int mn;
153 int mx;
154 float sx;
155 float sx2;
156 public:
157 Accum() { reset(); }
158 inline void reset() {
159 n = 0;
160 mn = 1e9;
161 mx = 0;
162 sx = 0;
163 sx2 = 0;
164 }
165 void add(int diff);
166 int count() const { return n; }
167 float mean() const { return sx / n; }
168 float stddev() const { return std::sqrt((n * sx2 - sx * sx) / (n * (n-1))); }
169 float minimum() const { return mn; }
170 float maximum() const { return mx; }
171};
172
173inline void Accum::add(int diff) {
174 n += 1;
175 sx += diff;
176 sx2 += static_cast<float>(diff) * diff;
177 mn = std::min(mn, diff);
178 mx = std::max(mx, diff);
179}
180
181
182struct Measure {
187 unsigned int FPUStatus1;
188 unsigned int MXStatus1;
189 unsigned int FPUStatus2;
190 unsigned int MXStatus2;
191 inline float ns2ms(int n) const { return n * 1e-6; }
192 void reset();
193 Measure() { reset(); }
194 void print_accum(const Accum& accum, const char* prefix, bool verbose, int total = 0) const;
195 void print(bool verbose) const;
196};
197
199 private:
202 timespec t1s;
203 timespec t1e;
204 timespec t2s;
205 timespec t1old;
206 unsigned int FPUStatus;
207 unsigned int MXStatus;
208 inline Measure *access() { return atomic_get(pmeasure); }
209 inline int ts_diff(const timespec& ts1, const timespec& ts2);
210 public:
212 inline void start() {
215 clock_gettime(CLOCK_MONOTONIC, &t1s);
216 }
217 inline void pause() {
218 clock_gettime(CLOCK_MONOTONIC, &t1e);
221 }
222 inline void cont() {
225 clock_gettime(CLOCK_MONOTONIC, &t2s);
226 }
227 inline void stop();
228 void print(bool verbose = false);
229};
230
231/* return time difference in ns, fail if > sec (doesn't fit int 32 bit int) */
232inline int MeasureThreadsafe::ts_diff(const timespec& ts1, const timespec& ts2) {
233 time_t df = ts1.tv_sec - ts2.tv_sec;
234 if (std::abs(df) > 2) {
235 return -1; // failed
236 }
237 return df * 1000000000 + (ts1.tv_nsec - ts2.tv_nsec);
238}
239
240
242 Measure& m = *access();
243 timespec n;
244 clock_gettime(CLOCK_MONOTONIC, &n);
249 if (!(t1old.tv_sec == 0 && t1old.tv_nsec == 0)) {
251 }
252 t1old = t1s;
255 m.duration.add(ts_diff(n, t1s));
256}
257
259
261
262inline void measure_start() { measure.start(); }
263inline void measure_pause() { measure.pause(); }
264inline void measure_cont() { measure.cont(); }
265inline void measure_stop() { measure.stop(); }
266
267#else
268
269inline void measure_start() {}
270inline void measure_pause() {}
271inline void measure_cont() {}
272inline void measure_stop() {}
273
274#endif
275
276/****************************************************************/
277
279public:
280 Glib::ustring name;
281 std::vector<Glib::ustring> skin_list;
282 SkinHandling(const std::string& styledir)
283 : name(), skin_list() { set_styledir(styledir); }
284 void set_styledir(const std::string& styledir);
285 bool is_in_list(const std::string& skin_name);
286 const Glib::ustring& operator[](unsigned int idx);
287 unsigned int index(const Glib::ustring& skin_name);
288 string get_cssfile() const;
290};
291
292/****************************************************************/
293
294class PathList {
295public:
296 typedef std::list< Glib::RefPtr<Gio::File> > pathlist;
297 typedef std::list< Glib::RefPtr<Gio::File> >::const_iterator iterator;
298private:
300public:
301 PathList(const char *env_name = 0);
302 void add(const std::string& d) { dirs.push_back(Gio::File::create_for_path(d)); }
303 bool contains(const std::string& d) const;
304 bool find_dir(std::string *d, const std::string& filename) const;
305 size_t size() { return dirs.size(); }
306 iterator begin() { return dirs.begin(); }
307 iterator end() { return dirs.end(); }
308};
309
310
311/****************************************************************/
312
314public:
315 typedef std::map<char,std::string> symbol_path_map;
316private:
318public:
321 std::string replace_symbol(const std::string& dir) const;
322 std::string replace_path(const std::string& dir) const;
323 void add(char s, const std::string& d);
324};
325
326
327/*****************************************************************
328 ** class DirectoryListing
329 */
330
331class FileName {
332public:
333 std::string filename;
334 Glib::ustring displayname;
335 FileName(const std::string& filename_, const Glib::ustring& displayname_)
336 : filename(filename_), displayname(displayname_) {}
337};
338
340public:
341private:
342 std::vector<FileName> listing;
343public:
344 IRFileListing(const std::string& path);
346 std::vector<FileName>& get_listing() { return listing; }
347};
348
349void list_subdirs(PathList pl, std::vector<FileName>& dirs);
350
351/****************************************************************
352 ** class CmdlineOptions
353 */
354
355#define RPCPORT_DEFAULT (-2)
356#define RPCPORT_NONE (-1)
357
358class BasicOptions: boost::noncopyable {
359private:
360 std::string user_dir;
361 std::string user_IR_dir;
362 std::string sys_IR_dir;
366protected:
367 std::string builder_dir;
368
369private:
370 friend BasicOptions& get_options();
371protected:
372 static void make_ending_slash(std::string& dirpath);
373public:
376 std::string get_user_filepath(const std::string& basename) const { return user_dir + basename; }
377 std::string get_user_ir_filepath(const std::string& basename) const { return user_IR_dir + basename; }
378 std::string get_builder_filepath(const std::string& basename) const { return builder_dir + basename; }
379 void set_user_dir(std::string dir) { user_dir = dir; }
380 void set_user_IR_dir(std::string dir) { user_IR_dir = dir; }
381 const std::string& get_user_dir() const { return user_dir; }
382 const std::string& get_user_IR_dir() const { return user_IR_dir; }
383 const std::string& get_sys_IR_dir() const { return sys_IR_dir; }
384 const PathList& get_IR_pathlist() const { return IR_pathlist; }
386};
387
388class CmdlineOptions: public BasicOptions, public Glib::OptionContext {
389private:
390 Glib::OptionGroup main_group;
391 Glib::OptionGroup optgroup_style;
392 Glib::OptionGroup optgroup_jack;
393 Glib::OptionGroup optgroup_overload;
394 Glib::OptionGroup optgroup_file;
395 Glib::OptionGroup optgroup_debug;
396 std::string path_to_program;
398 bool clear;
399 Glib::ustring jack_input;
400 Glib::ustring jack_midi;
401 Glib::ustring jack_instance;
402 std::vector<Glib::ustring> jack_outputs;
403 Glib::ustring jack_uuid;
404 Glib::ustring jack_uuid2;
407 Glib::ustring jack_servername;
408 std::string load_file;
409 std::string style_dir;
410 std::string factory_dir;
411 std::string pixmap_dir;
412 std::string old_user_dir;
413 std::string preset_dir;
414 std::string pluginpreset_dir;
415 std::string lv2_preset_dir;
416 std::string temp_dir;
417 std::string plugin_dir;
418 std::string loop_dir;
419 Glib::ustring rcset;
420 bool nogui;
422 Glib::ustring rpcaddress;
426 bool mute;
427 Glib::ustring setbank;
428 Glib::ustring cmdline_bank;
429 Glib::ustring cmdline_preset;
430 Glib::ustring tuner_tet;
431 Glib::ustring tuner_ref;
438 bool a_save;
440 std::string get_opskin();
441
442public:
443#ifndef NDEBUG
445#endif
447
450 // saved in ui_rc:
469
470public:
473 void process(int argc, char** argv);
474 const std::string& get_path_to_program() const { return path_to_program; }
475 std::string get_style_filepath(const std::string& basename) const { return style_dir + basename; }
477 std::string get_pixmap_filepath(const std::string& basename) const { return pixmap_dir + basename; }
478 std::string get_preset_filepath(const std::string& basename) const { return preset_dir + basename; }
479 std::string get_plugin_filepath(const std::string& basename) const { return plugin_dir + basename; }
480 std::string get_factory_filepath(const std::string& basename) const { return factory_dir + basename; }
481 std::string get_temp_filepath(const std::string& basename) const { return temp_dir + basename; }
482 std::string get_pluginpreset_filepath(const std::string& id, bool factory) const {
483 return (factory ? factory_dir : pluginpreset_dir) + id; }
484 std::string get_lv2_preset_filepath(const std::string& id) const {
485 return (lv2_preset_dir) + id; }
486 const std::string& get_old_user_dir() const { return old_user_dir; }
487 const std::string& get_plugin_dir() const { return plugin_dir; }
488 const std::string& get_preset_dir() const { return preset_dir; }
489 const std::string& get_pluginpreset_dir() const { return pluginpreset_dir; }
490 const std::string& get_lv2_preset_dir() const { return lv2_preset_dir; }
491 const std::string& get_loop_dir() const { return loop_dir; }
492 const std::string& get_temp_dir() const { return temp_dir; }
493
494 void set_plugin_dir(std::string dir) { plugin_dir = dir; }
495 void set_preset_dir(std::string dir) { preset_dir = dir; }
496 void set_pluginpreset_dir(std::string dir) { pluginpreset_dir = dir; }
497 void set_lv2_preset_dir(std::string dir) { lv2_preset_dir = dir; }
498 void set_loop_dir(std::string dir) { loop_dir = dir; }
499 void set_temp_dir(std::string dir) { temp_dir = dir; }
500
501 const std::string& get_factory_dir() const { return factory_dir; }
502 const std::string& get_style_dir() const { return style_dir; }
503 std::string get_ladspa_config_filename() const { return get_user_filepath("ladspa_defs.js"); }
504 std::string get_online_config_filename() const { return get_user_filepath("musical-artifacts.js"); }
505 std::string get_online_presets_filename() const { return get_user_filepath("artifacts.js"); }
506 const Glib::ustring& get_rcset() const { return rcset; }
507 bool get_clear_rc() const { return clear; }
508 bool get_nogui() const { return nogui; }
509 bool get_liveplaygui() const { return liveplaygui; }
510 bool get_hideonquit() const { return hideonquit; }
511 void set_hideonquit(bool set) { hideonquit = set; }
512 bool get_mute() const { return mute; }
513 const Glib::ustring& get_setbank() { return setbank; }
514 void set_bank_preset(const Glib::ustring& bank, const Glib::ustring& preset) {
515 cmdline_bank = bank; cmdline_preset = preset; }
516 const Glib::ustring& get_cmdline_bank() { return cmdline_bank; }
517 const Glib::ustring& get_cmdline_preset() { return cmdline_preset; }
518 const Glib::ustring& get_tuner_tet() { return tuner_tet; }
519 const Glib::ustring& get_tuner_ref() { return tuner_ref; }
520 int get_rpcport() const { return rpcport; }
521 void set_rpcport(int port) { rpcport = port; }
522 const Glib::ustring& get_rpcaddress() { return rpcaddress; }
523 void set_rpcaddress(const Glib::ustring& address) { rpcaddress = address; }
524 const std::string& get_loadfile() const { return load_file; }
525 const Glib::ustring& get_jack_instancename() const { return jack_instance; }
526 void set_jack_instancename(std::string name) { jack_instance = name; }
527 const Glib::ustring& get_jack_uuid() const { return jack_uuid; }
528 const Glib::ustring& get_jack_uuid2() const { return jack_uuid2; }
529 const Glib::ustring& get_jack_midi() const { return jack_midi; }
530 const Glib::ustring& get_jack_input() const { return jack_input; }
531 const Glib::ustring& get_jack_servername() const { return jack_servername; }
532 bool get_jack_noconnect() const { return jack_noconnect; }
533 bool get_jack_single() const { return jack_single; }
534 void set_jack_noconnect(bool set) { jack_noconnect = set; }
535 void set_jack_single(bool set) { jack_single = set; }
536 bool get_opt_save_on_exit() const { return a_save; }
537 bool get_opt_autosave() const { return auto_save; }
538 void set_opt_autosave(bool set) { auto_save = set; }
539 Glib::ustring get_jack_output(unsigned int n) const;
542 bool get_xrun_watchdog() const { return xrun_watchdog; }
544 bool get_watchdog_warning() const { return watchdog_warning; }
545};
546
550}
551
552
553/****************************************************************
554 ** misc function declarations
555 */
556
557int gx_system_call(const std::string&, bool devnull = false, bool escape = false);
558void strip(Glib::ustring& s);
559
560template <class T>
561inline std::string to_string(const T& t) {
562 std::stringstream ss;
563 ss << t;
564 return ss.str();
565}
566
567std::string encode_filename(const std::string& s);
568std::string decode_filename(const std::string& s);
569
570} /* end of gx_system namespace */
571
572#endif // SRC_HEADERS_GX_SYSTEM_H_
int count() const
Definition: gx_system.h:166
float minimum() const
Definition: gx_system.h:169
float stddev() const
Definition: gx_system.h:168
void add(int diff)
Definition: gx_system.h:173
float maximum() const
Definition: gx_system.h:170
float mean() const
Definition: gx_system.h:167
PrefixConverter IR_prefixmap
Definition: gx_system.h:364
std::string get_builder_filepath(const std::string &basename) const
Definition: gx_system.h:378
static void make_ending_slash(std::string &dirpath)
void set_user_dir(std::string dir)
Definition: gx_system.h:379
const PathList & get_IR_pathlist() const
Definition: gx_system.h:384
const std::string & get_user_IR_dir() const
Definition: gx_system.h:382
static BasicOptions * instance
Definition: gx_system.h:365
const std::string & get_user_dir() const
Definition: gx_system.h:381
std::string get_user_ir_filepath(const std::string &basename) const
Definition: gx_system.h:377
const PrefixConverter & get_IR_prefixmap() const
Definition: gx_system.h:385
std::string get_user_filepath(const std::string &basename) const
Definition: gx_system.h:376
std::string builder_dir
Definition: gx_system.h:367
std::string sys_IR_dir
Definition: gx_system.h:362
void set_user_IR_dir(std::string dir)
Definition: gx_system.h:380
std::string user_IR_dir
Definition: gx_system.h:361
std::string user_dir
Definition: gx_system.h:360
friend BasicOptions & get_options()
Definition: gx_system.h:547
const std::string & get_sys_IR_dir() const
Definition: gx_system.h:383
std::string path_to_program
Definition: gx_system.h:396
const Glib::ustring & get_setbank()
Definition: gx_system.h:513
Glib::ustring tuner_ref
Definition: gx_system.h:431
const Glib::ustring & get_rcset() const
Definition: gx_system.h:506
void set_preset_dir(std::string dir)
Definition: gx_system.h:495
Glib::ustring rpcaddress
Definition: gx_system.h:422
const std::string & get_plugin_dir() const
Definition: gx_system.h:487
Glib::ustring jack_servername
Definition: gx_system.h:407
void set_opt_autosave(bool set)
Definition: gx_system.h:538
std::string get_online_config_filename() const
Definition: gx_system.h:504
Glib::ustring jack_midi
Definition: gx_system.h:400
void set_jack_instancename(std::string name)
Definition: gx_system.h:526
bool get_opt_save_on_exit() const
Definition: gx_system.h:536
Glib::OptionGroup optgroup_jack
Definition: gx_system.h:392
std::string get_temp_filepath(const std::string &basename) const
Definition: gx_system.h:481
const Glib::ustring & get_tuner_tet()
Definition: gx_system.h:518
std::string get_lv2_preset_filepath(const std::string &id) const
Definition: gx_system.h:484
std::string get_plugin_filepath(const std::string &basename) const
Definition: gx_system.h:479
bool get_watchdog_warning() const
Definition: gx_system.h:544
const std::string & get_lv2_preset_dir() const
Definition: gx_system.h:490
Glib::OptionGroup optgroup_file
Definition: gx_system.h:394
std::string old_user_dir
Definition: gx_system.h:412
bool get_clear_rc() const
Definition: gx_system.h:507
std::vector< Glib::ustring > jack_outputs
Definition: gx_system.h:402
Glib::OptionGroup optgroup_overload
Definition: gx_system.h:393
const Glib::ustring & get_jack_input() const
Definition: gx_system.h:530
std::string get_pluginpreset_filepath(const std::string &id, bool factory) const
Definition: gx_system.h:482
void set_pluginpreset_dir(std::string dir)
Definition: gx_system.h:496
std::string get_ladspa_config_filename() const
Definition: gx_system.h:503
const Glib::ustring & get_cmdline_preset()
Definition: gx_system.h:517
Glib::OptionGroup optgroup_debug
Definition: gx_system.h:395
const Glib::ustring & get_jack_instancename() const
Definition: gx_system.h:525
int get_sporadic_overload() const
Definition: gx_system.h:541
std::string get_preset_filepath(const std::string &basename) const
Definition: gx_system.h:478
bool get_liveplaygui() const
Definition: gx_system.h:509
const Glib::ustring & get_tuner_ref()
Definition: gx_system.h:519
Glib::OptionGroup main_group
Definition: gx_system.h:390
bool get_hideonquit() const
Definition: gx_system.h:510
const std::string & get_loop_dir() const
Definition: gx_system.h:491
Glib::ustring jack_input
Definition: gx_system.h:399
void set_bank_preset(const Glib::ustring &bank, const Glib::ustring &preset)
Definition: gx_system.h:514
const std::string & get_temp_dir() const
Definition: gx_system.h:492
void set_rpcport(int port)
Definition: gx_system.h:521
const Glib::ustring & get_jack_uuid() const
Definition: gx_system.h:527
void set_lv2_preset_dir(std::string dir)
Definition: gx_system.h:497
void set_hideonquit(bool set)
Definition: gx_system.h:511
Glib::OptionGroup optgroup_style
Definition: gx_system.h:391
const std::string & get_preset_dir() const
Definition: gx_system.h:488
void set_plugin_dir(std::string dir)
Definition: gx_system.h:494
const Glib::ustring & get_cmdline_bank()
Definition: gx_system.h:516
Glib::ustring cmdline_preset
Definition: gx_system.h:429
bool get_opt_autosave() const
Definition: gx_system.h:537
Glib::ustring get_jack_output(unsigned int n) const
const std::string & get_factory_dir() const
Definition: gx_system.h:501
void set_temp_dir(std::string dir)
Definition: gx_system.h:499
bool get_nogui() const
Definition: gx_system.h:508
bool get_xrun_watchdog() const
Definition: gx_system.h:542
const Glib::ustring & get_rpcaddress()
Definition: gx_system.h:522
std::string get_online_presets_filename() const
Definition: gx_system.h:505
const Glib::ustring & get_jack_uuid2() const
Definition: gx_system.h:528
void set_jack_noconnect(bool set)
Definition: gx_system.h:534
void set_rpcaddress(const Glib::ustring &address)
Definition: gx_system.h:523
const std::string & get_pluginpreset_dir() const
Definition: gx_system.h:489
Glib::ustring jack_uuid
Definition: gx_system.h:403
int get_idle_thread_timeout() const
Definition: gx_system.h:540
Glib::ustring jack_instance
Definition: gx_system.h:401
bool get_jack_single() const
Definition: gx_system.h:533
std::string get_pixmap_filepath(const std::string &basename) const
Definition: gx_system.h:477
bool get_convolver_watchdog() const
Definition: gx_system.h:543
std::string get_current_style_cssfile() const
Definition: gx_system.h:476
void set_jack_single(bool set)
Definition: gx_system.h:535
std::string get_style_filepath(const std::string &basename) const
Definition: gx_system.h:475
void process(int argc, char **argv)
const std::string & get_path_to_program() const
Definition: gx_system.h:474
Glib::ustring tuner_tet
Definition: gx_system.h:430
const std::string & get_style_dir() const
Definition: gx_system.h:502
const std::string & get_old_user_dir() const
Definition: gx_system.h:486
void set_loop_dir(std::string dir)
Definition: gx_system.h:498
const std::string & get_loadfile() const
Definition: gx_system.h:524
std::string get_factory_filepath(const std::string &basename) const
Definition: gx_system.h:480
std::string pluginpreset_dir
Definition: gx_system.h:414
std::string lv2_preset_dir
Definition: gx_system.h:415
const Glib::ustring & get_jack_servername() const
Definition: gx_system.h:531
Glib::ustring jack_uuid2
Definition: gx_system.h:404
bool get_jack_noconnect() const
Definition: gx_system.h:532
const Glib::ustring & get_jack_midi() const
Definition: gx_system.h:529
Glib::ustring setbank
Definition: gx_system.h:427
Glib::ustring cmdline_bank
Definition: gx_system.h:428
FileName(const std::string &filename_, const Glib::ustring &displayname_)
Definition: gx_system.h:335
std::string filename
Definition: gx_system.h:333
Glib::ustring displayname
Definition: gx_system.h:334
IRFileListing(const std::string &path)
std::vector< FileName > & get_listing()
Definition: gx_system.h:346
std::vector< FileName > listing
Definition: gx_system.h:342
int ts_diff(const timespec &ts1, const timespec &ts2)
Definition: gx_system.h:232
void print(bool verbose=false)
bool find_dir(std::string *d, const std::string &filename) const
iterator begin()
Definition: gx_system.h:306
PathList(const char *env_name=0)
std::list< Glib::RefPtr< Gio::File > >::const_iterator iterator
Definition: gx_system.h:297
std::list< Glib::RefPtr< Gio::File > > pathlist
Definition: gx_system.h:296
iterator end()
Definition: gx_system.h:307
bool contains(const std::string &d) const
void add(const std::string &d)
Definition: gx_system.h:302
std::string replace_symbol(const std::string &dir) const
void add(char s, const std::string &d)
std::string replace_path(const std::string &dir) const
symbol_path_map dirs
Definition: gx_system.h:317
std::map< char, std::string > symbol_path_map
Definition: gx_system.h:315
const Glib::ustring & operator[](unsigned int idx)
std::vector< Glib::ustring > skin_list
Definition: gx_system.h:281
SkinHandling(const std::string &styledir)
Definition: gx_system.h:282
bool is_in_list(const std::string &skin_name)
void set_styledir(const std::string &styledir)
string get_cssfile() const
unsigned int index(const Glib::ustring &skin_name)
Glib::ustring name
Definition: gx_system.h:280
#define min(x, y)
#define max(x, y)
unsigned int _MM_GET_EXCEPTION_STATE(void)
Definition: gx_system.h:71
void clear_fpu_status_bits()
Definition: gx_system.h:40
void AVOIDDENORMALS()
Definition: gx_system.h:73
void _MM_SET_EXCEPTION_STATE(unsigned int __mask)
Definition: gx_system.h:70
unsigned int get_fpu_status_bits()
Definition: gx_system.h:41
void measure_pause()
Definition: gx_system.h:263
BasicOptions & get_options()
Definition: gx_system.h:547
void measure_stop()
Definition: gx_system.h:265
std::string encode_filename(const std::string &s)
int atomic_get(volatile int &p)
Definition: gx_system.h:98
void atomic_set(volatile int *p, int v)
Definition: gx_system.h:90
int gx_system_call(const std::string &, bool devnull=false, bool escape=false)
void measure_start()
Definition: gx_system.h:262
void measure_cont()
Definition: gx_system.h:264
void atomic_inc(volatile int *p)
Definition: gx_system.h:106
void add_time_measurement()
std::string decode_filename(const std::string &s)
bool atomic_compare_and_exchange(volatile int *p, int oldv, int newv)
Definition: gx_system.h:114
MeasureThreadsafe measure
void atomic_set_0(T **p)
Definition: gx_system.h:128
std::string to_string(const T &t)
Definition: gx_system.h:561
void strip(Glib::ustring &s)
void list_subdirs(PathList pl, std::vector< FileName > &dirs)
unsigned int MXStatus1
Definition: gx_system.h:188
void print(bool verbose) const
unsigned int MXStatus2
Definition: gx_system.h:190
void print_accum(const Accum &accum, const char *prefix, bool verbose, int total=0) const
unsigned int FPUStatus2
Definition: gx_system.h:189
unsigned int FPUStatus1
Definition: gx_system.h:187
float ns2ms(int n) const
Definition: gx_system.h:191