summaryrefslogtreecommitdiffstats
path: root/src/engine/internals
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-03 04:46:56 +0000
committerDavid Robillard <d@drobilla.net>2010-02-03 04:46:56 +0000
commit87597f85c5a69a9accd3ce2ed88f2a006173e885 (patch)
treea3ffa393e9aecbc55dae64bad3bd45ee317e6d26 /src/engine/internals
parenta645d2b8be4d7d31f6eef1649156b166a01e0c31 (diff)
downloadingen-87597f85c5a69a9accd3ce2ed88f2a006173e885.tar.gz
ingen-87597f85c5a69a9accd3ce2ed88f2a006173e885.tar.bz2
ingen-87597f85c5a69a9accd3ce2ed88f2a006173e885.zip
Comprehensive use of cached URIs and more advanced Value (Atom) system.
Atoms (e.g. property values or port values) can now be an Atom::DICT, which maps directly to/from an RDF resource. This is now used to store control bindings as a port property, eliminating the special API. Full interned URIs used everywhere, instead of CURIEs pretending to be URIs. Avoid converting string literals to URIs all over the place. Support for binding MIDI pitch bender and MIDI channel pressure. Saving/restoring of MIDI bindings as a free side-effect of the above. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2409 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/internals')
-rw-r--r--src/engine/internals/Controller.cpp10
-rw-r--r--src/engine/internals/Note.cpp10
-rw-r--r--src/engine/internals/Trigger.cpp16
3 files changed, 21 insertions, 15 deletions
diff --git a/src/engine/internals/Controller.cpp b/src/engine/internals/Controller.cpp
index 44b6a184..4d102bef 100644
--- a/src/engine/internals/Controller.cpp
+++ b/src/engine/internals/Controller.cpp
@@ -17,6 +17,7 @@
#include <math.h>
#include "raul/midi_events.h"
+#include "shared/LV2URIMap.hpp"
#include "internals/Controller.hpp"
#include "PostProcessor.hpp"
#include "events/Learn.hpp"
@@ -47,19 +48,20 @@ ControllerNode::ControllerNode(BufferFactory& bufs,
: NodeBase(&controller_plugin, path, false, parent, srate, buffer_size)
, _learning(false)
{
+ const LV2URIMap& uris = Shared::LV2URIMap::instance();
_ports = new Raul::Array<PortImpl*>(6);
_midi_in_port = new InputPort(bufs, this, "input", 0, 1, PortType::EVENTS, Raul::Atom(), _buffer_size);
_ports->at(0) = _midi_in_port;
_param_port = new InputPort(bufs, this, "controller", 1, 1, PortType::CONTROL, 0.0f, sizeof(Sample));
- _param_port->set_property("lv2:minimum", 0.0f);
- _param_port->set_property("lv2:maximum", 127.0f);
- _param_port->set_property("lv2:integer", true);
+ _param_port->set_property(uris.lv2_minimum, 0.0f);
+ _param_port->set_property(uris.lv2_maximum, 127.0f);
+ _param_port->set_property(uris.lv2_integer, true);
_ports->at(1) = _param_port;
_log_port = new InputPort(bufs, this, "logarithmic", 2, 1, PortType::CONTROL, 0.0f, sizeof(Sample));
- _log_port->set_property("lv2:toggled", true);
+ _log_port->set_property(uris.lv2_toggled, true);
_ports->at(2) = _log_port;
_min_port = new InputPort(bufs, this, "minimum", 3, 1, PortType::CONTROL, 0.0f, sizeof(Sample));
diff --git a/src/engine/internals/Note.cpp b/src/engine/internals/Note.cpp
index 9ed45c96..ecee587f 100644
--- a/src/engine/internals/Note.cpp
+++ b/src/engine/internals/Note.cpp
@@ -20,6 +20,7 @@
#include "raul/Array.hpp"
#include "raul/Maid.hpp"
#include "raul/midi_events.h"
+#include "shared/LV2URIMap.hpp"
#include "internals/Note.hpp"
#include "AudioBuffer.hpp"
#include "Driver.hpp"
@@ -50,6 +51,7 @@ NoteNode::NoteNode(BufferFactory& bufs, const string& path, bool polyphonic, Pat
, _prepared_voices(NULL)
, _sustain(false)
{
+ const LV2URIMap& uris = Shared::LV2URIMap::instance();
_ports = new Raul::Array<PortImpl*>(5);
_midi_in_port = new InputPort(bufs, this, "input", 0, 1, PortType::EVENTS, Raul::Atom(), _buffer_size);
@@ -59,16 +61,16 @@ NoteNode::NoteNode(BufferFactory& bufs, const string& path, bool polyphonic, Pat
_ports->at(1) = _freq_port;
_vel_port = new OutputPort(bufs, this, "velocity", 2, _polyphony, PortType::AUDIO, 0.0f, _buffer_size);
- _vel_port->set_property("lv2:minimum", 0.0f);
- _vel_port->set_property("lv2:maximum", 1.0f);
+ _vel_port->set_property(uris.lv2_minimum, 0.0f);
+ _vel_port->set_property(uris.lv2_maximum, 1.0f);
_ports->at(2) = _vel_port;
_gate_port = new OutputPort(bufs, this, "gate", 3, _polyphony, PortType::AUDIO, 0.0f, _buffer_size);
- _gate_port->set_property("lv2:toggled", true);
+ _gate_port->set_property(uris.lv2_toggled, true);
_ports->at(3) = _gate_port;
_trig_port = new OutputPort(bufs, this, "trigger", 4, _polyphony, PortType::AUDIO, 0.0f, _buffer_size);
- _trig_port->set_property("lv2:toggled", true);
+ _trig_port->set_property(uris.lv2_toggled, true);
_ports->at(4) = _trig_port;
}
diff --git a/src/engine/internals/Trigger.cpp b/src/engine/internals/Trigger.cpp
index 440e9a63..68d938c0 100644
--- a/src/engine/internals/Trigger.cpp
+++ b/src/engine/internals/Trigger.cpp
@@ -18,6 +18,7 @@
#include <cmath>
#include "raul/log.hpp"
#include "raul/midi_events.h"
+#include "shared/LV2URIMap.hpp"
#include "internals/Trigger.hpp"
#include "AudioBuffer.hpp"
#include "EventBuffer.hpp"
@@ -44,28 +45,29 @@ TriggerNode::TriggerNode(BufferFactory& bufs, const string& path, bool polyphoni
: NodeBase(&trigger_plugin, path, false, parent, srate, buffer_size)
, _learning(false)
{
+ const LV2URIMap& uris = LV2URIMap::instance();
_ports = new Raul::Array<PortImpl*>(5);
_midi_in_port = new InputPort(bufs, this, "input", 0, 1, PortType::EVENTS, Raul::Atom(), _buffer_size);
_ports->at(0) = _midi_in_port;
_note_port = new InputPort(bufs, this, "note", 1, 1, PortType::CONTROL, 60.0f, sizeof(Sample));
- _note_port->set_property("lv2:minimum", 0.0f);
- _note_port->set_property("lv2:maximum", 127.0f);
- _note_port->set_property("lv2:integer", true);
+ _note_port->set_property(uris.lv2_minimum, 0.0f);
+ _note_port->set_property(uris.lv2_maximum, 127.0f);
+ _note_port->set_property(uris.lv2_integer, true);
_ports->at(1) = _note_port;
_gate_port = new OutputPort(bufs, this, "gate", 2, 1, PortType::AUDIO, 0.0f, _buffer_size);
- _gate_port->set_property("lv2:toggled", true);
+ _gate_port->set_property(uris.lv2_toggled, true);
_ports->at(2) = _gate_port;
_trig_port = new OutputPort(bufs, this, "trigger", 3, 1, PortType::AUDIO, 0.0f, _buffer_size);
- _trig_port->set_property("lv2:toggled", true);
+ _trig_port->set_property(uris.lv2_toggled, true);
_ports->at(3) = _trig_port;
_vel_port = new OutputPort(bufs, this, "velocity", 4, 1, PortType::AUDIO, 0.0f, _buffer_size);
- _vel_port->set_property("lv2:minimum", 0.0f);
- _vel_port->set_property("lv2:maximum", 1.0f);
+ _vel_port->set_property(uris.lv2_minimum, 0.0f);
+ _vel_port->set_property(uris.lv2_maximum, 1.0f);
_ports->at(4) = _vel_port;
}