#include <boost/weak_ptr.hpp>
+#include "pbd/timing.h"
+
#include "ardour/ardour.h"
#include "ardour/libardour_visibility.h"
#include "ardour/chan_mapping.h"
*/
class LIBARDOUR_API PluginInsert : public Processor
{
- public:
+public:
PluginInsert (Session&, boost::shared_ptr<Plugin> = boost::shared_ptr<Plugin>());
~PluginInsert ();
static const std::string port_automation_node_name;
- XMLNode& state(bool);
- XMLNode& get_state(void);
int set_state(const XMLNode&, int version);
void update_id (PBD::ID);
void set_owner (SessionObject*);
bool write_immediate_event (size_t size, const uint8_t* buf);
+ void automation_run (samplepos_t, pframes_t, bool only_active = false);
+ bool find_next_event (double, double, Evoral::ControlEvent&, bool only_active = true) const;
+
int set_block_size (pframes_t nframes);
ChanMapping input_map (uint32_t num) const {
#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);
bool set_preset_out (const ChanCount&);
bool add_sidechain (uint32_t n_audio = 1, uint32_t n_midi = 0);
bool del_sidechain ();
- void set_sidechain_latency (uint32_t, uint32_t);
+ void update_sidechain_name ();
boost::shared_ptr<SideChain> sidechain () const { return _sidechain; }
// end C++ class slavery!
bool has_no_inputs() const;
bool has_no_audio_inputs() const;
+
bool is_instrument () const;
+
bool has_output_presets (
ChanCount in = ChanCount (DataType::MIDI, 1),
ChanCount out = ChanCount (DataType::AUDIO, 2)
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
{
double get_value (void) const;
XMLNode& get_state();
- protected:
+ protected:
void actually_set_value (double value, PBD::Controllable::GroupControlDisposition);
private:
bool custom_cfg; ///< custom config (if not strict)
};
- private:
+protected:
+ XMLNode& state ();
+
+private:
/* disallow copy construction */
PluginInsert (const PluginInsert&);
/** 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
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);
CtrlOutMap _control_outputs;
void preset_load_set_value (uint32_t, float);
+
+ PBD::TimingStats _timing_stats;
+ volatile gint _stat_reset;
};
} // namespace ARDOUR