From 39837c0528128040c865195713fb37d41eab5067 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 30 Mar 2016 04:56:40 +0200 Subject: [PATCH] debug print match method --- libs/ardour/ardour/plugin_insert.h | 30 ++++++++++++++++-------------- libs/ardour/plugin_insert.cc | 26 +++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/libs/ardour/ardour/plugin_insert.h b/libs/ardour/ardour/plugin_insert.h index 12c8d94725..1441dfadb0 100644 --- a/libs/ardour/ardour/plugin_insert.h +++ b/libs/ardour/ardour/plugin_insert.h @@ -219,6 +219,20 @@ class LIBARDOUR_API PluginInsert : public Processor 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) + }; + private: /* disallow copy construction */ PluginInsert (const PluginInsert&); @@ -250,20 +264,6 @@ class LIBARDOUR_API PluginInsert : public Processor bool _custom_cfg; bool _pending_no_inplace; - /** 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) - }; - Match private_can_support_io_configuration (ChanCount const &, ChanCount &) const; Match automatic_can_support_io_configuration (ChanCount const &, ChanCount &) const; @@ -291,4 +291,6 @@ class LIBARDOUR_API PluginInsert : public Processor } // namespace ARDOUR +std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m); + #endif /* __ardour_plugin_insert_h__ */ diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 267dd23dbf..0206941235 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -909,6 +909,9 @@ PluginInsert::configure_io (ChanCount in, ChanCount out) /* get plugin configuration */ _match = private_can_support_io_configuration (in, out); +#ifndef NDEBUG // XXX + cout << "Match '" << name() << "': " << _match; +#endif /* set the matching method and number of plugins that we will use to meet this configuration */ if (set_count (_match.plugins) == false) { @@ -1020,7 +1023,7 @@ PluginInsert::configure_io (ChanCount in, ChanCount out) if (mapping_changed) { PluginMapChanged (); /* EMIT SIGNAL */ -#ifndef NDEBUG +#ifndef NDEBUG // XXX uint32_t pc = 0; cout << "----<<----\n"; for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i, ++pc) { @@ -1993,3 +1996,24 @@ PluginInsert::end_touch (uint32_t param_id) ac->stop_touch (true, session().audible_frame()); } } + +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; +} -- 2.30.2