autodetect if current pin-connections can be processed in-place
authorRobin Gareus <robin@gareus.org>
Fri, 1 Apr 2016 23:05:33 +0000 (01:05 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 1 Apr 2016 23:05:33 +0000 (01:05 +0200)
libs/ardour/ardour/plugin_insert.h
libs/ardour/luabindings.cc
libs/ardour/plugin_insert.cc

index 3e233ba6c103c5089abf2a99969e4a5afb971c49..831d48ef17f45fda664d1c3ddf56004c8d4cb816 100644 (file)
@@ -185,14 +185,6 @@ class LIBARDOUR_API PluginInsert : public Processor
 
        void collect_signal_for_analysis (framecnt_t nframes);
 
-       bool no_inplace () const {
-               return _pending_no_inplace;
-       }
-
-       void set_no_inplace (bool b) { // XXX tenative dev API
-               _pending_no_inplace = b; // TODO detect automatically
-       }
-
        bool strict_io_configured () const {
                return _match.strict_io;
        }
@@ -267,7 +259,6 @@ class LIBARDOUR_API PluginInsert : public Processor
        bool _no_inplace;
        bool _strict_io;
        bool _custom_cfg;
-       bool _pending_no_inplace;
 
        Match private_can_support_io_configuration (ChanCount const &, ChanCount &) const;
        Match automatic_can_support_io_configuration (ChanCount const &, ChanCount &) const;
index d7b9410bfc4f42d769b9a1c64d19a15305e5f7ec..8c5023cfd7a4676cbb68c946e269e849c7fec211 100644 (file)
@@ -373,10 +373,8 @@ LuaBindings::common (lua_State* L)
                .addFunction ("activate", &PluginInsert::activate)
                .addFunction ("deactivate", &PluginInsert::deactivate)
                .addFunction ("strict_io_configured", &PluginInsert::strict_io_configured)
-               .addFunction ("no_inplace", &PluginInsert::no_inplace)
                .addFunction ("input_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::input_map)
                .addFunction ("output_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::output_map)
-               .addFunction ("set_no_inplace", &PluginInsert::set_no_inplace) // XXX
                .addFunction ("set_input_map", &PluginInsert::set_input_map)
                .addFunction ("set_output_map", &PluginInsert::set_output_map)
 
index 78f46275f71e43429e7cda58396783943c4629a3..bf188ec3bd6748dcfd23169347150be57eee4e15 100644 (file)
@@ -72,7 +72,6 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug)
        , _no_inplace (false)
        , _strict_io (false)
        , _custom_cfg (false)
-       , _pending_no_inplace (false)
 {
        /* the first is the master */
 
@@ -414,31 +413,6 @@ PluginInsert::connect_and_run (BufferSet& bufs, pframes_t nframes, framecnt_t of
        PinMappings in_map (_in_map);
        PinMappings out_map (_out_map);
 
-#if 1
-       // auto-detect if inplace processing is possible
-       // TODO: do this once. during configure_io and every time the
-       // plugin-count or mapping changes.
-       bool inplace_ok = true;
-       for (uint32_t pc = 0; pc < get_count() && inplace_ok ; ++pc) {
-               if (!in_map[pc].is_monotonic ()) {
-                       inplace_ok = false;
-               }
-               if (!out_map[pc].is_monotonic ()) {
-                       inplace_ok = false;
-               }
-       }
-
-       if (_pending_no_inplace != !inplace_ok) {
-#ifndef NDEBUG // this 'cerr' needs to go ASAP.
-               cerr << name () << " automatically set : " << (inplace_ok ? "Use Inplace" : "No Inplace") << "\n"; // XXX
-#endif
-               _pending_no_inplace = !inplace_ok;
-       }
-#endif
-
-       _no_inplace = _pending_no_inplace || _plugins.front()->inplace_broken ();
-
-
 #if 1
        // TODO optimize special case.
        // Currently this never triggers because the in_map for "Split" triggeres no_inplace.
@@ -1111,6 +1085,18 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
 #endif
        }
 
+       // auto-detect if inplace processing is possible
+       bool inplace_ok = true;
+       for (uint32_t pc = 0; pc < get_count() && inplace_ok ; ++pc) {
+               if (!_in_map[pc].is_monotonic ()) {
+                       inplace_ok = false;
+               }
+               if (!_out_map[pc].is_monotonic ()) {
+                       inplace_ok = false;
+               }
+       }
+       _no_inplace = !inplace_ok || _plugins.front()->inplace_broken ();
+
        if (old_in != in || old_out != out
                        || (old_match.method != _match.method && (old_match.method == Split || _match.method == Split))
                 ) {