13
0

Prepare option to disable Plugins completely

old behavior to only bypassed plugins is being renamed.
This commit is contained in:
Robin Gareus 2015-09-01 13:26:31 +02:00
parent a1b387ad9a
commit 531e71b485
4 changed files with 26 additions and 6 deletions

View File

@ -760,6 +760,12 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
static bool get_disable_all_loaded_plugins() { static bool get_disable_all_loaded_plugins() {
return _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_send_id();
uint32_t next_aux_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); void set_history_depth (uint32_t depth);
static bool _disable_all_loaded_plugins; static bool _disable_all_loaded_plugins;
static bool _bypass_all_loaded_plugins;
mutable bool have_looped; ///< Used in ::audible_frame(*) mutable bool have_looped; ///< Used in ::audible_frame(*)

View 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 (_active != a) {
if (a) { if (a) {
activate (); activate ();

View 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 (); processor->activate ();
} }
@ -1292,7 +1292,11 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
prop->value() == "lxvst" || prop->value() == "lxvst" ||
prop->value() == "audiounit") { prop->value() == "audiounit") {
if (_session.get_disable_all_loaded_plugins ()) {
processor.reset (new UnknownProcessor (_session, node));
} else {
processor.reset (new PluginInsert (_session)); processor.reset (new PluginInsert (_session));
}
} else { } 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 //A2 uses the "active" flag in the toplevel redirect node, not in the child plugin/IO
if (i != children.end()) { if (i != children.end()) {
if ((prop = (*i)->property (X_("active"))) != 0) { 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(); processor->activate();
else else
processor->deactivate(); processor->deactivate();
@ -2866,8 +2870,11 @@ Route::set_processor_state (const XMLNode& node)
prop->value() == "lxvst" || prop->value() == "lxvst" ||
prop->value() == "audiounit") { 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") { } else if (prop->value() == "port") {
processor.reset (new PortInsert (_session, _pannable, _mute_master)); processor.reset (new PortInsert (_session, _pannable, _mute_master));
@ -4238,6 +4245,11 @@ Route::unknown_processors () const
{ {
list<string> p; 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); Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<UnknownProcessor const> (*i)) { if (boost::dynamic_pointer_cast<UnknownProcessor const> (*i)) {

View File

@ -118,6 +118,7 @@ using namespace ARDOUR;
using namespace PBD; using namespace PBD;
bool Session::_disable_all_loaded_plugins = false; bool Session::_disable_all_loaded_plugins = false;
bool Session::_bypass_all_loaded_plugins = false;
PBD::Signal1<int,uint32_t> Session::AudioEngineSetupRequired; PBD::Signal1<int,uint32_t> Session::AudioEngineSetupRequired;
PBD::Signal1<void,std::string> Session::Dialog; PBD::Signal1<void,std::string> Session::Dialog;