X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fladspa_plugin.h;h=97744abc341398039a08620d850cac978774e4f4;hb=c656aaab3c0c66ea0cde210950af341a3d71c559;hp=4444686dcb6b24dada4f40c92c46ede315804b4b;hpb=d15fda6d751a465d278f477923075d4783f3b1ca;p=ardour.git diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h index 4444686dcb..97744abc34 100644 --- a/libs/ardour/ardour/ladspa_plugin.h +++ b/libs/ardour/ardour/ladspa_plugin.h @@ -23,12 +23,11 @@ #include #include #include -#include +#include #include "pbd/stateful.h" -#include #include "ardour/ladspa.h" #include "ardour/plugin.h" @@ -39,7 +38,7 @@ class Session; class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin { public: - LadspaPlugin (void *module, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, framecnt_t sample_rate); + LadspaPlugin (std::string module_path, ARDOUR::AudioEngine&, ARDOUR::Session&, uint32_t index, samplecnt_t sample_rate); LadspaPlugin (const LadspaPlugin &); ~LadspaPlugin (); @@ -50,8 +49,8 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin const char* name() const { return _descriptor->Name; } const char* maker() const { return _descriptor->Maker; } uint32_t parameter_count() const { return _descriptor->PortCount; } - float default_value (uint32_t port); - framecnt_t signal_latency() const; + float default_value (uint32_t port) { return _default_value (port); } + samplecnt_t signal_latency() const; void set_parameter (uint32_t port, float val); float get_parameter (uint32_t port) const; int get_parameter_descriptor (uint32_t which, ParameterDescriptor&) const; @@ -84,8 +83,9 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin int set_block_size (pframes_t /*nframes*/) { return 0; } int connect_and_run (BufferSet& bufs, + samplepos_t start, samplepos_t end, double speed, ChanMapping in, ChanMapping out, - pframes_t nframes, framecnt_t offset); + pframes_t nframes, samplecnt_t offset); std::string describe_parameter (Evoral::Parameter); std::string state_node_name() const { return "ladspa"; } @@ -97,7 +97,7 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin bool parameter_is_output(uint32_t) const; bool parameter_is_toggled(uint32_t) const; - boost::shared_ptr + boost::shared_ptr get_scale_points(uint32_t port_index) const; int set_state (const XMLNode&, int version); @@ -106,8 +106,6 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin bool has_editor() const { return false; } - int require_output_streams (uint32_t); - /* LADSPA extras */ LADSPA_Properties properties() const { return _descriptor->Properties; } @@ -122,10 +120,12 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin void connect_port (uint32_t port, float *ptr) { _descriptor->connect_port (_handle, port, ptr); } private: - void* _module; + float _default_value (uint32_t port) const; + std::string _module_path; + Glib::Module* _module; const LADSPA_Descriptor* _descriptor; LADSPA_Handle _handle; - framecnt_t _sample_rate; + samplecnt_t _sample_rate; LADSPA_Data* _control_data; LADSPA_Data* _shadow_data; LADSPA_Data* _latency_control_port; @@ -134,7 +134,7 @@ class LIBARDOUR_API LadspaPlugin : public ARDOUR::Plugin void find_presets (); - void init (void *mod, uint32_t index, framecnt_t rate); + void init (std::string module_path, uint32_t index, samplecnt_t rate); void run_in_place (pframes_t nsamples); void latency_compute_run (); int set_state_2X (const XMLNode&, int version); @@ -151,7 +151,15 @@ class LIBARDOUR_API LadspaPluginInfo : public PluginInfo { LadspaPluginInfo (); ~LadspaPluginInfo () { }; + bool is_instrument () const { return false; } /* ladspa's are never instruments */ +#ifdef MIXBUS + /* for mixbus, relegate ladspa's to the Utils folder. */ + bool is_effect () const { return false; } + bool is_utility () const { return true; } +#endif + PluginPtr load (Session& session); + std::vector get_presets (bool user_only) const; }; typedef boost::shared_ptr LadspaPluginInfoPtr;