Special case Mixbus Chanstrip for load calculation
authorRobin Gareus <robin@gareus.org>
Mon, 3 Dec 2018 21:29:25 +0000 (22:29 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 3 Dec 2018 21:43:02 +0000 (22:43 +0100)
These processors don't have a UI, so their load stats are not easily
visible. The stats can still be queried via Lua API or DSP-load
overview window, so we retain this for debug builds.

libs/ardour/ardour/plugin_insert.h
libs/ardour/plugin_insert.cc

index 5460e25a14d2cbc47aac8c97210690fcf2cd6727..30dd04057a2402f616bdecde7159661e0f09a6bf 100644 (file)
@@ -197,6 +197,7 @@ public:
 
        bool load_preset (Plugin::PresetRecord);
 
+       bool provides_stats () const;
        bool get_stats (uint64_t& min, uint64_t& max, double& avg, double& dev) const;
        void clear_stats ();
 
index 9cb654bcb4470b522aea8e909425e8c92796adc0..3b87b659a62d382ffe7413eb77e990e76a56de8a 100644 (file)
@@ -1226,7 +1226,13 @@ PluginInsert::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sa
        }
 
        if (_pending_active) {
+#if defined MIXBUS && !defined NDEBUG
+               if (!is_channelstrip ()) {
+                       _timing_stats.start ();
+               }
+#else
                _timing_stats.start ();
+#endif
                /* run as normal if we are active or moving from inactive to active */
 
                if (_session.transport_rolling() || _session.bounce_processing()) {
@@ -1235,7 +1241,13 @@ PluginInsert::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sa
                        Glib::Threads::Mutex::Lock lm (control_lock(), Glib::Threads::TRY_LOCK);
                        connect_and_run (bufs, start_sample, end_sample, speed, nframes, 0, lm.locked());
                }
+#if defined MIXBUS && !defined NDEBUG
+               if (!is_channelstrip ()) {
+                       _timing_stats.update ();
+               }
+#else
                _timing_stats.update ();
+#endif
 
        } else {
                _timing_stats.reset ();
@@ -3199,6 +3211,17 @@ PluginInsert::end_touch (uint32_t param_id)
        }
 }
 
+bool
+PluginInsert::provides_stats () const
+{
+#if defined MIXBUS && !defined NDEBUG
+       if (is_channelstrip () || !display_to_user ()) {
+               return false;
+       }
+#endif
+       return true;
+}
+
 bool
 PluginInsert::get_stats (uint64_t& min, uint64_t& max, double& avg, double& dev) const
 {