diff options
Diffstat (limited to 'src/libs/engine')
39 files changed, 153 insertions, 197 deletions
diff --git a/src/libs/engine/ClientBroadcaster.cpp b/src/libs/engine/ClientBroadcaster.cpp index ce916ca9..363b9f09 100644 --- a/src/libs/engine/ClientBroadcaster.cpp +++ b/src/libs/engine/ClientBroadcaster.cpp @@ -25,7 +25,7 @@ #include "util.hpp" #include "Patch.hpp" #include "NodeImpl.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Port.hpp" #include "Connection.hpp" #include "AudioDriver.hpp" @@ -100,12 +100,12 @@ ClientBroadcaster::send_error(const string& msg) } void -ClientBroadcaster::send_plugins_to(ClientInterface* client, const list<Plugin*>& plugin_list) +ClientBroadcaster::send_plugins_to(ClientInterface* client, const list<PluginImpl*>& plugin_list) { client->transfer_begin(); - for (list<Plugin*>::const_iterator i = plugin_list.begin(); i != plugin_list.end(); ++i) { - const Plugin* const plugin = *i; + for (list<PluginImpl*>::const_iterator i = plugin_list.begin(); i != plugin_list.end(); ++i) { + const PluginImpl* const plugin = *i; client->new_plugin(plugin->uri(), plugin->type_uri(), plugin->name()); } @@ -114,7 +114,7 @@ ClientBroadcaster::send_plugins_to(ClientInterface* client, const list<Plugin*>& void -ClientBroadcaster::send_plugins(const list<Plugin*>& plugin_list) +ClientBroadcaster::send_plugins(const list<PluginImpl*>& plugin_list) { for (Clients::const_iterator c = _clients.begin(); c != _clients.end(); ++c) send_plugins_to((*c).second, plugin_list); diff --git a/src/libs/engine/ClientBroadcaster.hpp b/src/libs/engine/ClientBroadcaster.hpp index a40b2579..50589005 100644 --- a/src/libs/engine/ClientBroadcaster.hpp +++ b/src/libs/engine/ClientBroadcaster.hpp @@ -32,7 +32,7 @@ namespace Ingen { class NodeImpl; class Port; -class Plugin; +class PluginImpl; class Patch; class Connection; using Shared::ClientInterface; @@ -61,7 +61,7 @@ public: // Error that isn't the direct result of a request void send_error(const string& msg); - void send_plugins(const std::list<Plugin*>& plugin_list); + void send_plugins(const std::list<PluginImpl*>& plugin_list); void send_patch(const Patch* const p, bool recursive); void send_node(const NodeImpl* const node, bool recursive); void send_port(const Port* port); @@ -80,7 +80,7 @@ public: void send_program_add(const string& node_path, int bank, int program, const string& name); void send_program_remove(const string& node_path, int bank, int program); - void send_plugins_to(ClientInterface*, const std::list<Plugin*>& plugin_list); + void send_plugins_to(ClientInterface*, const std::list<PluginImpl*>& plugin_list); private: typedef std::map<string, ClientInterface*> Clients; diff --git a/src/libs/engine/DSSINode.cpp b/src/libs/engine/DSSINode.cpp index 1140d9bb..33f8b86c 100644 --- a/src/libs/engine/DSSINode.cpp +++ b/src/libs/engine/DSSINode.cpp @@ -30,7 +30,7 @@ using namespace std; namespace Ingen { -DSSINode::DSSINode(const Plugin* plugin, const string& name, bool polyphonic, Patch* parent, DSSI_Descriptor* descriptor, SampleRate srate, size_t buffer_size) +DSSINode::DSSINode(const PluginImpl* plugin, const string& name, bool polyphonic, Patch* parent, DSSI_Descriptor* descriptor, SampleRate srate, size_t buffer_size) : LADSPANode(plugin, name, 1, parent, descriptor->LADSPA_Plugin, srate, buffer_size), _dssi_descriptor(descriptor), _ui_addr(NULL), diff --git a/src/libs/engine/DSSINode.hpp b/src/libs/engine/DSSINode.hpp index 4cf034b5..38d7ea3d 100644 --- a/src/libs/engine/DSSINode.hpp +++ b/src/libs/engine/DSSINode.hpp @@ -40,7 +40,7 @@ public: typedef std::map<int, string> Bank; - DSSINode(const Plugin* plugin, const string& name, bool polyphonic, Patch* parent, DSSI_Descriptor* descriptor, SampleRate srate, size_t buffer_size); + DSSINode(const PluginImpl* plugin, const string& name, bool polyphonic, Patch* parent, DSSI_Descriptor* descriptor, SampleRate srate, size_t buffer_size); ~DSSINode(); bool instantiate(); @@ -62,9 +62,6 @@ public: void set_default_program(); const std::map<int, Bank>& get_programs() const; - const Plugin* plugin() const { return _plugin; } - void plugin(const Plugin* const pi) { _plugin = pi; } - private: bool has_midi_input() const; diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp index 88ad5738..6ddead2b 100644 --- a/src/libs/engine/LADSPANode.cpp +++ b/src/libs/engine/LADSPANode.cpp @@ -23,9 +23,11 @@ #include "AudioBuffer.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ProcessContext.hpp" +using namespace std; + namespace Ingen { @@ -34,7 +36,7 @@ namespace Ingen { * Object is not usable until instantiate() is called with success. * (It _will_ crash!) */ -LADSPANode::LADSPANode(const Plugin* plugin, const string& path, bool polyphonic, Patch* parent, const LADSPA_Descriptor* descriptor, SampleRate srate, size_t buffer_size) +LADSPANode::LADSPANode(const PluginImpl* plugin, const string& path, bool polyphonic, Patch* parent, const LADSPA_Descriptor* descriptor, SampleRate srate, size_t buffer_size) : NodeBase(plugin, path, polyphonic, parent, srate, buffer_size), _descriptor(descriptor), _instances(NULL) diff --git a/src/libs/engine/LADSPANode.hpp b/src/libs/engine/LADSPANode.hpp index 46b03792..493645a5 100644 --- a/src/libs/engine/LADSPANode.hpp +++ b/src/libs/engine/LADSPANode.hpp @@ -22,7 +22,7 @@ #include <ladspa.h> #include "types.hpp" #include "NodeBase.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" namespace Ingen { @@ -34,7 +34,14 @@ namespace Ingen { class LADSPANode : public NodeBase { public: - LADSPANode(const Plugin* plugin, const string& name, bool polyphonic, Patch* parent, const LADSPA_Descriptor* descriptor, SampleRate srate, size_t buffer_size); + LADSPANode(const PluginImpl* plugin, + const string& name, + bool polyphonic, + Patch* parent, + const LADSPA_Descriptor* descriptor, + SampleRate srate, + size_t buffer_size); + virtual ~LADSPANode(); virtual bool instantiate(); @@ -46,9 +53,6 @@ public: void set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf); - const Plugin* plugin() const { return _plugin; } - void plugin(const Plugin* const pi) { _plugin = pi; } - protected: //void get_port_vals(ulong port_index, PortInfo* info); void get_port_limits(unsigned long port_index, Sample& default_value, Sample& lower_bound, Sample& upper_bound); diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index 99d074e1..c37a2665 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -24,12 +24,14 @@ #include "LV2Node.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "AudioBuffer.hpp" #include "MidiBuffer.hpp" #include "OSCBuffer.hpp" #include "ProcessContext.hpp" +using namespace std; + namespace Ingen { @@ -38,12 +40,12 @@ namespace Ingen { * Object is not usable until instantiate() is called with success. * (It _will_ crash!) */ -LV2Node::LV2Node(const Plugin* plugin, - const string& name, - bool polyphonic, - Patch* parent, - SampleRate srate, - size_t buffer_size) +LV2Node::LV2Node(const PluginImpl* plugin, + const string& name, + bool polyphonic, + Patch* parent, + SampleRate srate, + size_t buffer_size) : NodeBase(plugin, name, polyphonic, parent, srate, buffer_size) , _lv2_plugin(plugin->slv2_plugin()) , _instances(NULL) diff --git a/src/libs/engine/LV2Node.hpp b/src/libs/engine/LV2Node.hpp index db72ffda..9e303be9 100644 --- a/src/libs/engine/LV2Node.hpp +++ b/src/libs/engine/LV2Node.hpp @@ -22,7 +22,7 @@ #include <slv2/slv2.h> #include "types.hpp" #include "NodeBase.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" namespace Ingen { @@ -34,12 +34,12 @@ namespace Ingen { class LV2Node : public NodeBase { public: - LV2Node(const Plugin* plugin, - const string& name, - bool polyphonic, - Patch* parent, - SampleRate srate, - size_t buffer_size); + LV2Node(const PluginImpl* plugin, + const string& name, + bool polyphonic, + Patch* parent, + SampleRate srate, + size_t buffer_size); virtual ~LV2Node(); diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am index 224bba24..5952a288 100644 --- a/src/libs/engine/Makefile.am +++ b/src/libs/engine/Makefile.am @@ -80,8 +80,8 @@ libingen_engine_la_SOURCES = \ OutputPort.hpp \ Patch.cpp \ Patch.hpp \ - Plugin.cpp \ - Plugin.hpp \ + PluginImpl.cpp \ + PluginImpl.hpp \ Port.cpp \ Port.hpp \ PostProcessor.cpp \ diff --git a/src/libs/engine/MidiControlNode.cpp b/src/libs/engine/MidiControlNode.cpp index 2e4fca1a..bf2564d0 100644 --- a/src/libs/engine/MidiControlNode.cpp +++ b/src/libs/engine/MidiControlNode.cpp @@ -22,7 +22,7 @@ #include "MidiLearnEvent.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "AudioBuffer.hpp" #include "ProcessContext.hpp" #include "util.hpp" @@ -31,7 +31,7 @@ namespace Ingen { MidiControlNode::MidiControlNode(const string& path, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size) -: NodeBase(new Plugin(Plugin::Internal, "ingen:control_node"), path, false, parent, srate, buffer_size), +: NodeBase(new PluginImpl(Plugin::Internal, "ingen:control_node"), path, false, parent, srate, buffer_size), _learning(false) { _ports = new Raul::Array<Port*>(7); @@ -64,7 +64,7 @@ MidiControlNode::MidiControlNode(const string& path, bool polyphonic, Patch* par _control_port = new OutputPort(this, "Out(CR)", 6, 1, DataType::FLOAT, 1); _ports->at(6) = _control_port; - Plugin* p = const_cast<Plugin*>(_plugin); + PluginImpl* p = const_cast<PluginImpl*>(_plugin); p->plug_label("midi_control_in"); assert(p->uri() == "ingen:control_node"); p->name("Ingen Control Node (MIDI)"); diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp index c4f53e58..b3d69ac2 100644 --- a/src/libs/engine/MidiNoteNode.cpp +++ b/src/libs/engine/MidiNoteNode.cpp @@ -25,7 +25,7 @@ #include "AudioBuffer.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "AudioDriver.hpp" #include "Patch.hpp" #include "ProcessContext.hpp" @@ -38,7 +38,7 @@ namespace Ingen { MidiNoteNode::MidiNoteNode(const string& path, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size) -: NodeBase(new Plugin(Plugin::Internal, "ingen:note_node"), path, polyphonic, parent, srate, buffer_size), +: NodeBase(new PluginImpl(Plugin::Internal, "ingen:note_node"), path, polyphonic, parent, srate, buffer_size), _voices(new Raul::Array<Voice>(_polyphony)), _prepared_voices(NULL), @@ -67,7 +67,7 @@ MidiNoteNode::MidiNoteNode(const string& path, bool polyphonic, Patch* parent, S _trig_port->set_metadata("ingen:default", 0.0f); _ports->at(4) = _trig_port; - Plugin* p = const_cast<Plugin*>(_plugin); + PluginImpl* p = const_cast<PluginImpl*>(_plugin); p->plug_label("note_in"); assert(p->uri() == "ingen:note_node"); p->name("Ingen Note Node (MIDI, OSC)"); diff --git a/src/libs/engine/MidiTriggerNode.cpp b/src/libs/engine/MidiTriggerNode.cpp index 04363b3d..7490fcc0 100644 --- a/src/libs/engine/MidiTriggerNode.cpp +++ b/src/libs/engine/MidiTriggerNode.cpp @@ -21,7 +21,7 @@ #include "AudioBuffer.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ProcessContext.hpp" #include "util.hpp" @@ -29,7 +29,7 @@ namespace Ingen { MidiTriggerNode::MidiTriggerNode(const string& path, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size) -: NodeBase(new Plugin(Plugin::Internal, "ingen:trigger_node"), path, false, parent, srate, buffer_size) +: NodeBase(new PluginImpl(Plugin::Internal, "ingen:trigger_node"), path, false, parent, srate, buffer_size) { _ports = new Raul::Array<Port*>(5); @@ -52,7 +52,7 @@ MidiTriggerNode::MidiTriggerNode(const string& path, bool polyphonic, Patch* par _vel_port = new OutputPort(this, "Velocity", 4, 1, DataType::FLOAT, _buffer_size); _ports->at(4) = _vel_port; - Plugin* p = const_cast<Plugin*>(_plugin); + PluginImpl* p = const_cast<PluginImpl*>(_plugin); p->plug_label("trigger_in"); assert(p->uri() == "ingen:trigger_node"); p->name("Ingen Trigger Node (MIDI, OSC)"); diff --git a/src/libs/engine/NodeBase.cpp b/src/libs/engine/NodeBase.cpp index 3d30d604..d5400cdf 100644 --- a/src/libs/engine/NodeBase.cpp +++ b/src/libs/engine/NodeBase.cpp @@ -22,7 +22,7 @@ #include <raul/List.hpp> #include <raul/Array.hpp> #include "util.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ClientBroadcaster.hpp" #include "Port.hpp" #include "Patch.hpp" @@ -33,7 +33,7 @@ using namespace std; namespace Ingen { -NodeBase::NodeBase(const Plugin* plugin, const string& name, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size) +NodeBase::NodeBase(const PluginImpl* plugin, const string& name, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size) : NodeImpl(parent, name, polyphonic), _plugin(plugin), _polyphony((polyphonic && parent) ? parent->internal_poly() : 1), diff --git a/src/libs/engine/NodeBase.hpp b/src/libs/engine/NodeBase.hpp index 833e4edd..2e4480b8 100644 --- a/src/libs/engine/NodeBase.hpp +++ b/src/libs/engine/NodeBase.hpp @@ -29,7 +29,7 @@ using std::string; namespace Ingen { -class Plugin; +class PluginImpl; class Patch; class ObjectStore; @@ -47,12 +47,12 @@ namespace Shared { class NodeBase : public NodeImpl { public: - NodeBase(const Plugin* plugin, - const string& name, - bool poly, - Patch* parent, - SampleRate rate, - size_t buffer_size); + NodeBase(const PluginImpl* plugin, + const string& name, + bool poly, + Patch* parent, + SampleRate rate, + size_t buffer_size); virtual ~NodeBase(); @@ -96,7 +96,8 @@ public: Raul::List<NodeImpl*>* dependants() { return _dependants; } void dependants(Raul::List<NodeImpl*>* l) { _dependants = l; } - virtual const Plugin* plugin() const { return _plugin; } + virtual const PluginImpl* plugin() const { return _plugin; } + virtual void plugin(const PluginImpl* const pi) { _plugin = pi; } /** A node's parent is always a patch, so static cast should be safe */ inline Patch* parent_patch() const { return (Patch*)_parent; } @@ -104,7 +105,7 @@ public: protected: virtual void signal_input_ready(); - const Plugin* _plugin; + const PluginImpl* _plugin; uint32_t _polyphony; SampleRate _srate; diff --git a/src/libs/engine/NodeFactory.cpp b/src/libs/engine/NodeFactory.cpp index 8be55161..3bbe87ff 100644 --- a/src/libs/engine/NodeFactory.cpp +++ b/src/libs/engine/NodeFactory.cpp @@ -27,7 +27,7 @@ #include "MidiTriggerNode.hpp" #include "MidiControlNode.hpp" #include "TransportNode.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Patch.hpp" #ifdef HAVE_SLV2 #include "LV2Node.hpp" @@ -62,16 +62,16 @@ NodeFactory::NodeFactory(Ingen::Shared::World* world) NodeImpl* n = NULL; n = new MidiNoteNode("foo", 1, parent, 1, 1); - _internal_plugins.push_back(new Plugin(n->plugin())); + _internal_plugins.push_back(new PluginImpl(n->plugin())); delete n; n = new MidiTriggerNode("foo", 1, parent, 1, 1); - _internal_plugins.push_back(new Plugin(n->plugin())); + _internal_plugins.push_back(new PluginImpl(n->plugin())); delete n; n = new MidiControlNode("foo", 1, parent, 1, 1); - _internal_plugins.push_back(new Plugin(n->plugin())); + _internal_plugins.push_back(new PluginImpl(n->plugin())); delete n; n = new TransportNode("foo", 1, parent, 1, 1); - _internal_plugins.push_back(new Plugin(n->plugin())); + _internal_plugins.push_back(new PluginImpl(n->plugin())); delete n; delete parent; @@ -80,7 +80,7 @@ NodeFactory::NodeFactory(Ingen::Shared::World* world) NodeFactory::~NodeFactory() { - for (list<Plugin*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) + for (list<PluginImpl*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) delete (*i); _plugins.clear(); @@ -111,10 +111,10 @@ NodeFactory::library(const string& path) } -const Plugin* +const PluginImpl* NodeFactory::plugin(const string& uri) { - for (list<Plugin*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) + for (list<PluginImpl*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) if ((*i)->uri() == uri) return (*i); @@ -126,13 +126,13 @@ NodeFactory::plugin(const string& uri) * * Do not use. */ -const Plugin* +const PluginImpl* NodeFactory::plugin(const string& type, const string& lib, const string& label) { if (type == "" || lib == "" || label == "") return NULL; - for (list<Plugin*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) + for (list<PluginImpl*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) if ((*i)->type_string() == type && (*i)->lib_name() == lib && (*i)->plug_label() == label) return (*i); @@ -176,16 +176,16 @@ NodeFactory::load_plugins() * Calls the load_*_plugin functions to actually do things, just a wrapper. */ NodeImpl* -NodeFactory::load_plugin(const Plugin* a_plugin, - const string& name, - bool polyphonic, - Patch* parent) +NodeFactory::load_plugin(const PluginImpl* a_plugin, + const string& name, + bool polyphonic, + Patch* parent) { assert(parent != NULL); assert(a_plugin); NodeImpl* r = NULL; - Plugin* plugin = NULL; + PluginImpl* plugin = NULL; const SampleRate srate = parent->sample_rate(); const size_t buffer_size = parent->buffer_size(); @@ -199,7 +199,7 @@ NodeFactory::load_plugin(const Plugin* a_plugin, if (a_plugin->uri().length() == 0) { assert(a_plugin->lib_name().length() > 0 && a_plugin->plug_label().length() > 0); //cerr << "Searching for: " << a_plugin->lib_name() << " : " << a_plugin->plug_label() << endl; - for (list<Plugin*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) { + for (list<PluginImpl*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) { //cerr << (*i)->lib_name() << " : " << (*i)->plug_label() << endl; if (a_plugin->lib_name() == (*i)->lib_name() && a_plugin->plug_label() == (*i)->plug_label()) { plugin = *i; @@ -208,7 +208,7 @@ NodeFactory::load_plugin(const Plugin* a_plugin, } } else { // Search by URI - for (list<Plugin*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) { + for (list<PluginImpl*>::iterator i = _plugins.begin(); i != _plugins.end(); ++i) { if (a_plugin->uri() == (*i)->uri()) { plugin = *i; break; @@ -263,7 +263,7 @@ NodeFactory::load_internal_plugin(const string& uri, assert(uri.length() > 6); assert(uri.substr(0, 6) == "ingen:"); - for (list<Plugin*>::iterator i = _internal_plugins.begin(); i != _internal_plugins.end(); ++i) + for (list<PluginImpl*>::iterator i = _internal_plugins.begin(); i != _internal_plugins.end(); ++i) if ((*i)->uri() == uri) return (*i)->instantiate(name, polyphonic, parent, srate, buffer_size); @@ -290,10 +290,10 @@ NodeFactory::load_lv2_plugins() assert(uri); //cerr << "\t" << uri << endl; - Plugin* plug = NULL; + PluginImpl* plug = NULL; bool found = false; - for (list<Plugin*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { + for (list<PluginImpl*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { if (!strcmp((*i)->uri().c_str(), uri)) { plug = (*i); found = true; @@ -302,7 +302,7 @@ NodeFactory::load_lv2_plugins() } if (!found) - plug = new Plugin(Plugin::LV2, uri); + plug = new PluginImpl(Plugin::LV2, uri); plug->slv2_plugin(lv2_plug); plug->module(NULL); // FIXME? @@ -335,8 +335,8 @@ NodeFactory::load_lv2_plugin(const string& plug_uri, size_t buffer_size) { // Find (internal) Plugin - Plugin* plugin = NULL; - list<Plugin*>::iterator i; + PluginImpl* plugin = NULL; + list<PluginImpl*>::iterator i; for (i = _plugins.begin(); i != _plugins.end(); ++i) { plugin = (*i); if ((*i)->uri() == plug_uri) break; @@ -428,7 +428,7 @@ NodeFactory::load_dssi_plugins() ld = descriptor->LADSPA_Plugin; assert(ld != NULL); string uri = string("dssi:") + pfile->d_name +":"+ ld->Label; - Plugin* plugin = new Plugin(Plugin::DSSI, uri); + PluginImpl* plugin = new PluginImpl(Plugin::DSSI, uri); assert(plugin_library != NULL); plugin->module(plugin_library); plugin->lib_path(dir + "/" + pfile->d_name); @@ -438,7 +438,7 @@ NodeFactory::load_dssi_plugins() plugin->id(ld->UniqueID); bool found = false; - for (list<Plugin*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { + for (list<PluginImpl*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { if ((*i)->uri() == plugin->uri()) { cerr << "Warning: Duplicate DSSI plugin (" << plugin->lib_name() << ":" << plugin->plug_label() << ")" << " found.\nUsing " << (*i)->lib_path() @@ -474,11 +474,11 @@ NodeFactory::load_dssi_plugin(const string& uri, assert(name != ""); DSSI_Descriptor_Function df = NULL; - const Plugin* plugin = NULL; + const PluginImpl* plugin = NULL; NodeImpl* n = NULL; // Attempt to find the lib - list<Plugin*>::iterator i; + list<PluginImpl*>::iterator i; for (i = _plugins.begin(); i != _plugins.end(); ++i) { plugin = (*i); if (plugin->uri() == uri) break; @@ -594,7 +594,7 @@ NodeFactory::load_ladspa_plugins() char id_str[11]; snprintf(id_str, 11, "%lu", descriptor->UniqueID); string uri = string("ladspa:").append(id_str); - Plugin* plugin = new Plugin(Plugin::LADSPA, uri); + PluginImpl* plugin = new PluginImpl(Plugin::LADSPA, uri); assert(plugin_library != NULL); plugin->module(plugin_library); @@ -605,7 +605,7 @@ NodeFactory::load_ladspa_plugins() plugin->id(descriptor->UniqueID); bool found = false; - for (list<Plugin*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { + for (list<PluginImpl*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { if ((*i)->uri() == plugin->uri()) { cerr << "Warning: Duplicate LADSPA plugin " << plugin->uri() << " found.\n Choosing " << (*i)->lib_path() @@ -640,11 +640,11 @@ NodeFactory::load_ladspa_plugin(const string& uri, assert(name != ""); LADSPA_Descriptor_Function df = NULL; - Plugin* plugin = NULL; + PluginImpl* plugin = NULL; NodeImpl* n = NULL; // Attempt to find the lib - list<Plugin*>::iterator i; + list<PluginImpl*>::iterator i; for (i = _plugins.begin(); i != _plugins.end(); ++i) { plugin = (*i); if (plugin->uri() == uri) break; diff --git a/src/libs/engine/NodeFactory.hpp b/src/libs/engine/NodeFactory.hpp index 8538d33d..decf59c0 100644 --- a/src/libs/engine/NodeFactory.hpp +++ b/src/libs/engine/NodeFactory.hpp @@ -38,7 +38,7 @@ namespace Ingen { class NodeImpl; class Patch; -class Plugin; +class PluginImpl; /** Loads plugins and creates Nodes from them. @@ -58,12 +58,12 @@ public: ~NodeFactory(); void load_plugins(); - NodeImpl* load_plugin(const Plugin* info, const string& name, bool polyphonic, Patch* parent); + NodeImpl* load_plugin(const PluginImpl* info, const string& name, bool polyphonic, Patch* parent); - const list<Plugin*>& plugins() { return _plugins; } + const list<PluginImpl*>& plugins() { return _plugins; } - const Plugin* plugin(const string& uri); - const Plugin* plugin(const string& type, const string& lib, const string& label); // DEPRECATED + const PluginImpl* plugin(const string& uri); + const PluginImpl* plugin(const string& type, const string& lib, const string& label); // DEPRECATED private: #ifdef HAVE_LADSPA @@ -87,9 +87,9 @@ private: typedef std::map<std::string,Glib::Module*> Libraries; - Libraries _libraries; - list<Plugin*> _internal_plugins; - list<Plugin*> _plugins; // FIXME: make a map + Libraries _libraries; + list<PluginImpl*> _internal_plugins; + list<PluginImpl*> _plugins; // FIXME: make a map Ingen::Shared::World* _world; bool _has_loaded; diff --git a/src/libs/engine/NodeImpl.hpp b/src/libs/engine/NodeImpl.hpp index 97c9e8d4..70a09c33 100644 --- a/src/libs/engine/NodeImpl.hpp +++ b/src/libs/engine/NodeImpl.hpp @@ -29,7 +29,7 @@ namespace Raul { template <typename T> class List; class Maid; } namespace Ingen { class Buffer; -class Plugin; +class PluginImpl; class Patch; class Port; @@ -145,7 +145,7 @@ public: /** Information about the Plugin this Node is an instance of. * Not the best name - not all nodes come from plugins (ie Patch) */ - virtual const Plugin* plugin() const = 0; + virtual const PluginImpl* plugin() const = 0; virtual void set_buffer_size(size_t size) = 0; }; diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp index 8ea06fa6..56971d70 100644 --- a/src/libs/engine/OSCClientSender.cpp +++ b/src/libs/engine/OSCClientSender.cpp @@ -25,7 +25,7 @@ #include "util.hpp" #include "Patch.hpp" #include "NodeImpl.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Port.hpp" #include "Connection.hpp" #include "AudioDriver.hpp" diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp index f0919257..7cbf028a 100644 --- a/src/libs/engine/ObjectSender.cpp +++ b/src/libs/engine/ObjectSender.cpp @@ -77,7 +77,7 @@ ObjectSender::send_patch(ClientInterface* client, const Patch* patch, bool recur void ObjectSender::send_node(ClientInterface* client, const NodeImpl* node, bool recursive) { - const Plugin* const plugin = node->plugin(); + const PluginImpl* const plugin = node->plugin(); assert(node->path().length() > 0); @@ -152,53 +152,5 @@ ObjectSender::send_port(ClientInterface* client, const Port* port) } -void -ObjectSender::send_plugins(ClientInterface* client, const list<Plugin*>& plugs) -{ -/* - lo_timetag tt; - lo_timetag_now(&tt); - lo_bundle b = lo_bundle_new(tt); - lo_message m = lo_message_new(); - list<lo_message> msgs; - - lo_message_add_int32(m, plugs.size()); - lo_bundle_add_message(b, "/om/num_plugins", m); - msgs.push_back(m); -*/ - for (list<Plugin*>::const_iterator j = plugs.begin(); j != plugs.end(); ++j) { - const Plugin* const p = *j; - client->new_plugin(p->uri(), p->type_uri(), p->name()); - } -/* - plugin = (*j); - m = lo_message_new(); - - lo_message_add_string(m, plugin->type_string()); - lo_message_add_string(m, plugin->uri().c_str()); - lo_message_add_string(m, plugin->name().c_str()); - lo_bundle_add_message(b, "/om/plugin", m); - msgs.push_back(m); - if (lo_bundle_length(b) > 1024) { - // FIXME FIXME FIXME dirty, dirty cast - lo_send_bundle(((OSCClient*)client)->address(), b); - lo_bundle_free(b); - b = lo_bundle_new(tt); - } - }*/ -/* - if (lo_bundle_length(b) > 0) { - // FIXME FIXME FIXME dirty, dirty cast - lo_send_bundle(((OSCClient*)client)->address(), b); - lo_bundle_free(b); - } else { - lo_bundle_free(b); - } - for (list<lo_bundle>::const_iterator i = msgs.begin(); i != msgs.end(); ++i) - lo_message_free(*i); -*/ -} - - } // namespace Ingen diff --git a/src/libs/engine/ObjectSender.hpp b/src/libs/engine/ObjectSender.hpp index fdd39101..c93804ba 100644 --- a/src/libs/engine/ObjectSender.hpp +++ b/src/libs/engine/ObjectSender.hpp @@ -29,7 +29,7 @@ namespace Shared { class Patch; class NodeImpl; class Port; -class Plugin; +class PluginImpl; /** Utility class for sending GraphObjects to clients through ClientInterface. @@ -49,7 +49,6 @@ public: static void send_patch(ClientInterface* client, const Patch* patch, bool recursive); static void send_node(ClientInterface* client, const NodeImpl* node, bool recursive); static void send_port(ClientInterface* client, const Port* port); - static void send_plugins(ClientInterface* client, const std::list<Plugin*>& plugs); }; } // namespace Ingen diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp index 70f3b535..0619c743 100644 --- a/src/libs/engine/Patch.cpp +++ b/src/libs/engine/Patch.cpp @@ -21,7 +21,7 @@ #include "ThreadManager.hpp" #include "NodeImpl.hpp" #include "Patch.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Port.hpp" #include "Connection.hpp" #include "DuplexPort.hpp" @@ -34,7 +34,7 @@ namespace Ingen { Patch::Patch(Engine& engine, const string& path, uint32_t poly, Patch* parent, SampleRate srate, size_t buffer_size, uint32_t internal_poly) -: NodeBase(new Plugin(Plugin::Patch, "ingen:patch"), path, poly, parent, srate, buffer_size), +: NodeBase(new PluginImpl(Plugin::Patch, "ingen:patch"), path, poly, parent, srate, buffer_size), _engine(engine), _internal_poly(internal_poly), _compiled_patch(NULL), diff --git a/src/libs/engine/Patch.hpp b/src/libs/engine/Patch.hpp index bd1723a5..ddcc1c93 100644 --- a/src/libs/engine/Patch.hpp +++ b/src/libs/engine/Patch.hpp @@ -22,7 +22,7 @@ #include <string> #include <raul/List.hpp> #include "NodeBase.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "DataType.hpp" #include "CompiledPatch.hpp" diff --git a/src/libs/engine/Plugin.cpp b/src/libs/engine/PluginImpl.cpp index 3e0a30fc..710c6385 100644 --- a/src/libs/engine/Plugin.cpp +++ b/src/libs/engine/PluginImpl.cpp @@ -15,7 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "MidiNoteNode.hpp" #include "MidiTriggerNode.hpp" #include "MidiControlNode.hpp" @@ -24,7 +24,7 @@ namespace Ingen { NodeImpl* -Plugin::instantiate(const string& name, bool polyphonic, Ingen::Patch* parent, SampleRate srate, size_t buffer_size) +PluginImpl::instantiate(const string& name, bool polyphonic, Ingen::Patch* parent, SampleRate srate, size_t buffer_size) { assert(_type == Internal); diff --git a/src/libs/engine/Plugin.hpp b/src/libs/engine/PluginImpl.hpp index dd14e815..e2aa4374 100644 --- a/src/libs/engine/Plugin.hpp +++ b/src/libs/engine/PluginImpl.hpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PLUGIN_H -#define PLUGIN_H +#ifndef PLUGINIMPL_H +#define PLUGINIMPL_H #include CONFIG_H_PATH @@ -30,8 +30,9 @@ #include <slv2/slv2.h> #endif #include "types.hpp" +#include "interface/Plugin.hpp" using std::string; -using std::cerr; using std::endl; +using Ingen::Shared::Plugin; namespace Ingen { @@ -45,12 +46,10 @@ class NodeImpl; * FIXME: This whole thing is a filthy mess and needs a rewrite. Probably * with derived classes for each plugin type. */ -class Plugin : boost::noncopyable +class PluginImpl : public Ingen::Shared::Plugin, public boost::noncopyable { public: - enum Type { LV2, LADSPA, DSSI, Internal, Patch }; - - Plugin(Type type, const string& uri) + PluginImpl(Type type, const string& uri) : _type(type) , _uri(uri) , _id(0) @@ -60,7 +59,7 @@ public: #endif {} - Plugin(const Plugin* const copy) { + PluginImpl(const PluginImpl* const copy) { // Copying only allowed for Internal plugins. Bit of a hack, but // allows the PluginInfo to be defined in the Node class which keeps // things localized and convenient (FIXME?) @@ -76,8 +75,8 @@ public: _module = copy->_module; } - Type type() const { return _type; } - void type(Type t) { _type = t; } + Plugin::Type type() const { return _type; } + void type(Plugin::Type t) { _type = t; } const string& lib_path() const { return _lib_path; } void lib_path(const string& s) { _lib_path = s; _lib_name = _lib_path.substr(_lib_path.find_last_of("/")+1); } string lib_name() const { return _lib_name; } @@ -88,7 +87,7 @@ public: void name(const string& s) { _name = s; } unsigned long id() const { return _id; } void id(unsigned long i) { _id = i; } - const string uri() const { return _uri; } + const string& uri() const { return _uri; } void uri(const string& s) { _uri = s; } Glib::Module* module() const { return _module; } void module(Glib::Module* module) { _module = module; } @@ -123,12 +122,12 @@ public: NodeImpl* instantiate(const string& name, bool polyphonic, Ingen::Patch* parent, SampleRate srate, size_t buffer_size); private: - Type _type; - string _uri; ///< LV2 only - string _lib_path; ///< LADSPA/DSSI only - string _lib_name; ///< LADSPA/DSSI only - string _plug_label; ///< LADSPA/DSSI only - string _name; ///< LADSPA/DSSI only + Plugin::Type _type; + string _uri; ///< LV2 only + string _lib_path; ///< LADSPA/DSSI only + string _lib_name; ///< LADSPA/DSSI only + string _plug_label; ///< LADSPA/DSSI only + string _name; ///< LADSPA/DSSI only unsigned long _id; ///< LADSPA/DSSI only Glib::Module* _module; @@ -141,5 +140,5 @@ private: } // namespace Ingen -#endif // PLUGIN_H +#endif // PLUGINIMPL_H diff --git a/src/libs/engine/TransportNode.cpp b/src/libs/engine/TransportNode.cpp index eddbc70d..4322f371 100644 --- a/src/libs/engine/TransportNode.cpp +++ b/src/libs/engine/TransportNode.cpp @@ -18,7 +18,7 @@ #include "TransportNode.hpp" #include <jack/transport.h> #include "OutputPort.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "JackAudioDriver.hpp" #include "Port.hpp" #include "util.hpp" @@ -28,7 +28,7 @@ namespace Ingen { TransportNode::TransportNode(const string& path, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size) -: NodeBase(new Plugin(Plugin::Internal, "ingen:transport_node"), path, false, parent, srate, buffer_size) +: NodeBase(new PluginImpl(Plugin::Internal, "ingen:transport_node"), path, false, parent, srate, buffer_size) { #if 0 _num_ports = 10; @@ -74,7 +74,7 @@ TransportNode::TransportNode(const string& path, bool polyphonic, Patch* parent, // new PortInfo("Bar Tick", AUDIO, OUTPUT, 0, 0, 1), buffer_size); _ports.at(9) = bar_trig_port; #endif - Plugin* p = const_cast<Plugin*>(_plugin); + PluginImpl* p = const_cast<PluginImpl*>(_plugin); p->plug_label("transport"); assert(p->uri() == "ingen:transport_node"); p->name("Ingen Transport Node (BROKEN)"); diff --git a/src/libs/engine/events/CreateNodeEvent.cpp b/src/libs/engine/events/CreateNodeEvent.cpp index 991ee0a8..df891cd3 100644 --- a/src/libs/engine/events/CreateNodeEvent.cpp +++ b/src/libs/engine/events/CreateNodeEvent.cpp @@ -22,7 +22,7 @@ #include "Responder.hpp" #include "Patch.hpp" #include "NodeImpl.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Engine.hpp" #include "Patch.hpp" #include "NodeFactory.hpp" @@ -78,7 +78,7 @@ CreateNodeEvent::pre_process() _patch = _engine.object_store()->find_patch(_path.parent()); - const Plugin* plugin = (_plugin_uri != "") + const PluginImpl* plugin = (_plugin_uri != "") ? _engine.node_factory()->plugin(_plugin_uri) : _engine.node_factory()->plugin(_plugin_type, _plugin_lib, _plugin_label); diff --git a/src/libs/engine/events/CreatePatchEvent.cpp b/src/libs/engine/events/CreatePatchEvent.cpp index a7cc7f8c..a5b907ab 100644 --- a/src/libs/engine/events/CreatePatchEvent.cpp +++ b/src/libs/engine/events/CreatePatchEvent.cpp @@ -21,7 +21,7 @@ #include "Responder.hpp" #include "Patch.hpp" #include "NodeImpl.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Engine.hpp" #include "ClientBroadcaster.hpp" #include "AudioDriver.hpp" diff --git a/src/libs/engine/events/CreatePortEvent.cpp b/src/libs/engine/events/CreatePortEvent.cpp index 6163d4ab..065ca4a3 100644 --- a/src/libs/engine/events/CreatePortEvent.cpp +++ b/src/libs/engine/events/CreatePortEvent.cpp @@ -22,7 +22,7 @@ #include "Responder.hpp" #include "CreatePortEvent.hpp" #include "Patch.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "Engine.hpp" #include "Patch.hpp" #include "QueuedEventSource.hpp" diff --git a/src/libs/engine/events/DSSIConfigureEvent.cpp b/src/libs/engine/events/DSSIConfigureEvent.cpp index 631ee608..25c9ab31 100644 --- a/src/libs/engine/events/DSSIConfigureEvent.cpp +++ b/src/libs/engine/events/DSSIConfigureEvent.cpp @@ -19,9 +19,11 @@ #include "Engine.hpp" #include "NodeImpl.hpp" #include "ClientBroadcaster.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ObjectStore.hpp" +using namespace std; + namespace Ingen { diff --git a/src/libs/engine/events/DSSIControlEvent.cpp b/src/libs/engine/events/DSSIControlEvent.cpp index 25bcaaf4..70c7dc99 100644 --- a/src/libs/engine/events/DSSIControlEvent.cpp +++ b/src/libs/engine/events/DSSIControlEvent.cpp @@ -18,7 +18,7 @@ #include "DSSIControlEvent.hpp" #include "Engine.hpp" #include "NodeImpl.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ObjectStore.hpp" namespace Ingen { diff --git a/src/libs/engine/events/DSSIProgramEvent.cpp b/src/libs/engine/events/DSSIProgramEvent.cpp index d47e3294..94cd20dc 100644 --- a/src/libs/engine/events/DSSIProgramEvent.cpp +++ b/src/libs/engine/events/DSSIProgramEvent.cpp @@ -21,7 +21,7 @@ #include "Engine.hpp" #include "NodeImpl.hpp" #include "ClientBroadcaster.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ObjectStore.hpp" using std::cout; using std::cerr; using std::endl; diff --git a/src/libs/engine/events/DSSIUpdateEvent.cpp b/src/libs/engine/events/DSSIUpdateEvent.cpp index 61d2ab97..8f2eea6a 100644 --- a/src/libs/engine/events/DSSIUpdateEvent.cpp +++ b/src/libs/engine/events/DSSIUpdateEvent.cpp @@ -21,7 +21,7 @@ #include "ObjectStore.hpp" #include "Engine.hpp" #include "DSSINode.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" using std::cerr; using std::endl; diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 96d8874a..575b1973 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -22,7 +22,7 @@ #include "Engine.hpp" #include "Patch.hpp" #include "NodeBase.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "AudioDriver.hpp" #include "MidiDriver.hpp" #include "DisconnectNodeEvent.hpp" diff --git a/src/libs/engine/events/MidiLearnEvent.cpp b/src/libs/engine/events/MidiLearnEvent.cpp index 683c879a..2cb39c0e 100644 --- a/src/libs/engine/events/MidiLearnEvent.cpp +++ b/src/libs/engine/events/MidiLearnEvent.cpp @@ -22,7 +22,7 @@ #include "NodeImpl.hpp" #include "MidiControlNode.hpp" #include "ClientBroadcaster.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" namespace Ingen { diff --git a/src/libs/engine/events/NoteEvent.cpp b/src/libs/engine/events/NoteEvent.cpp index 72191d84..9c69b9df 100644 --- a/src/libs/engine/events/NoteEvent.cpp +++ b/src/libs/engine/events/NoteEvent.cpp @@ -22,7 +22,7 @@ #include "NodeImpl.hpp" #include "MidiNoteNode.hpp" #include "MidiTriggerNode.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ProcessContext.hpp" namespace Ingen { diff --git a/src/libs/engine/events/RequestPluginEvent.cpp b/src/libs/engine/events/RequestPluginEvent.cpp index af7a4754..f2886902 100644 --- a/src/libs/engine/events/RequestPluginEvent.cpp +++ b/src/libs/engine/events/RequestPluginEvent.cpp @@ -15,16 +15,16 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "RequestPluginEvent.hpp" #include <string> #include "interface/ClientInterface.hpp" +#include "RequestPluginEvent.hpp" #include "Responder.hpp" #include "Engine.hpp" #include "Port.hpp" #include "ObjectStore.hpp" #include "ClientBroadcaster.hpp" #include "NodeFactory.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "ProcessContext.hpp" using std::string; diff --git a/src/libs/engine/events/RequestPluginEvent.hpp b/src/libs/engine/events/RequestPluginEvent.hpp index a4c6cd09..cca43627 100644 --- a/src/libs/engine/events/RequestPluginEvent.hpp +++ b/src/libs/engine/events/RequestPluginEvent.hpp @@ -26,9 +26,7 @@ using std::string; namespace Ingen { -class Plugin; -namespace Shared { class ClientInterface; } -using Shared::ClientInterface; +class PluginImpl; /** A request from a client to send the value of a port. @@ -45,8 +43,8 @@ public: void post_process(); private: - string _uri; - const Plugin* _plugin; + const string _uri; + const PluginImpl* _plugin; }; diff --git a/src/libs/engine/events/RequestPluginsEvent.hpp b/src/libs/engine/events/RequestPluginsEvent.hpp index 92a042f9..ae6a77a9 100644 --- a/src/libs/engine/events/RequestPluginsEvent.hpp +++ b/src/libs/engine/events/RequestPluginsEvent.hpp @@ -25,7 +25,7 @@ using std::string; namespace Ingen { -class Plugin; +class PluginImpl; class Responder; namespace Shared { class ClientInterface; @@ -45,7 +45,7 @@ public: void post_process(); private: - std::list<Plugin*> _plugins; + std::list<PluginImpl*> _plugins; }; diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.cpp b/src/libs/engine/events/SetPortValueQueuedEvent.cpp index 941905fc..026f22b6 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.cpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.cpp @@ -21,7 +21,7 @@ #include "Engine.hpp" #include "Port.hpp" #include "ClientBroadcaster.hpp" -#include "Plugin.hpp" +#include "PluginImpl.hpp" #include "NodeImpl.hpp" #include "ObjectStore.hpp" #include "AudioBuffer.hpp" @@ -144,7 +144,7 @@ SetPortValueQueuedEvent::post_process() } else if (_error == NO_SPACE) { std::ostringstream msg("Attempt to write "); msg << _data_size << " bytes to " << _port_path << ", with capacity " - << _port->buffer_size() << endl; + << _port->buffer_size() << std::endl; _responder->respond_error(msg.str()); } } |