25#ifndef SRC_HEADERS_GX_SYSTEM_H_
26#define SRC_HEADERS_GX_SYSTEM_H_
32#define FE_DENORM __FE_DENORM
35 unsigned int fpu_status __attribute__ ((__mode__ (__HI__)));
36 __asm__(
"fnstsw %0" :
"=m" (*&fpu_status));
43 int ret = fegetexceptflag(&flagp, FE_ALL_EXCEPT);
54#ifndef _PMMINTRIN_H_INCLUDED
58 _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
59 _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
62#ifndef _XMMINTRIN_H_INCLUDED
65inline void AVOIDDENORMALS() { _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); }
69#ifndef _XMMINTRIN_H_INCLUDED
79#define ASCII_START (48)
80#define GDK_NO_MOD_MASK (GdkModifierType)0
91 g_atomic_int_set(p, v);
94inline void atomic_set(
volatile unsigned int* p,
unsigned int v) {
95 g_atomic_int_set(
reinterpret_cast<volatile int*
>(p), v);
99 return g_atomic_int_get(&p);
103 return g_atomic_int_get(
reinterpret_cast<volatile int*
>(&p));
111 g_atomic_int_inc(
reinterpret_cast<volatile int*
>(p));
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);
118 return g_atomic_int_compare_and_exchange(
const_cast<int*
>(p), oldv, newv);
124 g_atomic_pointer_set(p, v);
129 g_atomic_pointer_set(p, 0);
134 return static_cast<T*
>(g_atomic_pointer_get(&p));
139 return g_atomic_pointer_compare_and_exchange(
reinterpret_cast<void**
>(p),
static_cast<void*
>(oldv), newv);
176 sx2 +=
static_cast<float>(diff) * diff;
191 inline float ns2ms(
int n)
const {
return n * 1e-6; }
194 void print_accum(
const Accum& accum,
const char* prefix,
bool verbose,
int total = 0)
const;
209 inline int ts_diff(
const timespec& ts1,
const timespec& ts2);
215 clock_gettime(CLOCK_MONOTONIC, &
t1s);
218 clock_gettime(CLOCK_MONOTONIC, &
t1e);
225 clock_gettime(CLOCK_MONOTONIC, &
t2s);
233 time_t df = ts1.tv_sec - ts2.tv_sec;
234 if (std::abs(df) > 2) {
237 return df * 1000000000 + (ts1.tv_nsec - ts2.tv_nsec);
244 clock_gettime(CLOCK_MONOTONIC, &n);
249 if (!(
t1old.tv_sec == 0 &&
t1old.tv_nsec == 0)) {
287 unsigned int index(
const Glib::ustring& skin_name);
296 typedef std::list< Glib::RefPtr<Gio::File> >
pathlist;
297 typedef std::list< Glib::RefPtr<Gio::File> >::const_iterator
iterator;
302 void add(
const std::string& d) {
dirs.push_back(Gio::File::create_for_path(d)); }
304 bool find_dir(std::string *d,
const std::string& filename)
const;
323 void add(
char s,
const std::string& d);
335 FileName(
const std::string& filename_,
const Glib::ustring& displayname_)
355#define RPCPORT_DEFAULT (-2)
356#define RPCPORT_NONE (-1)
557int gx_system_call(
const std::string&,
bool devnull =
false,
bool escape =
false);
562 std::stringstream ss;
PrefixConverter IR_prefixmap
std::string get_builder_filepath(const std::string &basename) const
static void make_ending_slash(std::string &dirpath)
void set_user_dir(std::string dir)
const PathList & get_IR_pathlist() const
const std::string & get_user_IR_dir() const
static BasicOptions * instance
const std::string & get_user_dir() const
std::string get_user_ir_filepath(const std::string &basename) const
const PrefixConverter & get_IR_prefixmap() const
std::string get_user_filepath(const std::string &basename) const
void set_user_IR_dir(std::string dir)
friend BasicOptions & get_options()
const std::string & get_sys_IR_dir() const
std::string path_to_program
const Glib::ustring & get_setbank()
const Glib::ustring & get_rcset() const
void set_preset_dir(std::string dir)
const std::string & get_plugin_dir() const
Glib::ustring jack_servername
void set_opt_autosave(bool set)
std::string get_online_config_filename() const
bool system_show_tooltips
void set_jack_instancename(std::string name)
bool get_opt_save_on_exit() const
Glib::OptionGroup optgroup_jack
std::string get_temp_filepath(const std::string &basename) const
const Glib::ustring & get_tuner_tet()
std::string get_lv2_preset_filepath(const std::string &id) const
std::string get_plugin_filepath(const std::string &basename) const
bool get_watchdog_warning() const
const std::string & get_lv2_preset_dir() const
Glib::OptionGroup optgroup_file
bool get_clear_rc() const
std::vector< Glib::ustring > jack_outputs
Glib::OptionGroup optgroup_overload
const Glib::ustring & get_jack_input() const
std::string get_pluginpreset_filepath(const std::string &id, bool factory) const
void set_pluginpreset_dir(std::string dir)
std::string get_ladspa_config_filename() const
const Glib::ustring & get_cmdline_preset()
Glib::OptionGroup optgroup_debug
const Glib::ustring & get_jack_instancename() const
int get_sporadic_overload() const
std::string get_preset_filepath(const std::string &basename) const
bool get_liveplaygui() const
const Glib::ustring & get_tuner_ref()
Glib::OptionGroup main_group
bool get_hideonquit() const
const std::string & get_loop_dir() const
void set_bank_preset(const Glib::ustring &bank, const Glib::ustring &preset)
const std::string & get_temp_dir() const
void set_rpcport(int port)
const Glib::ustring & get_jack_uuid() const
void set_lv2_preset_dir(std::string dir)
void set_hideonquit(bool set)
Glib::OptionGroup optgroup_style
const std::string & get_preset_dir() const
void set_plugin_dir(std::string dir)
const Glib::ustring & get_cmdline_bank()
Glib::ustring cmdline_preset
bool get_opt_autosave() const
Glib::ustring get_jack_output(unsigned int n) const
const std::string & get_factory_dir() const
void set_temp_dir(std::string dir)
bool get_xrun_watchdog() const
const Glib::ustring & get_rpcaddress()
std::string get_online_presets_filename() const
const Glib::ustring & get_jack_uuid2() const
void set_jack_noconnect(bool set)
bool system_tuner_midiout
void set_rpcaddress(const Glib::ustring &address)
const std::string & get_pluginpreset_dir() const
int get_idle_thread_timeout() const
Glib::ustring jack_instance
bool get_jack_single() const
std::string get_pixmap_filepath(const std::string &basename) const
bool get_convolver_watchdog() const
std::string get_current_style_cssfile() const
void set_jack_single(bool set)
std::string get_style_filepath(const std::string &basename) const
void process(int argc, char **argv)
const std::string & get_path_to_program() const
const std::string & get_style_dir() const
const std::string & get_old_user_dir() const
void set_loop_dir(std::string dir)
const std::string & get_loadfile() const
std::string get_factory_filepath(const std::string &basename) const
std::string pluginpreset_dir
std::string lv2_preset_dir
const Glib::ustring & get_jack_servername() const
bool get_jack_noconnect() const
const Glib::ustring & get_jack_midi() const
Glib::ustring cmdline_bank
FileName(const std::string &filename_, const Glib::ustring &displayname_)
Glib::ustring displayname
IRFileListing(const std::string &path)
std::vector< FileName > & get_listing()
std::vector< FileName > listing
int ts_diff(const timespec &ts1, const timespec &ts2)
void print(bool verbose=false)
bool find_dir(std::string *d, const std::string &filename) const
PathList(const char *env_name=0)
std::list< Glib::RefPtr< Gio::File > >::const_iterator iterator
std::list< Glib::RefPtr< Gio::File > > pathlist
bool contains(const std::string &d) const
void add(const std::string &d)
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
std::map< char, std::string > symbol_path_map
const Glib::ustring & operator[](unsigned int idx)
std::vector< Glib::ustring > skin_list
SkinHandling(const std::string &styledir)
bool is_in_list(const std::string &skin_name)
void set_styledir(const std::string &styledir)
string get_cssfile() const
void set_default_skin_name()
unsigned int index(const Glib::ustring &skin_name)
unsigned int _MM_GET_EXCEPTION_STATE(void)
void clear_fpu_status_bits()
void _MM_SET_EXCEPTION_STATE(unsigned int __mask)
unsigned int get_fpu_status_bits()
BasicOptions & get_options()
std::string encode_filename(const std::string &s)
int atomic_get(volatile int &p)
void atomic_set(volatile int *p, int v)
int gx_system_call(const std::string &, bool devnull=false, bool escape=false)
void atomic_inc(volatile int *p)
void add_time_measurement()
std::string decode_filename(const std::string &s)
bool atomic_compare_and_exchange(volatile int *p, int oldv, int newv)
MeasureThreadsafe measure
std::string to_string(const T &t)
void strip(Glib::ustring &s)
void list_subdirs(PathList pl, std::vector< FileName > &dirs)
void print(bool verbose) const
void print_accum(const Accum &accum, const char *prefix, bool verbose, int total=0) const