debug print match method
authorRobin Gareus <robin@gareus.org>
Wed, 30 Mar 2016 02:56:40 +0000 (04:56 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 30 Mar 2016 02:56:40 +0000 (04:56 +0200)
libs/ardour/ardour/plugin_insert.h
libs/ardour/plugin_insert.cc

index 12c8d94725458bbdc3f320e19ae1d94065b77a9e..1441dfadb0943e570a641802de4279240a1b957b 100644 (file)
@@ -219,6 +219,20 @@ class LIBARDOUR_API PluginInsert : public Processor
                Hide,        ///< we `hide' some of the plugin's inputs by feeding them silence
        };
 
                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&);
   private:
        /* disallow copy construction */
        PluginInsert (const PluginInsert&);
@@ -250,20 +264,6 @@ class LIBARDOUR_API PluginInsert : public Processor
        bool _custom_cfg;
        bool _pending_no_inplace;
 
        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;
 
        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
 
 
 } // namespace ARDOUR
 
+std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m);
+
 #endif /* __ardour_plugin_insert_h__ */
 #endif /* __ardour_plugin_insert_h__ */
index 267dd23dbff7037e9a5a616ab8ab09dd41db40f7..0206941235e127b49cb154be0094b3fa4b31e014 100644 (file)
@@ -909,6 +909,9 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
 
        /* get plugin configuration */
        _match = private_can_support_io_configuration (in, 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) {
 
        /* 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 */
 
        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) {
                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());
         }
 }
                 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;
+}