Prepare option to disable Plugins completely
authorRobin Gareus <robin@gareus.org>
Tue, 1 Sep 2015 11:26:31 +0000 (13:26 +0200)
committerRobin Gareus <robin@gareus.org>
Tue, 1 Sep 2015 11:26:31 +0000 (13:26 +0200)
old behavior to only bypassed plugins is being renamed.

libs/ardour/ardour/session.h
libs/ardour/processor.cc
libs/ardour/route.cc
libs/ardour/session.cc

index a0017717e2528eed6bc21b0fe5021db509ced970..f5ff34e72d889fd12030398b33b0cf3c5ba1b8e4 100644 (file)
@@ -760,6 +760,12 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        static bool get_disable_all_loaded_plugins() {
                return _disable_all_loaded_plugins;
        }
+       static void set_bypass_all_loaded_plugins (bool yn) {
+               _bypass_all_loaded_plugins = yn;
+       }
+       static bool get_bypass_all_loaded_plugins() {
+               return _bypass_all_loaded_plugins;
+       }
 
        uint32_t next_send_id();
        uint32_t next_aux_send_id();
@@ -1733,6 +1739,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        void set_history_depth (uint32_t depth);
 
        static bool _disable_all_loaded_plugins;
+       static bool _bypass_all_loaded_plugins;
 
        mutable bool have_looped; ///< Used in ::audible_frame(*)
 
index caa240ce228ecc0125e786b2146b4e3e3773a442..aca9ccaab121a5cea48204cd5e59f4f9bafd4de0 100644 (file)
@@ -225,7 +225,7 @@ Processor::set_state (const XMLNode& node, int version)
                }
        }
 
-       bool const a = string_is_affirmative (prop->value ()) && !_session.get_disable_all_loaded_plugins();
+       bool const a = string_is_affirmative (prop->value ()) && !_session.get_bypass_all_loaded_plugins();
        if (_active != a) {
                if (a) {
                        activate ();
index 55e1be26622b3b195939c955fc437769a8ded0ad..f128fa3cf58eb4403ecd5413c94e07b417d460d8 100644 (file)
@@ -1239,7 +1239,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, boost::shared_ptr<
 
                }
 
-               if (activation_allowed && (!_session.get_disable_all_loaded_plugins () || !processor->display_to_user ())) {
+               if (activation_allowed && (!_session.get_bypass_all_loaded_plugins () || !processor->display_to_user ())) {
                        processor->activate ();
                }
 
@@ -1292,7 +1292,11 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
                                                prop->value() == "lxvst" ||
                                                prop->value() == "audiounit") {
 
-                                       processor.reset (new PluginInsert (_session));
+                                       if (_session.get_disable_all_loaded_plugins ()) {
+                                               processor.reset (new UnknownProcessor (_session, node));
+                                       } else {
+                                               processor.reset (new PluginInsert (_session));
+                                       }
 
                                } else {
 
@@ -1319,7 +1323,7 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
                //A2 uses the "active" flag in the toplevel redirect node, not in the child plugin/IO
                if (i != children.end()) {
                        if ((prop = (*i)->property (X_("active"))) != 0) {
-                               if ( string_is_affirmative (prop->value()) && (!_session.get_disable_all_loaded_plugins () || !processor->display_to_user () ) )
+                               if ( string_is_affirmative (prop->value()) && (!_session.get_bypass_all_loaded_plugins () || !processor->display_to_user () ) )
                                        processor->activate();
                                else
                                        processor->deactivate();
@@ -2866,8 +2870,11 @@ Route::set_processor_state (const XMLNode& node)
                                           prop->value() == "lxvst" ||
                                           prop->value() == "audiounit") {
 
-                                       processor.reset (new PluginInsert(_session));
-
+                                       if (_session.get_disable_all_loaded_plugins ()) {
+                                               processor.reset (new UnknownProcessor (_session, **niter));
+                                       } else {
+                                               processor.reset (new PluginInsert (_session));
+                                       }
                                } else if (prop->value() == "port") {
 
                                        processor.reset (new PortInsert (_session, _pannable, _mute_master));
@@ -4238,6 +4245,11 @@ Route::unknown_processors () const
 {
        list<string> p;
 
+       if (_session.get_disable_all_loaded_plugins ()) {
+               // Do not list "missing plugins" if they are explicitly disabled
+               return p;
+       }
+
        Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
        for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
                if (boost::dynamic_pointer_cast<UnknownProcessor const> (*i)) {
index 85a2c67f4382952c8beba37cefd949aab821b349..fae67b164b4689d0656fb65f4d7e20fcdcf5976d 100644 (file)
@@ -118,6 +118,7 @@ using namespace ARDOUR;
 using namespace PBD;
 
 bool Session::_disable_all_loaded_plugins = false;
+bool Session::_bypass_all_loaded_plugins = false;
 
 PBD::Signal1<int,uint32_t> Session::AudioEngineSetupRequired;
 PBD::Signal1<void,std::string> Session::Dialog;