From 78fc6d66516861e4ff0b98671c04aa182f5a5b6a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 26 Jul 2019 16:44:29 +0200 Subject: [PATCH] Prefix all env variable with "ARDOUR_" In particular "CONCURRENCY" can be problematic. But in general it's good practice to use a namespace prefix for app-specifics. --- libs/ardour/ardour/dsp_load_calculator.h | 2 +- libs/ardour/globals.cc | 2 +- libs/backends/alsa/alsa_audiobackend.cc | 6 +++--- libs/backends/coreaudio/coremidi_io.cc | 2 +- libs/pbd/cpus.cc | 4 ++-- libs/widgets/fastmeter.cc | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/ardour/ardour/dsp_load_calculator.h b/libs/ardour/ardour/dsp_load_calculator.h index 32f24285cf..3a7de6a239 100644 --- a/libs/ardour/ardour/dsp_load_calculator.h +++ b/libs/ardour/ardour/dsp_load_calculator.h @@ -73,7 +73,7 @@ public: } #ifndef NDEBUG - const bool calc_avg_load = NULL != getenv("AVGLOAD"); + const bool calc_avg_load = NULL != getenv("ARDOUR_AVG_DSP_LOAD"); #else const bool calc_avg_load = false; #endif diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index e42c0d5ca9..7f7d9f582b 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -439,7 +439,7 @@ ARDOUR::init (bool use_windows_vst, bool try_optimization, const char* localedir } #ifndef NDEBUG - if (getenv("LUA_METATABLES")) { + if (getenv("ARDOUR_LUA_METATABLES")) { luabridge::Security::setHideMetatables (false); } #endif diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 69a23c1912..0523c411b5 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -958,10 +958,10 @@ AlsaAudioBackend::_start (bool for_latency_measurement) _midi_device_thread_active = listen_for_midi_device_changes (); -#if 1 - if (NULL != getenv ("ALSAEXT")) { +#if 1 // TODO: we need a GUI (and API) for this + if (NULL != getenv ("ARDOUR_ALSA_EXT")) { boost::char_separator sep (";"); - boost::tokenizer > devs (std::string(getenv ("ALSAEXT")), sep); + boost::tokenizer > devs (std::string(getenv ("ARDOUR_ALSA_EXT")), sep); BOOST_FOREACH (const std::string& tmp, devs) { std::string dev (tmp); std::string::size_type n = dev.find ('@'); diff --git a/libs/backends/coreaudio/coremidi_io.cc b/libs/backends/coreaudio/coremidi_io.cc index 7cfe2e0db3..8b00986167 100644 --- a/libs/backends/coreaudio/coremidi_io.cc +++ b/libs/backends/coreaudio/coremidi_io.cc @@ -153,7 +153,7 @@ CoreMidiIo::CoreMidiIo() pthread_mutex_init (&_discovery_lock, 0); #ifndef NDEBUG - const char *p = getenv ("COREMIDIDEBUG"); + const char *p = getenv ("ARDOUR_COREMIDI_DEBUG"); if (p && *p) _debug_mode = atoi (p); #endif } diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc index af58221a1f..b52be1ccff 100644 --- a/libs/pbd/cpus.cc +++ b/libs/pbd/cpus.cc @@ -43,8 +43,8 @@ uint32_t hardware_concurrency() { - if (getenv("CONCURRENCY")) { - int c = atoi (getenv("CONCURRENCY")); + if (getenv("ARDOUR_CONCURRENCY")) { + int c = atoi (getenv("ARDOUR_CONCURRENCY")); if (c > 0) { return c; } diff --git a/libs/widgets/fastmeter.cc b/libs/widgets/fastmeter.cc index a9ecf5dad6..8dc89f07e1 100644 --- a/libs/widgets/fastmeter.cc +++ b/libs/widgets/fastmeter.cc @@ -74,7 +74,7 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len, last_peak_rect.x = 0; last_peak_rect.y = 0; - no_rgba_overlay = ! Glib::getenv("NO_METER_SHADE").empty(); + no_rgba_overlay = ! Glib::getenv("ARDOUR_NO_METER_SHADE").empty(); _clr[0] = clr0; _clr[1] = clr1;