diff --git a/libs/ardour/ardour/plug_insert_base.h b/libs/ardour/ardour/plug_insert_base.h index a4e9d542ef..7c9cff6986 100644 --- a/libs/ardour/ardour/plug_insert_base.h +++ b/libs/ardour/ardour/plug_insert_base.h @@ -103,6 +103,33 @@ public: Variant _value; }; + /** Enumeration of the ways in which we can match our insert's + * IO to that of the plugin(s). + */ + enum MatchingMethod { + Impossible, ///< we can't + Delegate, ///< we are delegating to the plugin, and it can handle it + NoInputs, ///< plugin has no inputs, so anything goes + ExactMatch, ///< our insert's inputs are the same as the plugin's + Replicate, ///< we have multiple instances of the plugin + Split, ///< we copy one of our insert's inputs to multiple plugin inputs + Hide, ///< we `hide' some of the plugin's inputs by feeding them silence + }; + + /** Description of how we can match our plugin's IO to our own insert IO */ + struct Match { + Match () : method (Impossible), plugins (0), strict_io (false), custom_cfg (false) {} + Match (MatchingMethod m, int32_t p, + bool strict = false, bool custom = false, ChanCount h = ChanCount ()) + : method (m), plugins (p), hide (h), strict_io (strict), custom_cfg (custom) {} + + MatchingMethod method; ///< method to employ + int32_t plugins; ///< number of copies of the plugin that we need + ChanCount hide; ///< number of channels to hide + bool strict_io; ///< force in == out + bool custom_cfg; ///< custom config (if not strict) + }; + protected: static std::shared_ptr plugin_factory (std::shared_ptr); @@ -115,4 +142,6 @@ protected: } // namespace ARDOUR +std::ostream& operator<<(std::ostream& o, const ARDOUR::PlugInsertBase::Match& m); + #endif diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index bde43d256c..9de7629a5a 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -270,34 +270,6 @@ public: PBD::Signal0 PluginIoReConfigure; PBD::Signal0 PluginMapChanged; PBD::Signal0 PluginConfigChanged; - - /** Enumeration of the ways in which we can match our insert's - * IO to that of the plugin(s). - */ - enum MatchingMethod { - Impossible, ///< we can't - Delegate, ///< we are delegating to the plugin, and it can handle it - NoInputs, ///< plugin has no inputs, so anything goes - ExactMatch, ///< our insert's inputs are the same as the plugin's - Replicate, ///< we have multiple instances of the plugin - Split, ///< we copy one of our insert's inputs to multiple plugin inputs - Hide, ///< we `hide' some of the plugin's inputs by feeding them silence - }; - - /** Description of how we can match our plugin's IO to our own insert IO */ - struct Match { - Match () : method (Impossible), plugins (0), strict_io (false), custom_cfg (false) {} - Match (MatchingMethod m, int32_t p, - bool strict = false, bool custom = false, ChanCount h = ChanCount ()) - : method (m), plugins (p), hide (h), strict_io (strict), custom_cfg (custom) {} - - MatchingMethod method; ///< method to employ - int32_t plugins; ///< number of copies of the plugin that we need - ChanCount hide; ///< number of channels to hide - bool strict_io; ///< force in == out - bool custom_cfg; ///< custom config (if not strict) - }; - protected: XMLNode& state () const; @@ -427,6 +399,4 @@ private: } // namespace ARDOUR -std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m); - #endif /* __ardour_plugin_insert_h__ */ diff --git a/libs/ardour/plug_insert_base.cc b/libs/ardour/plug_insert_base.cc index 73eecdecce..e762cca9ab 100644 --- a/libs/ardour/plug_insert_base.cc +++ b/libs/ardour/plug_insert_base.cc @@ -400,3 +400,24 @@ PlugInsertBase::PluginPropertyControl::get_value () const { return _value.to_double (); } + +std::ostream& operator<<(std::ostream& o, const ARDOUR::PlugInsertBase::Match& m) +{ + switch (m.method) { + case PlugInsertBase::Impossible: o << "Impossible"; break; + case PlugInsertBase::Delegate: o << "Delegate"; break; + case PlugInsertBase::NoInputs: o << "NoInputs"; break; + case PlugInsertBase::ExactMatch: o << "ExactMatch"; break; + case PlugInsertBase::Replicate: o << "Replicate"; break; + case PlugInsertBase::Split: o << "Split"; break; + case PlugInsertBase::Hide: o << "Hide"; break; + } + o << " cnt: " << m.plugins + << (m.strict_io ? " strict-io" : "") + << (m.custom_cfg ? " custom-cfg" : ""); + if (m.method == PlugInsertBase::Hide) { + o << " hide: " << m.hide; + } + o << "\n"; + return o; +} diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 114ee3fc86..aaa5819b69 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -2259,7 +2259,7 @@ PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) return private_can_support_io_configuration (in, out).method != Impossible; } -PluginInsert::Match +PlugInsertBase::Match PluginInsert::private_can_support_io_configuration (ChanCount const& in, ChanCount& out) const { if (!_custom_cfg && _preset_out.n_audio () > 0) { @@ -3236,24 +3236,3 @@ PluginInsert::clear_stats () { _stat_reset.store (1); } - -std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m) -{ - switch (m.method) { - case PluginInsert::Impossible: o << "Impossible"; break; - case PluginInsert::Delegate: o << "Delegate"; break; - case PluginInsert::NoInputs: o << "NoInputs"; break; - case PluginInsert::ExactMatch: o << "ExactMatch"; break; - case PluginInsert::Replicate: o << "Replicate"; break; - case PluginInsert::Split: o << "Split"; break; - case PluginInsert::Hide: o << "Hide"; break; - } - o << " cnt: " << m.plugins - << (m.strict_io ? " strict-io" : "") - << (m.custom_cfg ? " custom-cfg" : ""); - if (m.method == PluginInsert::Hide) { - o << " hide: " << m.hide; - } - o << "\n"; - return o; -}