19 #ifndef _ardour_vst3_plugin_h_
20 #define _ardour_vst3_plugin_h_
27 #include <glibmm/threads.h>
37 class VST3PluginModule;
41 #if defined(__clang__)
42 # pragma clang diagnostic push
43 # pragma clang diagnostic ignored "-Wnon-virtual-dtor"
44 # pragma clang diagnostic ignored "-Wdelete-non-virtual-dtor"
45 # pragma clang diagnostic ignored "-Wdelete-non-abstract-non-virtual-dtor"
46 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
47 # pragma GCC diagnostic push
48 # pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
49 # pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
59 :
public Vst::IComponentHandler
60 ,
public Vst::IComponentHandler2
61 ,
public Vst::IUnitHandler
63 ,
public Presonus::IContextInfoProvider3
66 VST3PI (std::shared_ptr<ARDOUR::VST3PluginModule> m, std::string unique_id);
70 tresult PLUGIN_API
beginEdit (Vst::ParamID
id) SMTG_OVERRIDE;
71 tresult PLUGIN_API
performEdit (Vst::ParamID
id, Vst::ParamValue value) SMTG_OVERRIDE;
72 tresult PLUGIN_API
endEdit (Vst::ParamID
id) SMTG_OVERRIDE;
76 tresult PLUGIN_API
setDirty (TBool state) SMTG_OVERRIDE;
79 tresult PLUGIN_API finishGroupEdit () SMTG_OVERRIDE;
82 tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* newSize) SMTG_OVERRIDE;
85 tresult PLUGIN_API notifyUnitSelection (Vst::UnitID) SMTG_OVERRIDE;
86 tresult PLUGIN_API notifyProgramListChange (Vst::ProgramListID, int32) SMTG_OVERRIDE;
89 tresult PLUGIN_API getContextInfoValue (int32&, FIDString) SMTG_OVERRIDE;
90 tresult PLUGIN_API getContextInfoString (Vst::TChar*, int32, FIDString) SMTG_OVERRIDE;
91 tresult PLUGIN_API getContextInfoValue (
double&, FIDString) SMTG_OVERRIDE;
92 tresult PLUGIN_API setContextInfoValue (FIDString,
double) SMTG_OVERRIDE;
93 tresult PLUGIN_API setContextInfoValue (FIDString, int32) SMTG_OVERRIDE;
94 tresult PLUGIN_API setContextInfoString (FIDString, Vst::TChar*) SMTG_OVERRIDE;
95 tresult PLUGIN_API beginEditContextInfoValue (FIDString) SMTG_OVERRIDE;
96 tresult PLUGIN_API endEditContextInfoValue (FIDString) SMTG_OVERRIDE;
99 bool has_editor () const;
102 void update_contoller_param ();
105 tresult PLUGIN_API queryInterface (const TUID _iid,
void** obj) SMTG_OVERRIDE;
106 uint32 PLUGIN_API addRef () SMTG_OVERRIDE {
return 1; }
107 uint32 PLUGIN_API
release () SMTG_OVERRIDE {
return 1; }
109 FUID
const&
fuid ()
const {
return _fuid; }
143 AudioBusInfo (Vst::BusType t, int32_t c,
bool a) : type (t), n_chn (c), n_used_chn (c), dflt (a) {}
151 std::map<int, AudioBusInfo>
const&
bus_info_in ()
const {
return _bus_info_in; }
152 std::map<int, AudioBusInfo>
const&
bus_info_out ()
const {
return _bus_info_out; }
164 void set_parameter (uint32_t p,
float value, int32 sample_off,
bool to_list =
true,
bool force =
false);
189 bool active ()
const {
return _is_processing; }
204 void enable_io (std::vector<bool>
const&, std::vector<bool>
const&);
206 void process (
float** ins,
float** outs, uint32_t n_samples);
221 _impl->block_notifications ();
226 _impl->resume_notifications ();
272 std::shared_ptr<ARDOUR::VST3PluginModule>
_module;
319 std::vector<ARDOUR::Plugin::IOPortDescription> _io_name[Vst::kNumMediaTypes][2];
379 std::string
unique_id ()
const {
return get_info ()->unique_id; }
380 const char*
name ()
const {
return get_info ()->name.c_str (); }
381 const char*
label ()
const {
return get_info ()->name.c_str (); }
382 const char*
maker ()
const {
return get_info ()->creator.c_str (); }
426 _plug->deactivate ();
467 PV () : port (0), val (0) {}
468 PV (uint32_t p,
float v) : port (p), val (v) {}
485 std::vector<Plugin::PresetRecord>
get_presets (
bool user_only)
const;
491 std::shared_ptr<VST3PluginModule>
m;
494 #if defined(__clang__)
495 # pragma clang diagnostic pop
496 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
497 # pragma GCC diagnostic pop
std::optional< bool > has_editor
PluginPtr load(Session &session)
std::vector< Plugin::PresetRecord > get_presets(bool user_only) const
std::shared_ptr< VST3PluginModule > m
bool is_instrument() const
PBD::Searchpath preset_search_path() const
IOPortDescription describe_io_port(DataType dt, bool input, uint32_t id) const
samplecnt_t plugin_latency() const
std::map< std::string, std::string > _preset_uri_map
void set_automation_control(uint32_t, std::shared_ptr< ARDOUR::AutomationControl >)
PBD::Signal< void(int, int)> OnResizeView
uint32_t parameter_count() const
PBD::RingBufferNPT< PV > _parameter_queue
bool parameter_is_input(uint32_t) const
std::string unique_id() const
bool parameter_is_audio(uint32_t) const
float default_value(uint32_t port)
std::string state_node_name() const
bool load_preset(PresetRecord)
int set_block_size(pframes_t)
bool parameter_is_output(uint32_t) const
void do_remove_preset(std::string)
void add_state(XMLNode *) const
PluginOutputConfiguration possible_output() const
VST3Plugin(AudioEngine &, Session &, Steinberg::VST3PI *)
bool parameter_is_control(uint32_t) const
PBD::ScopedConnectionList _connections
void add_slave(std::shared_ptr< Plugin >, bool)
const char * maker() const
uint32_t designated_bypass_port()
VST3Plugin(const VST3Plugin &)
Steinberg::VST3PI * _plug
bool print_parameter(uint32_t, std::string &) const
int connect_and_run(BufferSet &bufs, samplepos_t start, samplepos_t end, double speed, ChanMapping const &in, ChanMapping const &out, pframes_t nframes, samplecnt_t offset)
samplecnt_t plugin_tailtime() const
void parameter_change_handler(Steinberg::VST3PI::ParameterChange, uint32_t, float)
std::string do_save_preset(std::string)
void forward_resize_view(int w, int h)
uint32_t nth_parameter(uint32_t port, bool &ok) const
const char * name() const
void set_parameter(uint32_t port, float val, sampleoffset_t when)
std::string describe_parameter(Evoral::Parameter)
const char * label() const
float get_parameter(uint32_t port) const
int get_parameter_descriptor(uint32_t which, ParameterDescriptor &) const
std::set< Evoral::Parameter > automatable() const
Steinberg::IPlugView * view()
std::vector< bool > _connected_inputs
std::vector< bool > _connected_outputs
int set_state(const XMLNode &, int version)
void set_owner(ARDOUR::SessionObject *o)
void set_non_realtime(bool)
void update_contoller_param()
void remove_slave(std::shared_ptr< Plugin >)
RouteProcessorChangeBlock(VST3PI *p)
~RouteProcessorChangeBlock()
std::string format_parameter(uint32_t p) const
tresult PLUGIN_API setDirty(TBool state) SMTG_OVERRIDE
Glib::Threads::Mutex _process_lock
tresult PLUGIN_API endEdit(Vst::ParamID id) SMTG_OVERRIDE
Vst::ProcessContext & context()
void set_parameter_by_id(Vst::ParamID id, float value, int32 sample_off)
bool live_midi_cc(int32_t, int16_t, Vst::CtrlNumber)
bool setup_info_listener()
std::set< Evoral::Parameter > _ac_subscriptions
bool setup_psl_info_handler()
std::string print_parameter(uint32_t p) const
Vst3ParameterChanges _input_param_changes
ARDOUR::Plugin::IOPortDescription describe_io_port(ARDOUR::DataType dt, bool input, uint32_t id) const
uint32_t n_audio_aux_in() const
void resume_notifications()
int32 count_channels(Vst::MediaType, Vst::BusDirection, Vst::BusType)
Vst::ParameterInfo _program_change_port
std::string print_parameter(Vst::ParamID, Vst::ParamValue) const
FUID const & fuid() const
std::map< int, AudioBusInfo > _bus_info_in
Vst3EventList _input_events
std::optional< uint32_t > _plugin_latency
std::map< Vst::ParamID, uint32_t > _ctrl_id_index
std::vector< Param > _ctrl_params
float get_parameter(uint32_t p) const
std::shared_ptr< ARDOUR::VST3PluginModule > _module
std::vector< bool > _update_ctrl
bool save_state(RAMStream &stream)
uint32_t n_audio_aux_out() const
void add_event(Evoral::Event< samplepos_t > const &, int32_t bus)
std::shared_ptr< ConnectionProxy > _component_cproxy
void set_n_factory_presets(size_t n)
Glib::Threads::Mutex & process_lock()
ARDOUR::SessionObject * _owner
void set_parameter_internal(Vst::ParamID id, float value, int32 sample_off)
bool synchronize_states()
IPlugView * try_create_view() const
uint32_t parameter_count() const
Vst3EventList _output_events
bool parameter_is_readonly(uint32_t p) const
void process(float **ins, float **outs, uint32_t n_samples)
std::atomic< int > _block_rpc
std::vector< bool > _enabled_audio_out
void automation_state_changed(uint32_t, ARDOUR::AutoState, std::weak_ptr< ARDOUR::AutomationList >)
size_t n_factory_presets() const
tresult PLUGIN_API startGroupEdit() SMTG_OVERRIDE
std::map< int, AudioBusInfo > const & bus_info_out() const
IPtr< Vst::IUnitInfo > unit_info()
void set_owner(ARDOUR::SessionObject *o)
void set_non_realtime(bool)
void send_processors_changed(ARDOUR::RouteProcessorChange const &)
bool evoral_to_vst3(Vst::Event &, Evoral::Event< samplepos_t > const &, int32_t)
bool midi_controller(int32_t, int16_t, Vst::CtrlNumber, Vst::ParamID &id)
bool set_block_size(int32_t)
bool load_state(RAMStream &stream)
uint32_t n_audio_inputs(bool with_aux=true) const
void forward_signal(Presonus::IContextInfoHandler2 *, FIDString) const
void set_parameter(uint32_t p, float value, int32 sample_off, bool to_list=true, bool force=false)
void enable_io(std::vector< bool > const &, std::vector< bool > const &)
bool parameter_is_automatable(uint32_t p) const
bool & component_is_synced()
uint32_t plugin_tailtime()
PBD::ScopedConnectionList _ac_connection_list
std::map< int, AudioBusInfo > const & bus_info_in() const
uint32_t plugin_latency()
uint32_t n_midi_outputs() const
uint32 PLUGIN_API release() SMTG_OVERRIDE
std::vector< Vst::AudioBusBuffers > _busbuf_out
std::shared_ptr< ConnectionProxy > _controller_cproxy
std::vector< Vst::AudioBusBuffers > _busbuf_in
std::map< int, int > _n_buschn_out
bool remove_slave(Vst::IEditController *)
Vst::ParameterInfo const & program_change_port() const
PBD::ScopedConnectionList _strip_connections
Vst::ParamID index_to_id(uint32_t) const
VST3PI(std::shared_ptr< ARDOUR::VST3PluginModule > m, std::string unique_id)
void psl_subscribe_to(std::shared_ptr< ARDOUR::AutomationControl >, FIDString)
void vst3_to_midi_buffers(ARDOUR::BufferSet &, ARDOUR::ChanMapping const &)
ARDOUR::RouteProcessorChange _rpc_queue
uint32_t n_audio_outputs(bool with_aux=true) const
PBD::Signal< void(ParameterChange, uint32_t, float)> OnParameterChange
bool add_slave(Vst::IEditController *, bool)
tresult PLUGIN_API requestOpenEditor(FIDString name) SMTG_OVERRIDE
Vst::IEditController * controller() const
bool try_set_parameter_by_id(Vst::ParamID id, float value)
tresult PLUGIN_API restartComponent(int32 flags) SMTG_OVERRIDE
Vst3ParameterChanges _output_param_changes
std::string parameter_label(uint32_t p) const
tresult PLUGIN_API performEdit(Vst::ParamID id, Vst::ParamValue value) SMTG_OVERRIDE
std::optional< uint32_t > _plugin_tail
std::vector< bool > _enabled_audio_in
std::map< uint32_t, Vst::ParamID > _ctrl_index_id
uint32_t n_midi_inputs() const
void get_parameter_descriptor(uint32_t, ARDOUR::ParameterDescriptor &) const
bool _restart_component_is_synced
Vst::ProcessContext _context
IPtr< Vst::IAudioProcessor > _processor
void set_event_bus_state(bool enabled)
std::map< int, int > _n_buschn_in
Vst::IEditController * _controller
Vst::IComponent * _component
bool subscribe_to_automation_changes() const
void block_notifications()
bool is_loading_state() const
tresult PLUGIN_API beginEdit(Vst::ParamID id) SMTG_OVERRIDE
std::map< int, AudioBusInfo > _bus_info_out
bool disconnect_components()
void stripable_property_changed(PBD::PropertyChange const &)
void psl_stripable_property_changed(PBD::PropertyChange const &)
bool connect_components()
std::atomic< bool > _in_set_owner
void update_shadow_data()
float default_value(uint32_t p) const
uint32_t designated_bypass_port() const
bool set_program(int p, int32 sample_off)
std::vector< float > _shadow_data
GtkImageIconNameData name
void session(lua_State *L)
PBD::PropertyDescriptor< timepos_t > start
std::shared_ptr< Plugin > PluginPtr
Temporal::samplecnt_t samplecnt_t
Temporal::sampleoffset_t sampleoffset_t
Temporal::samplepos_t samplepos_t
std::set< uint32_t > PluginOutputConfiguration
PBD::Signal< void(Parser &, byte *, size_t)> Signal
AudioBusInfo(Vst::BusType t, int32_t c, bool a)