diff options
author | David Robillard <d@drobilla.net> | 2008-01-19 03:49:52 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-01-19 03:49:52 +0000 |
commit | 4ca1fe7993adf63ea3f35958f63dd20ee546e7ae (patch) | |
tree | f773e6cf00e08a8260c2e2b28b8e16e28b39b887 /libs/ardour/ardour | |
parent | f80fad313a21228f31201279cccaf555796c7eec (diff) |
Merge with trunk R2935.
git-svn-id: svn://localhost/ardour2/branches/3.0@2943 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_unit.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/io.h | 6 | ||||
-rw-r--r-- | libs/ardour/ardour/ladspa_plugin.h | 16 | ||||
-rw-r--r-- | libs/ardour/ardour/lv2_plugin.h | 138 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_manager.h | 19 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 1 |
7 files changed, 168 insertions, 23 deletions
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index 115e008a54..c781e8200d 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -144,9 +144,9 @@ class AUPluginInfo : public PluginInfo { private: boost::shared_ptr<CAComponentDescription> descriptor; - static void discover_music (PluginInfoList&); - static void discover_fx (PluginInfoList&); - static void discover_by_description (PluginInfoList&, CAComponentDescription&); + static void discover_music (PluginInfoList&); + static void discover_fx (PluginInfoList&); + static void discover_by_description (PluginInfoList&, CAComponentDescription&); }; typedef boost::shared_ptr<AUPluginInfo> AUPluginInfoPtr; diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 0ae9cef55a..bd3cfcc30e 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -95,6 +95,9 @@ class IO : public Automatable, public Latent void set_output_minimum (ChanCount n); void set_output_maximum (ChanCount n); + bool active() const { return _active; } + void set_active (bool yn); + DataType default_type() const { return _default_type; } void set_default_type(DataType t) { _default_type = t; } @@ -184,6 +187,8 @@ class IO : public Automatable, public Latent const ChanCount& n_outputs () const { return _outputs.count(); } void attach_buffers(ChanCount ignored); + + sigc::signal<void> active_changed; sigc::signal<void,IOChange,void*> input_changed; sigc::signal<void,IOChange,void*> output_changed; @@ -268,6 +273,7 @@ class IO : public Automatable, public Latent protected: Panner* _panner; BufferSet* _output_buffers; //< Set directly to output port buffers + bool _active; gain_t _gain; gain_t _effective_gain; gain_t _desired_gain; diff --git a/libs/ardour/ardour/ladspa_plugin.h b/libs/ardour/ardour/ladspa_plugin.h index 976584b687..b26e4120b1 100644 --- a/libs/ardour/ardour/ladspa_plugin.h +++ b/libs/ardour/ardour/ladspa_plugin.h @@ -20,7 +20,6 @@ #ifndef __ardour_ladspa_plugin_h__ #define __ardour_ladspa_plugin_h__ -#include <list> #include <set> #include <vector> #include <string> @@ -33,11 +32,6 @@ #include <jack/types.h> #include <ardour/ladspa.h> #include <ardour/plugin.h> -#include <ardour/ladspa_plugin.h> - -using std::string; -using std::vector; -using std::list; namespace ARDOUR { class AudioEngine; @@ -90,10 +84,10 @@ class LadspaPlugin : public ARDOUR::Plugin void set_block_size (nframes_t nframes) {} - int connect_and_run (BufferSet& bufs, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset); - string describe_parameter (Parameter); - string state_node_name() const { return "ladspa"; } - void print_parameter (uint32_t, char*, uint32_t len) const; + int connect_and_run (BufferSet& bufs, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset); + std::string describe_parameter (Parameter); + std::string state_node_name() const { return "ladspa"; } + void print_parameter (uint32_t, char*, uint32_t len) const; bool parameter_is_audio(uint32_t) const; bool parameter_is_control(uint32_t) const; @@ -103,7 +97,7 @@ class LadspaPlugin : public ARDOUR::Plugin XMLNode& get_state(); int set_state(const XMLNode& node); - bool save_preset(string name); + bool save_preset(std::string name); bool has_editor() const { return false; } diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h new file mode 100644 index 0000000000..40b3c669fa --- /dev/null +++ b/libs/ardour/ardour/lv2_plugin.h @@ -0,0 +1,138 @@ +/* + Copyright (C) 2008 Paul Davis + Author: Dave Robillard + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __ardour_lv2_plugin_h__ +#define __ardour_lv2_plugin_h__ + +#include <set> +#include <vector> +#include <string> +#include <dlfcn.h> + +#include <sigc++/signal.h> + +#include <pbd/stateful.h> + +#include <jack/types.h> +#include <slv2/slv2.h> +#include <ardour/plugin.h> + +namespace ARDOUR { +class AudioEngine; +class Session; + +class LV2Plugin : public ARDOUR::Plugin +{ + public: + LV2Plugin (ARDOUR::AudioEngine&, ARDOUR::Session&, SLV2Plugin plugin, nframes_t sample_rate); + LV2Plugin (const LV2Plugin &); + ~LV2Plugin (); + + /* Plugin interface */ + + std::string unique_id() const; + const char* label() const { return slv2_plugin_get_name(_plugin); } + const char* name() const { return slv2_plugin_get_name(_plugin); } + const char* maker() const { return slv2_plugin_get_author_name(_plugin); } + uint32_t parameter_count() const { return slv2_plugin_get_num_ports(_plugin); } + float default_value (uint32_t port); + nframes_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; + uint32_t nth_parameter (uint32_t port, bool& ok) const; + + std::set<Parameter> automatable() const; + + void activate () { + if (!_was_activated) { + slv2_instance_activate(_instance); + _was_activated = true; + } + } + + void deactivate () { + if (_was_activated) { + slv2_instance_deactivate(_instance); + _was_activated = false; + } + } + + void cleanup () { + activate(); + deactivate(); + slv2_instance_free(_instance); + _instance = NULL; + } + + void set_block_size (nframes_t nframes) {} + + int connect_and_run (BufferSet& bufs, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset); + std::string describe_parameter (Parameter); + std::string state_node_name() const { return "lv2"; } + void print_parameter (uint32_t, char*, uint32_t len) const; + + bool parameter_is_audio(uint32_t) const; + bool parameter_is_control(uint32_t) const; + bool parameter_is_input(uint32_t) const; + bool parameter_is_output(uint32_t) const; + bool parameter_is_toggled(uint32_t) const; + + XMLNode& get_state(); + int set_state(const XMLNode& node); + bool save_preset(std::string name); + + bool has_editor() const { return false; } + + int require_output_streams (uint32_t); + + private: + void* _module; + SLV2Plugin _plugin; + SLV2Template _template; + SLV2Instance _instance; + nframes_t _sample_rate; + float* _control_data; + float* _shadow_data; + float* _latency_control_port; + bool _was_activated; + vector<bool> _port_is_input; + + void init (SLV2Plugin plugin, nframes_t rate); + void run (nframes_t nsamples); + void latency_compute_run (); +}; + +class LV2PluginInfo : public PluginInfo { +public: + LV2PluginInfo (void* slv2_plugin);; + ~LV2PluginInfo ();; + static PluginInfoList discover (void* slv2_world); + + PluginPtr load (Session& session); + + void* _slv2_plugin; +}; + +typedef boost::shared_ptr<LV2PluginInfo> LV2PluginInfoPtr; + +} // namespace ARDOUR + +#endif /* __ardour_lv2_plugin_h__ */ diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index 64b871104b..dd50a079e3 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -27,20 +27,23 @@ #include <ardour/types.h> #include <ardour/plugin.h> +#ifdef HAVE_SLV2 +#include <slv2/slv2.h> +#endif + namespace ARDOUR { class Plugin; -class Session; -class AudioEngine; class PluginManager { public: PluginManager (); ~PluginManager (); - ARDOUR::PluginInfoList &vst_plugin_info () { return _vst_plugin_info; } + ARDOUR::PluginInfoList &vst_plugin_info () { return _vst_plugin_info; } ARDOUR::PluginInfoList &ladspa_plugin_info () { return _ladspa_plugin_info; } - ARDOUR::PluginInfoList &au_plugin_info () { return _au_plugin_info; } + ARDOUR::PluginInfoList &lv2_plugin_info () { return _lv2_plugin_info; } + ARDOUR::PluginInfoList &au_plugin_info () { return _au_plugin_info; } void refresh (); @@ -52,7 +55,12 @@ class PluginManager { private: ARDOUR::PluginInfoList _vst_plugin_info; ARDOUR::PluginInfoList _ladspa_plugin_info; + ARDOUR::PluginInfoList _lv2_plugin_info; ARDOUR::PluginInfoList _au_plugin_info; + +#ifdef HAVE_SLV2 + SLV2World _lv2_world; +#endif std::map<uint32_t, std::string> rdf_type; @@ -69,6 +77,9 @@ class PluginManager { int au_discover (); void au_refresh (); + + int lv2_discover (); + void lv2_refresh (); int vst_discover_from_path (std::string path); int vst_discover (std::string path); diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index d2e40501f1..2466f37996 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -110,9 +110,6 @@ class Route : public IO void set_gain (gain_t val, void *src); void inc_gain (gain_t delta, void *src); - bool active() const { return _active; } - void set_active (bool yn); - void set_solo (bool yn, void *src); bool soloed() const { return _soloed; } @@ -203,7 +200,6 @@ class Route : public IO sigc::signal<void,void*> record_enable_changed; sigc::signal<void,void*> edit_group_changed; sigc::signal<void,void*> mix_group_changed; - sigc::signal<void> active_changed; sigc::signal<void,void*> meter_change; sigc::signal<void> signal_latency_changed; sigc::signal<void> initial_delay_changed; @@ -280,7 +276,6 @@ class Route : public IO bool _soloed : 1; bool _solo_safe : 1; bool _recordable : 1; - bool _active : 1; bool _mute_affects_pre_fader : 1; bool _mute_affects_post_fader : 1; bool _mute_affects_control_outs : 1; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index dd151abaf6..cc756b0ec6 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -350,6 +350,7 @@ namespace ARDOUR { enum PluginType { AudioUnit, LADSPA, + LV2, VST }; |