diff options
-rw-r--r-- | gtk2_ardour/opts.cc | 11 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 9 | ||||
-rw-r--r-- | libs/ardour/redirect.cc | 7 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 |
4 files changed, 25 insertions, 4 deletions
diff --git a/gtk2_ardour/opts.cc b/gtk2_ardour/opts.cc index 82ddccca3d..85681b03c3 100644 --- a/gtk2_ardour/opts.cc +++ b/gtk2_ardour/opts.cc @@ -21,6 +21,8 @@ #include <iostream> #include <cstdlib> +#include <ardour/session.h> + #include "opts.h" #include "i18n.h" @@ -48,8 +50,9 @@ print_help (const char *execname) << _(" -v, --version Show version information\n") << _(" -h, --help Print this message\n") << _(" -b, --bindings Print all possible keyboard binding names\n") - << _(" -n, --show-splash Show splash screen\n") << _(" -c, --name name Use a specific jack client name, default is ardour\n") + << _(" -d, --disable-plugins Disable all plugins in an existing session\n") + << _(" -n, --show-splash Show splash screen\n") << _(" -m, --menus file Use \"file\" for Ardour menus\n") << _(" -N, --new session-name Create a new session from the command line\n") << _(" -O, --no-hw-optimizations Disable h/w specific optimizations\n") @@ -68,7 +71,7 @@ print_help (const char *execname) int ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) { - const char *optstring = "U:hSbvVnOc:C:m:N:k:p:"; + const char *optstring = "U:hSbvVnOdc:C:m:N:k:p:"; const char *execname = strrchr (argv[0], '/'); if (getenv ("ARDOUR_SAE")) { @@ -124,6 +127,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) case 'b': show_key_actions = true; break; + + case 'd': + ARDOUR::Session::set_disable_all_loaded_plugins (true); + break; case 'm': menus_file = optarg; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 611ef4813d..ff236d0c43 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -695,6 +695,13 @@ class Session : public PBD::StatefulDestructible uint32_t n_plugin_inserts() const { return _plugin_inserts.size(); } uint32_t n_sends() const { return _sends.size(); } + static void set_disable_all_loaded_plugins (bool yn) { + _disable_all_loaded_plugins = yn; + } + static bool get_disable_all_loaded_plugins() { + return _disable_all_loaded_plugins; + } + uint32_t next_send_id(); uint32_t next_insert_id(); void mark_send_id (uint32_t); @@ -1711,6 +1718,8 @@ class Session : public PBD::StatefulDestructible void set_history_depth (uint32_t depth); void sync_order_keys (); + + static bool _disable_all_loaded_plugins; }; } // namespace ARDOUR diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc index 045faf6ebf..b1e631015f 100644 --- a/libs/ardour/redirect.cc +++ b/libs/ardour/redirect.cc @@ -274,8 +274,11 @@ Redirect::set_state (const XMLNode& node) } if (_active != (prop->value() == "yes")) { - _active = !_active; - active_changed (this, this); /* EMIT_SIGNAL */ + if (!(_session.state_of_the_state() & Session::Loading) || + !Session::get_disable_all_loaded_plugins()) { + _active = !_active; + active_changed (this, this); /* EMIT_SIGNAL */ + } } if ((prop = node.property ("placement")) == 0) { diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 2534e58d00..7cf64905fb 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -95,6 +95,8 @@ const char* Session::dead_sound_dir_name = X_("dead_sounds"); const char* Session::interchange_dir_name = X_("interchange"); const char* Session::export_dir_name = X_("export"); +bool Session::_disable_all_loaded_plugins = false; + Session::compute_peak_t Session::compute_peak = 0; Session::find_peaks_t Session::find_peaks = 0; Session::apply_gain_to_buffer_t Session::apply_gain_to_buffer = 0; |