Special case Mixbus Chanstrip for load calculation
[ardour.git] / libs / ardour / ardour / plugin_insert.h
index bec49616a2d93322d5e3a8cb68c722e18d316c7f..30dd04057a2402f616bdecde7159661e0f09a6bf 100644 (file)
@@ -115,6 +115,10 @@ public:
 
 #ifdef MIXBUS
        bool is_channelstrip () const;
+       bool is_nonbypassable () const;
+#else
+       bool is_channelstrip () const { return false; }
+       bool is_nonbypassable () const { return false; }
 #endif
 
        void set_input_map (uint32_t, ChanMapping);
@@ -166,6 +170,7 @@ public:
        bool set_preset_out (const ChanCount&);
        bool add_sidechain  (uint32_t n_audio = 1, uint32_t n_midi = 0);
        bool del_sidechain ();
+       void update_sidechain_name ();
        boost::shared_ptr<SideChain> sidechain () const { return _sidechain; }
        // end C++ class slavery!
 
@@ -192,7 +197,9 @@ 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 ();
 
        /** A control that manipulates a plugin parameter (control port). */
        struct PluginControl : public AutomationControl
@@ -361,7 +368,24 @@ private:
        /** details of the match currently being used */
        Match _match;
 
-       typedef std::map <uint32_t, ARDOUR::ChanMapping> PinMappings;
+       /* ordered map [plugin instance ID] => ARDOUR::ChanMapping
+        * TODO: consider replacing with boost::flat_map<> or std::vector<>.
+        */
+       class PinMappings : public std::map <uint32_t, ARDOUR::ChanMapping> {
+               public:
+                       /* this emulates C++11's  std::map::at()
+                        * return mapping for given plugin instance */
+                       inline ARDOUR::ChanMapping const& p (const uint32_t i) const {
+#ifndef NDEBUG
+                               const_iterator x = find (i);
+                               assert (x != end ());
+                               return x->second;
+#else
+                               return find(i)->second;
+#endif
+                       }
+       };
+
        PinMappings _in_map;
        PinMappings _out_map;
        ChanMapping _thru_map; // out-idx <=  in-idx
@@ -382,6 +406,8 @@ private:
        boost::shared_ptr<Plugin> plugin_factory (boost::shared_ptr<Plugin>);
        void add_plugin (boost::shared_ptr<Plugin>);
 
+       void add_sidechain_from_xml (const XMLNode& node, int version);
+
        void start_touch (uint32_t param_id);
        void end_touch (uint32_t param_id);
 
@@ -395,6 +421,7 @@ private:
        void preset_load_set_value (uint32_t, float);
 
        PBD::TimingStats _timing_stats;
+       volatile gint _stat_reset;
 };
 
 } // namespace ARDOUR