From bbbd6a36ec044f06b5fc748b000f23d0418aa91f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 6 Oct 2020 21:11:56 +0200 Subject: [PATCH] VST3: set owner (prepare for context-info extensions) --- libs/ardour/ardour/vst3_plugin.h | 6 ++++++ libs/ardour/vst3_plugin.cc | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/libs/ardour/ardour/vst3_plugin.h b/libs/ardour/ardour/vst3_plugin.h index 53f0ec366c..8215a55ae1 100644 --- a/libs/ardour/ardour/vst3_plugin.h +++ b/libs/ardour/ardour/vst3_plugin.h @@ -148,6 +148,8 @@ public: Vst::ProcessContext& context () { return _context; } + void set_owner (ARDOUR::SessionObject* o); + void enable_io (std::vector const&, std::vector const&); void process (float** ins, float** outs, uint32_t n_samples); @@ -233,6 +235,8 @@ private: boost::optional _plugin_latency; + ARDOUR::SessionObject* _owner; + int _n_inputs; int _n_outputs; int _n_aux_inputs; @@ -292,6 +296,8 @@ public: int set_block_size (pframes_t); + void set_owner (ARDOUR::SessionObject* o); + int connect_and_run (BufferSet& bufs, samplepos_t start, samplepos_t end, double speed, ChanMapping const& in, ChanMapping const& out, diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index e480f5804e..d1d5ba8378 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -516,6 +516,13 @@ VST3Plugin::set_state (const XMLNode& node, int version) /* ****************************************************************************/ +void +VST3Plugin::set_owner (ARDOUR::SessionObject* o) +{ + Plugin::set_owner (o); + _plug->set_owner (o); +} + int VST3Plugin::set_block_size (pframes_t n_samples) { @@ -943,6 +950,7 @@ VST3PI::VST3PI (boost::shared_ptr m, std::string uniqu , _is_processing (false) , _block_size (0) , _port_id_bypass (UINT32_MAX) + , _owner (0) , _n_factory_presets (0) { using namespace std; @@ -1450,6 +1458,12 @@ VST3PI::plugin_latency () return _plugin_latency.value (); } +void +VST3PI::set_owner (SessionObject* o) +{ + _owner = o; +} + int32 VST3PI::count_channels (Vst::MediaType media, Vst::BusDirection dir, Vst::BusType type) {