summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/DSSINode.cpp1
-rw-r--r--src/libs/engine/InternalNode.h7
-rw-r--r--src/libs/engine/Makefile.am1
-rw-r--r--src/libs/engine/MidiControlNode.cpp7
-rw-r--r--src/libs/engine/MidiNoteNode.cpp7
-rw-r--r--src/libs/engine/MidiTriggerNode.cpp7
-rw-r--r--src/libs/engine/NodeBase.h14
-rw-r--r--src/libs/engine/NodeFactory.cpp101
-rw-r--r--src/libs/engine/NodeFactory.h9
-rw-r--r--src/libs/engine/Patch.cpp2
-rw-r--r--src/libs/engine/Plugin.h104
-rw-r--r--src/libs/engine/TransportNode.cpp7
-rw-r--r--src/libs/engine/TypedConnection.cpp2
-rw-r--r--src/libs/engine/events/AddNodeEvent.cpp2
-rw-r--r--src/libs/engine/types.h1
15 files changed, 131 insertions, 141 deletions
diff --git a/src/libs/engine/DSSINode.cpp b/src/libs/engine/DSSINode.cpp
index c78c8d02..122c13b4 100644
--- a/src/libs/engine/DSSINode.cpp
+++ b/src/libs/engine/DSSINode.cpp
@@ -21,6 +21,7 @@
#include "ClientBroadcaster.h"
#include "interface/ClientInterface.h"
#include "InputPort.h"
+#include "types.h"
using namespace std;
diff --git a/src/libs/engine/InternalNode.h b/src/libs/engine/InternalNode.h
index 98bd473f..2cbbcff8 100644
--- a/src/libs/engine/InternalNode.h
+++ b/src/libs/engine/InternalNode.h
@@ -20,6 +20,7 @@
#include <cstdlib>
#include "NodeBase.h"
#include "Plugin.h"
+#include "types.h"
namespace Ingen {
@@ -37,7 +38,6 @@ public:
: NodeBase(plugin, path, poly, parent, srate, buffer_size),
_is_added(false)
{
- _plugin.lib_path("/Ingen");
}
virtual ~InternalNode() {}
@@ -52,14 +52,13 @@ public:
//virtual void send_creation_messages(ClientInterface* client) const
//{ NodeBase::send_creation_messages(client); }
- virtual const Plugin* plugin() const { return &_plugin; }
-
protected:
+ Plugin* plugin() const { return const_cast<Plugin*>(_plugin); }
+
// Disallow copies (undefined)
InternalNode(const InternalNode&);
InternalNode& operator=(const InternalNode&);
- Plugin _plugin;
bool _is_added;
};
diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am
index b4b0ec45..bc2560eb 100644
--- a/src/libs/engine/Makefile.am
+++ b/src/libs/engine/Makefile.am
@@ -68,6 +68,7 @@ libingen_la_SOURCES = \
ClientRecord.h \
PluginLibrary.h \
Plugin.h \
+ Plugin.cpp \
Array.h \
List.h \
Slave.h \
diff --git a/src/libs/engine/MidiControlNode.cpp b/src/libs/engine/MidiControlNode.cpp
index cd483bc7..32f14dc2 100644
--- a/src/libs/engine/MidiControlNode.cpp
+++ b/src/libs/engine/MidiControlNode.cpp
@@ -30,7 +30,7 @@ namespace Ingen {
MidiControlNode::MidiControlNode(const string& path, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size)
-: InternalNode(new Plugin(Plugin::Internal, "Ingen:ControlNode"), path, 1, parent, srate, buffer_size),
+: InternalNode(new Plugin(Plugin::Internal, "ingen:control_node"), path, 1, parent, srate, buffer_size),
_learning(false)
{
_ports = new Array<Port*>(7);
@@ -56,8 +56,9 @@ MidiControlNode::MidiControlNode(const string& path, size_t poly, Patch* parent,
_control_port = new OutputPort<Sample>(this, "Out_(CR)", 6, 1, DataType::FLOAT, 1);
_ports->at(6) = _control_port;
- _plugin.plug_label("midi_control_in");
- _plugin.name("Ingen Control Node (MIDI)");
+ plugin()->plug_label("midi_control_in");
+ assert(plugin()->uri() == "ingen:control_node");
+ plugin()->name("Ingen Control Node (MIDI)");
}
diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp
index f13b054a..5d08c495 100644
--- a/src/libs/engine/MidiNoteNode.cpp
+++ b/src/libs/engine/MidiNoteNode.cpp
@@ -34,7 +34,7 @@ namespace Ingen {
MidiNoteNode::MidiNoteNode(const string& path, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size)
-: InternalNode(new Plugin(Plugin::Internal, "Ingen:NoteNode"), path, poly, parent, srate, buffer_size),
+: InternalNode(new Plugin(Plugin::Internal, "ingen:note_node"), path, poly, parent, srate, buffer_size),
_voices(new Voice[poly]),
_sustain(false)
{
@@ -59,8 +59,9 @@ MidiNoteNode::MidiNoteNode(const string& path, size_t poly, Patch* parent, Sampl
// new PortInfo("Trigger", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
_ports->at(4) = _trig_port;
- _plugin.plug_label("note_in");
- _plugin.name("Ingen Note Node (MIDI, OSC)");
+ plugin()->plug_label("note_in");
+ assert(plugin()->uri() == "ingen:note_node");
+ plugin()->name("Ingen Note Node (MIDI, OSC)");
}
diff --git a/src/libs/engine/MidiTriggerNode.cpp b/src/libs/engine/MidiTriggerNode.cpp
index 3b21129c..c117a70c 100644
--- a/src/libs/engine/MidiTriggerNode.cpp
+++ b/src/libs/engine/MidiTriggerNode.cpp
@@ -26,7 +26,7 @@ namespace Ingen {
MidiTriggerNode::MidiTriggerNode(const string& path, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size)
-: InternalNode(new Plugin(Plugin::Internal, "Ingen:TriggerNode"), path, 1, parent, srate, buffer_size)
+: InternalNode(new Plugin(Plugin::Internal, "ingen:trigger_node"), path, 1, parent, srate, buffer_size)
{
_ports = new Array<Port*>(5);
@@ -49,8 +49,9 @@ MidiTriggerNode::MidiTriggerNode(const string& path, size_t poly, Patch* parent,
// new PortInfo("Velocity", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
_ports->at(4) = _vel_port;
- _plugin.plug_label("trigger_in");
- _plugin.name("Ingen Trigger Node (MIDI, OSC)");
+ plugin()->plug_label("trigger_in");
+ assert(plugin()->uri() == "ingen:trigger_node");
+ plugin()->name("Ingen Trigger Node (MIDI, OSC)");
}
diff --git a/src/libs/engine/NodeBase.h b/src/libs/engine/NodeBase.h
index f0c04d80..df9c6e7c 100644
--- a/src/libs/engine/NodeBase.h
+++ b/src/libs/engine/NodeBase.h
@@ -17,9 +17,11 @@
#ifndef NODEBASE_H
#define NODEBASE_H
+#include "types.h"
#include <string>
#include <cstdlib>
#include "Node.h"
+
using std::string;
namespace Ingen {
@@ -60,10 +62,12 @@ public:
//void send_creation_messages(ClientInterface* client) const;
- size_t num_ports() const { return _ports ? _ports->size() : 0; }
- size_t poly() const { return _poly; }
- bool traversed() const { return _traversed; }
- void traversed(bool b) { _traversed = b; }
+ SampleRate sample_rate() const { return _srate; }
+ size_t buffer_size() const { return _buffer_size; }
+ size_t num_ports() const { return _ports ? _ports->size() : 0; }
+ size_t poly() const { return _poly; }
+ bool traversed() const { return _traversed; }
+ void traversed(bool b) { _traversed = b; }
const Array<Port*>& ports() const { return *_ports; }
@@ -75,7 +79,7 @@ public:
virtual const Plugin* plugin() const { return _plugin; }
- void set_path(const Path& new_path);
+ virtual void set_path(const Path& new_path);
/** A node's parent is always a patch, so static cast should be safe */
Patch* parent_patch() const { return (Patch*)_parent; }
diff --git a/src/libs/engine/NodeFactory.cpp b/src/libs/engine/NodeFactory.cpp
index 57219f9f..65829d97 100644
--- a/src/libs/engine/NodeFactory.cpp
+++ b/src/libs/engine/NodeFactory.cpp
@@ -22,8 +22,6 @@
#include <float.h>
#include <cmath>
#include <dlfcn.h>
-#include "Engine.h"
-#include "AudioDriver.h"
#include "MidiNoteNode.h"
#include "MidiTriggerNode.h"
#include "MidiControlNode.h"
@@ -130,7 +128,10 @@ NodeFactory::load_plugins()
* Calls the load_*_plugin functions to actually do things, just a wrapper.
*/
Node*
-NodeFactory::load_plugin(const Plugin* a_plugin, const string& name, size_t poly, Patch* parent)
+NodeFactory::load_plugin(const Plugin* a_plugin,
+ const string& name,
+ size_t poly,
+ Patch* parent)
{
assert(parent != NULL);
assert(poly == 1 || poly == parent->internal_poly());
@@ -141,6 +142,9 @@ NodeFactory::load_plugin(const Plugin* a_plugin, const string& name, size_t poly
Node* r = NULL;
Plugin* plugin = NULL;
+ const SampleRate srate = parent->sample_rate();
+ const size_t buffer_size = parent->buffer_size();
+
// FIXME FIXME FIXME: double lookup
// Attempt to find the plugin in loaded DB
@@ -177,21 +181,21 @@ NodeFactory::load_plugin(const Plugin* a_plugin, const string& name, size_t poly
switch (a_plugin->type()) {
#if HAVE_SLV2
case Plugin::LV2:
- r = load_lv2_plugin(plugin->uri(), name, poly, parent);
+ r = load_lv2_plugin(plugin->uri(), name, poly, parent, srate, buffer_size);
break;
#endif
#if HAVE_DSSI
case Plugin::DSSI:
- r = load_dssi_plugin(plugin->uri(), name, poly, parent);
+ r = load_dssi_plugin(plugin->uri(), name, poly, parent, srate, buffer_size);
break;
#endif
#if HAVE_LADSPA
case Plugin::LADSPA:
- r = load_ladspa_plugin(plugin->uri(), name, poly, parent);
+ r = load_ladspa_plugin(plugin->uri(), name, poly, parent, srate, buffer_size);
break;
#endif
case Plugin::Internal:
- r = load_internal_plugin(a_plugin->uri(), name, poly, parent);
+ r = load_internal_plugin(a_plugin->uri(), name, poly, parent, srate, buffer_size);
break;
default:
cerr << "[NodeFactory] WARNING: Unknown plugin type." << endl;
@@ -206,59 +210,23 @@ NodeFactory::load_plugin(const Plugin* a_plugin, const string& name, size_t poly
/** Loads an internal plugin.
*/
Node*
-NodeFactory::load_internal_plugin(const string& uri, const string& name, size_t poly, Patch* parent)
+NodeFactory::load_internal_plugin(const string& uri,
+ const string& name,
+ size_t poly,
+ Patch* parent,
+ SampleRate srate,
+ size_t buffer_size)
{
- return NULL;
- cerr << "FIXME: Internal plugin" << endl;
-#if 0
assert(parent != NULL);
assert(poly == 1 || poly == parent->internal_poly());
- assert(uri.length() > 3);
- assert(uri.substr(0, 3) == "om:");
-
- string plug_label = uri.substr(3);
- /*if (plug_label == "midi_input") {
- MidiInputNode* tn = new MidiInputNode(name, 1, parent, Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return tn;
- } else if (plug_label == "midi_output") {
- MidiOutputNode* tn = new MidiOutputNode(name, 1, parent, Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return tn;
- } else if (plug_label == "audio_input") {
- AudioInputNode* in = new AudioInputNode(name, poly, parent,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return in;
- } else if (plug_label == "control_input") {
- ControlInputNode* in = new ControlInputNode(name, poly, parent,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return in;
- } else if (plug_label == "audio_output") {
- AudioOutputNode* on = new AudioOutputNode(name, poly, parent,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return on;
- } else if (plug_label == "control_output") {
- ControlOutputNode* on = new ControlOutputNode(name, poly, parent,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return on;
- } else
- */
- if (plug_label == "note_in" || plug_label == "midi_note_in") {
- MidiNoteNode* mn = new MidiNoteNode(name, poly, parent, Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return mn;
- } else if (plug_label == "trigger_in" || plug_label == "midi_trigger_in") {
- MidiTriggerNode* mn = new MidiTriggerNode(name, 1, parent, Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return mn;
- } else if (plug_label == "midi_control_in") {
- MidiControlNode* mn = new MidiControlNode(name, 1, parent, Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return mn;
- } else if (plug_label == "transport") {
- TransportNode* tn = new TransportNode(name, 1, parent, Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
- return tn;
- } else {
- cerr << "Unknown internal plugin type '" << plug_label << "'" << endl;
- }
+ assert(uri.length() > 6);
+ assert(uri.substr(0, 6) == "ingen:");
+ for (list<Plugin*>::iterator i = _internal_plugins.begin(); i != _internal_plugins.end(); ++i)
+ if ((*i)->uri() == uri)
+ return (*i)->instantiate(name, poly, parent, srate, buffer_size);
+
return NULL;
-#endif
}
@@ -320,7 +288,9 @@ Node*
NodeFactory::load_lv2_plugin(const string& plug_uri,
const string& node_name,
size_t poly,
- Patch* parent)
+ Patch* parent,
+ SampleRate srate,
+ size_t buffer_size)
{
// Find (internal) Plugin
Plugin* plugin = NULL;
@@ -333,8 +303,7 @@ NodeFactory::load_lv2_plugin(const string& plug_uri,
Node* n = NULL;
if (plugin) {
- n = new LV2Node(plugin, node_name, poly, parent,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
+ n = new LV2Node(plugin, node_name, poly, parent, srate, buffer_size);
bool success = ((LV2Node*)n)->instantiate();
if (!success) {
delete n;
@@ -455,7 +424,7 @@ NodeFactory::load_dssi_plugins()
*/
Node*
NodeFactory::load_dssi_plugin(const string& uri,
- const string& name, size_t poly, Patch* parent)
+ const string& name, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size)
{
// FIXME: awful code duplication here
@@ -509,8 +478,8 @@ NodeFactory::load_dssi_plugin(const string& uri,
return NULL;
}
- n = new DSSINode(plugin, name, poly, parent, descriptor,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
+ n = new DSSINode(plugin, name, poly, parent, descriptor, srate, buffer_size);
+
bool success = ((DSSINode*)n)->instantiate();
if (!success) {
delete n;
@@ -625,7 +594,11 @@ NodeFactory::load_ladspa_plugins()
*/
Node*
NodeFactory::load_ladspa_plugin(const string& uri,
- const string& name, size_t poly, Patch* parent)
+ const string& name,
+ size_t poly,
+ Patch* parent,
+ SampleRate srate,
+ size_t buffer_size)
{
assert(uri != "");
assert(name != "");
@@ -676,8 +649,8 @@ NodeFactory::load_ladspa_plugin(const string& uri,
return NULL;
}
- n = new LADSPANode(plugin, name, poly, parent, descriptor,
- Engine::instance().audio_driver()->sample_rate(), Engine::instance().audio_driver()->buffer_size());
+ n = new LADSPANode(plugin, name, poly, parent, descriptor, srate, buffer_size);
+
bool success = ((LADSPANode*)n)->instantiate();
if (!success) {
delete n;
diff --git a/src/libs/engine/NodeFactory.h b/src/libs/engine/NodeFactory.h
index abb30553..cf2fb0d0 100644
--- a/src/libs/engine/NodeFactory.h
+++ b/src/libs/engine/NodeFactory.h
@@ -19,6 +19,7 @@
#define NODEFACTORY_H
#include "config.h"
+#include "types.h"
#include <list>
#include <string>
#include <ladspa.h>
@@ -61,20 +62,20 @@ public:
private:
#ifdef HAVE_LADSPA
void load_ladspa_plugins();
- Node* load_ladspa_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent);
+ Node* load_ladspa_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size);
#endif
#ifdef HAVE_SLV2
void load_lv2_plugins();
- Node* load_lv2_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent);
+ Node* load_lv2_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size);
#endif
#ifdef HAVE_DSSI
void load_dssi_plugins();
- Node* load_dssi_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent);
+ Node* load_dssi_plugin(const string& plugin_uri, const string& name, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size);
#endif
- Node* load_internal_plugin(const string& plug_label, const string& name, size_t poly, Patch* parent);
+ Node* load_internal_plugin(const string& plug_label, const string& name, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size);
list<PluginLibrary*> _libraries;
list<Plugin*> _internal_plugins;
diff --git a/src/libs/engine/Patch.cpp b/src/libs/engine/Patch.cpp
index 56006a86..c8c3dd3a 100644
--- a/src/libs/engine/Patch.cpp
+++ b/src/libs/engine/Patch.cpp
@@ -30,7 +30,7 @@ namespace Ingen {
Patch::Patch(const string& path, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size, size_t internal_poly)
-: NodeBase(new Plugin(Plugin::Patch, "Ingen:Patch"), path, poly, parent, srate, buffer_size),
+: NodeBase(new Plugin(Plugin::Patch, "ingen:patch"), path, poly, parent, srate, buffer_size),
_internal_poly(internal_poly),
_process_order(NULL),
_process(false)
diff --git a/src/libs/engine/Plugin.h b/src/libs/engine/Plugin.h
index 295e1bbf..bdb5a748 100644
--- a/src/libs/engine/Plugin.h
+++ b/src/libs/engine/Plugin.h
@@ -26,13 +26,17 @@
#ifdef HAVE_SLV2
#include <slv2/slv2.h>
#endif
+#include "types.h"
using std::string;
using std::cerr; using std::endl;
+class Path;
namespace Ingen {
class PluginLibrary;
+class Patch;
+class Node;
/** Representation of a plugin (of various types).
@@ -47,16 +51,16 @@ public:
enum Type { LV2, LADSPA, DSSI, Internal, Patch };
Plugin(Type type, const string& uri)
- : m_type(type)
- , m_uri(uri)
+ : _type(type)
+ , _uri(uri)
{}
// FIXME: remove
- Plugin() : m_type(Internal), m_lib_path("/Ingen"),
- m_id(0), m_library(NULL)
+ Plugin() : _type(Internal), _lib_path("/Ingen"),
+ _id(0), _library(NULL)
{
#ifdef HAVE_SLV2
- m_slv2_plugin = NULL;
+ _slv2_plugin = NULL;
#endif
}
@@ -64,73 +68,77 @@ public:
// 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?)
- if (copy->m_type != Internal)
+ if (copy->_type != Internal)
exit(EXIT_FAILURE);
- m_type = copy->m_type;
- m_lib_path = copy->m_lib_path;
- m_plug_label = copy->m_plug_label;
- m_name = copy->m_name;
- m_library = copy->m_library;
+ _type = copy->_type;
+ _lib_path = copy->_lib_path;
+ _uri = copy->_uri;
+ _plug_label = copy->_plug_label;
+ _name = copy->_name;
+ _library = copy->_library;
}
- Type type() const { return m_type; }
- void type(Type t) { m_type = t; }
- const string& lib_path() const { return m_lib_path; }
- void lib_path(const string& s) { m_lib_path = s; m_lib_name = m_lib_path.substr(m_lib_path.find_last_of("/")+1); }
- string lib_name() const { return m_lib_name; }
- void lib_name(const string& s) { m_lib_name = s; }
- const string& plug_label() const { return m_plug_label; }
- void plug_label(const string& s) { m_plug_label = s; }
- const string& name() const { return m_name; }
- void name(const string& s) { m_name = s; }
- unsigned long id() const { return m_id; }
- void id(unsigned long i) { m_id = i; }
- const string uri() const { return m_uri; }
- void uri(const string& s) { m_uri = s; }
+ Type type() const { return _type; }
+ void type(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; }
+ void lib_name(const string& s) { _lib_name = s; }
+ const string& plug_label() const { return _plug_label; }
+ void plug_label(const string& s) { _plug_label = s; }
+ const string& name() const { return _name; }
+ 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; }
+ void uri(const string& s) { _uri = s; }
- PluginLibrary* library() const { return m_library; }
- void library(PluginLibrary* const library) { m_library = library; }
+ PluginLibrary* library() const { return _library; }
+ void library(PluginLibrary* const library) { _library = library; }
const char* type_string() const {
- if (m_type == LADSPA) return "LADSPA";
- else if (m_type == LV2) return "LV2";
- else if (m_type == DSSI) return "DSSI";
- else if (m_type == Internal) return "Internal";
- else if (m_type == Patch) return "Patch";
+ if (_type == LADSPA) return "LADSPA";
+ else if (_type == LV2) return "LV2";
+ else if (_type == DSSI) return "DSSI";
+ else if (_type == Internal) return "Internal";
+ else if (_type == Patch) return "Patch";
else return "";
}
void set_type(const string& type_string) {
- if (type_string == "LADSPA") m_type = LADSPA;
- else if (type_string == "LV2") m_type = LV2;
- else if (type_string == "DSSI") m_type = DSSI;
- else if (type_string == "Internal") m_type = Internal;
- else if (type_string == "Patch") m_type = Patch;
+ if (type_string == "LADSPA") _type = LADSPA;
+ else if (type_string == "LV2") _type = LV2;
+ else if (type_string == "DSSI") _type = DSSI;
+ else if (type_string == "Internal") _type = Internal;
+ else if (type_string == "Patch") _type = Patch;
}
// FIXME: ew
#ifdef HAVE_SLV2
- SLV2Plugin* slv2_plugin() const { return m_slv2_plugin; }
- void slv2_plugin(const SLV2Plugin* p) { m_slv2_plugin = p; }
+ SLV2Plugin* slv2_plugin() const { return _slv2_plugin; }
+ void slv2_plugin(const SLV2Plugin* p) { _slv2_plugin = p; }
#endif
+
+ Node* instantiate(const string& name, size_t poly, Ingen::Patch* parent, SampleRate srate, size_t buffer_size);
+
private:
// Disallow copies (undefined)
Plugin(const Plugin&);
Plugin& operator=(const Plugin&);
- Type m_type;
- string m_uri; ///< LV2 only
- string m_lib_path; ///< LADSPA/DSSI only
- string m_lib_name; ///< LADSPA/DSSI only
- string m_plug_label; ///< LADSPA/DSSI only
- string m_name; ///< LADSPA/DSSI only
- unsigned long m_id; ///< LADSPA/DSSI only
+ 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
- PluginLibrary* m_library;
+ PluginLibrary* _library;
#ifdef HAVE_SLV2
- SLV2Plugin* m_slv2_plugin;
+ SLV2Plugin* _slv2_plugin;
#endif
};
diff --git a/src/libs/engine/TransportNode.cpp b/src/libs/engine/TransportNode.cpp
index be10dc99..49ab20b8 100644
--- a/src/libs/engine/TransportNode.cpp
+++ b/src/libs/engine/TransportNode.cpp
@@ -28,7 +28,7 @@ namespace Ingen {
TransportNode::TransportNode(const string& path, size_t poly, Patch* parent, SampleRate srate, size_t buffer_size)
-: InternalNode(new Plugin(Plugin::Internal, "Ingen:TransportNode"), path, 1, parent, srate, buffer_size)
+: InternalNode(new Plugin(Plugin::Internal, "ingen:transport_node"), path, 1, parent, srate, buffer_size)
{
#if 0
_num_ports = 10;
@@ -74,8 +74,9 @@ TransportNode::TransportNode(const string& path, size_t poly, Patch* parent, Sam
// new PortInfo("Bar Tick", AUDIO, OUTPUT, 0, 0, 1), buffer_size);
_ports.at(9) = bar_trig_port;
#endif
- _plugin.plug_label("transport");
- _plugin.name("Ingen Transport Node (BROKEN)");
+ plugin()->plug_label("transport");
+ assert(plugin()->uri() == "ingen:transport_node");
+ plugin()->name("Ingen Transport Node (BROKEN)");
}
diff --git a/src/libs/engine/TypedConnection.cpp b/src/libs/engine/TypedConnection.cpp
index e294185c..daee10d9 100644
--- a/src/libs/engine/TypedConnection.cpp
+++ b/src/libs/engine/TypedConnection.cpp
@@ -66,7 +66,7 @@ void
TypedConnection<Sample>::process(SampleCount nframes)
{
// FIXME: nframes parameter not used
- assert(nframes == m_buffer_size);
+ assert(m_buffer_size == 1 || m_buffer_size == nframes);
/* Thought: A poly output port can be connected to multiple mono input
* ports, which means this mix down would have to happen many times.
diff --git a/src/libs/engine/events/AddNodeEvent.cpp b/src/libs/engine/events/AddNodeEvent.cpp
index 4f8d099a..a5dc7538 100644
--- a/src/libs/engine/events/AddNodeEvent.cpp
+++ b/src/libs/engine/events/AddNodeEvent.cpp
@@ -113,7 +113,7 @@ AddNodeEvent::post_process()
} else if (m_node == NULL) {
msg = "Unable to load node ";
msg.append(m_path).append(" (you're missing the plugin \"").append(
- m_plugin->lib_name()).append(":").append(m_plugin->plug_label()).append("\")");;
+ m_plugin->uri());
_responder->respond_error(msg);
} else {
_responder->respond_ok();
diff --git a/src/libs/engine/types.h b/src/libs/engine/types.h
index c623ac42..73cc5c73 100644
--- a/src/libs/engine/types.h
+++ b/src/libs/engine/types.h
@@ -14,7 +14,6 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
#ifndef TYPES_H
#define TYPES_H