summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/ObjectSender.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-18 08:06:14 +0000
committerDavid Robillard <d@drobilla.net>2006-06-18 08:06:14 +0000
commit172a0119ee0a0bb6d50836c70936907c3eb71c9e (patch)
treecbcc56285b033bb9857b9be85f5f9be193b6f38f /src/libs/engine/ObjectSender.cpp
parente6f42fd640dcbad6b2e39cc85bdf307d197278b0 (diff)
downloadingen-172a0119ee0a0bb6d50836c70936907c3eb71c9e.tar.gz
ingen-172a0119ee0a0bb6d50836c70936907c3eb71c9e.tar.bz2
ingen-172a0119ee0a0bb6d50836c70936907c3eb71c9e.zip
More work on new ports implementation;
lots of mass renaming and code removal. git-svn-id: http://svn.drobilla.net/lad/grauph@52 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/ObjectSender.cpp')
-rw-r--r--src/libs/engine/ObjectSender.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/libs/engine/ObjectSender.cpp b/src/libs/engine/ObjectSender.cpp
index 24191a5d..aec86e53 100644
--- a/src/libs/engine/ObjectSender.cpp
+++ b/src/libs/engine/ObjectSender.cpp
@@ -22,7 +22,6 @@
#include "Patch.h"
#include "Node.h"
#include "Port.h"
-#include "PortInfo.h"
#include "PortBase.h"
#include "Connection.h"
#include "NodeFactory.h"
@@ -60,7 +59,7 @@ ObjectSender::send_patch(ClientInterface* client, const Patch* patch)
client->connection((*j)->src_port()->path(), (*j)->dst_port()->path());
// Send port information
- for (size_t i=0; i < patch->ports().size(); ++i) {
+ for (size_t i=0; i < patch->num_ports(); ++i) {
Port* const port = patch->ports().at(i);
// Send metadata
@@ -68,7 +67,8 @@ ObjectSender::send_patch(ClientInterface* client, const Patch* patch)
for (map<string, string>::const_iterator i = data.begin(); i != data.end(); ++i)
client->metadata_update(port->path(), (*i).first, (*i).second);
- if (port->port_info()->is_control())
+ // Control port, send value
+ if (port->type() == DataType::FLOAT && port->buffer_size() == 1)
client->control_change(port->path(), ((PortBase<sample>*)port)->buffer(0)->value_at(0));
}
@@ -89,6 +89,8 @@ ObjectSender::send_node(ClientInterface* client, const Node* node)
// FIXME: hack, these nodes probably shouldn't even exist in the
// engine anymore
if (const_cast<Node*>(node)->as_port()) { // bridge node if as_port() returns non-NULL
+ // FIXME: remove this whole thing. shouldn't be any bridge nodes anymore
+ assert(false);
send_port(client, const_cast<Node*>(node)->as_port());
return;
}
@@ -124,13 +126,11 @@ ObjectSender::send_node(ClientInterface* client, const Node* node)
// Send ports
for (size_t j=0; j < ports.size(); ++j) {
- Port* const port = ports.at(j);
- PortInfo* const info = port->port_info();
-
+ Port* const port = ports.at(j);
assert(port);
- assert(info);
- client->new_port(port->path(), info->type_string(), info->is_output());
+ send_port(client, port);
+ //client->new_port(port->path(), port->type().uri(), port->is_output());
}
client->bundle_end();
@@ -145,9 +145,18 @@ ObjectSender::send_node(ClientInterface* client, const Node* node)
void
ObjectSender::send_port(ClientInterface* client, const Port* port)
{
- PortInfo* info = port->port_info();
-
- client->new_port(port->path(), info->type_string(), info->is_output());
+ assert(port);
+
+ // FIXME: temporary compatibility hack
+ string type = port->type().uri();
+ if (port->type() == DataType::FLOAT) {
+ if (port->buffer_size() == 1)
+ type = "CONTROL";
+ else
+ type = "AUDIO";
+ }
+
+ client->new_port(port->path(), type, port->is_output());
// Send metadata
const map<string, string>& data = port->metadata();