summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/MidiControlNode.cpp7
-rw-r--r--src/libs/engine/MidiNoteNode.cpp10
-rw-r--r--src/libs/engine/MidiTriggerNode.cpp8
-rw-r--r--src/libs/engine/OSCClientSender.cpp11
-rw-r--r--src/libs/engine/ObjectSender.cpp29
5 files changed, 32 insertions, 33 deletions
diff --git a/src/libs/engine/MidiControlNode.cpp b/src/libs/engine/MidiControlNode.cpp
index 6b83e335..dcd32768 100644
--- a/src/libs/engine/MidiControlNode.cpp
+++ b/src/libs/engine/MidiControlNode.cpp
@@ -39,12 +39,19 @@ MidiControlNode::MidiControlNode(const string& path, size_t poly, Patch* parent,
_ports->at(0) = _midi_in_port;
_param_port = new InputPort(this, "ControllerNumber", 1, 1, DataType::FLOAT, 1);
+ _param_port->set_metadata("ingen:minimum", 0.0f);
+ _param_port->set_metadata("ingen:maximum", 127.0f);
+ _param_port->set_metadata("ingen:default", 0.0f);
+ _param_port->set_metadata("ingen:integer", 1);
_ports->at(1) = _param_port;
_log_port = new InputPort(this, "Logarithmic", 2, 1, DataType::FLOAT, 1);
+ _log_port->set_metadata("ingen:toggled", 1);
+ _log_port->set_metadata("ingen:default", 0.0f);
_ports->at(2) = _log_port;
_min_port = new InputPort(this, "Min", 3, 1, DataType::FLOAT, 1);
+ _min_port->set_metadata("ingen:default", 0.0f);
_ports->at(3) = _min_port;
_max_port = new InputPort(this, "Max", 4, 1, DataType::FLOAT, 1);
diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp
index aac195ef..2eec62a4 100644
--- a/src/libs/engine/MidiNoteNode.cpp
+++ b/src/libs/engine/MidiNoteNode.cpp
@@ -45,19 +45,21 @@ MidiNoteNode::MidiNoteNode(const string& path, size_t poly, Patch* parent, Sampl
_ports->at(0) = _midi_in_port;
_freq_port = new OutputPort(this, "Frequency", 1, poly, DataType::FLOAT, _buffer_size);
- // new PortInfo("Frequency", AUDIO, OUTPUT, 440, 0, 99999), _buffer_size);
_ports->at(1) = _freq_port;
_vel_port = new OutputPort(this, "Velocity", 2, poly, DataType::FLOAT, _buffer_size);
- // new PortInfo("Velocity", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
+ _vel_port->set_metadata("ingen:minimum", 0.0f);
+ _vel_port->set_metadata("ingen:maximum", 1.0f);
_ports->at(2) = _vel_port;
_gate_port = new OutputPort(this, "Gate", 3, poly, DataType::FLOAT, _buffer_size);
- // new PortInfo("Gate", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
+ _gate_port->set_metadata("ingen:toggled", 1);
+ _gate_port->set_metadata("ingen:default", 0.0f);
_ports->at(3) = _gate_port;
_trig_port = new OutputPort(this, "Trigger", 4, poly, DataType::FLOAT, _buffer_size);
- // new PortInfo("Trigger", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
+ _trig_port->set_metadata("ingen:toggled", 1);
+ _trig_port->set_metadata("ingen:default", 0.0f);
_ports->at(4) = _trig_port;
plugin()->plug_label("note_in");
diff --git a/src/libs/engine/MidiTriggerNode.cpp b/src/libs/engine/MidiTriggerNode.cpp
index a0b0c032..610f3ef9 100644
--- a/src/libs/engine/MidiTriggerNode.cpp
+++ b/src/libs/engine/MidiTriggerNode.cpp
@@ -36,19 +36,19 @@ MidiTriggerNode::MidiTriggerNode(const string& path, size_t poly, Patch* parent,
_ports->at(0) = _midi_in_port;
_note_port = new InputPort(this, "NoteNumber", 1, 1, DataType::FLOAT, 1);
- // new PortInfo("Note Number", CONTROL, INPUT, INTEGER, 60, 0, 127), 1);
+ _note_port->set_metadata("ingen:minimum", 0.0f);
+ _note_port->set_metadata("ingen:maximum", 127.0f);
+ _note_port->set_metadata("ingen:default", 60.0f);
+ _note_port->set_metadata("ingen:integer", 1);
_ports->at(1) = _note_port;
_gate_port = new OutputPort(this, "Gate", 2, 1, DataType::FLOAT, _buffer_size);
- // new PortInfo("Gate", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
_ports->at(2) = _gate_port;
_trig_port = new OutputPort(this, "Trigger", 3, 1, DataType::FLOAT, _buffer_size);
- // new PortInfo("Trigger", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
_ports->at(3) = _trig_port;
_vel_port = new OutputPort(this, "Velocity", 4, poly, DataType::FLOAT, _buffer_size);
- // new PortInfo("Velocity", AUDIO, OUTPUT, 0, 0, 1), _buffer_size);
_ports->at(4) = _vel_port;
plugin()->plug_label("trigger_in");
diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp
index 5565505b..a20efea4 100644
--- a/src/libs/engine/OSCClientSender.cpp
+++ b/src/libs/engine/OSCClientSender.cpp
@@ -351,20 +351,13 @@ void OSCClientSender::new_node(string plugin_uri,
*/
void
OSCClientSender::new_port(string path,
- string data_type,
- bool is_output)
+ string data_type,
+ bool is_output)
{
if (!_enabled)
return;
- //PortInfo* info = port->port_info();
-
lo_send(_address, "/ingen/new_port", "ssi", path.c_str(), data_type.c_str(), is_output);
-
- // Send metadata
- /*const map<string, string>& data = port->metadata();
- for (map<string, string>::const_iterator i = data.begin(); i != data.end(); ++i)
- metadata_update(port->path(), (*i).first, (*i).second);*/
}
diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp
index db573afc..608d1768 100644
--- a/src/libs/engine/ObjectSender.cpp
+++ b/src/libs/engine/ObjectSender.cpp
@@ -96,29 +96,22 @@ ObjectSender::send_node(ClientInterface* client, const Node* node, bool recursiv
return;
}
- // FIXME: bundleify
- //client->bundle_begin();
+ client->bundle_begin();
- const Raul::Array<Port*>& ports = node->ports();
-
- client->new_node(node->plugin()->uri(), node->path(), polyphonic, ports.size());
+ client->new_node(node->plugin()->uri(), node->path(), polyphonic, node->ports().size());
- if (recursive) {
- // Send ports
- for (size_t j=0; j < ports.size(); ++j) {
- Port* const port = ports.at(j);
- assert(port);
-
- send_port(client, port);
- }
- }
-
// Send metadata
const GraphObject::MetadataMap& data = node->metadata();
for (GraphObject::MetadataMap::const_iterator j = data.begin(); j != data.end(); ++j)
client->metadata_update(node->path(), (*j).first, (*j).second);
- //client->bundle_end();
+ client->bundle_end();
+
+ if (recursive) {
+ // Send ports
+ for (size_t j=0; j < node->ports().size(); ++j)
+ send_port(client, node->ports().at(j));
+ }
}
@@ -142,6 +135,8 @@ ObjectSender::send_port(ClientInterface* client, const Port* port)
//cerr << ", type = " << type << endl;
+ client->bundle_begin();
+
client->new_port(port->path(), type, port->is_output());
// Send control value
@@ -155,6 +150,8 @@ ObjectSender::send_port(ClientInterface* client, const Port* port)
const GraphObject::MetadataMap& data = port->metadata();
for (GraphObject::MetadataMap::const_iterator j = data.begin(); j != data.end(); ++j)
client->metadata_update(port->path(), (*j).first, (*j).second);
+
+ client->bundle_end();
}