diff options
author | David Robillard <d@drobilla.net> | 2006-06-18 08:06:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-06-18 08:06:14 +0000 |
commit | 172a0119ee0a0bb6d50836c70936907c3eb71c9e (patch) | |
tree | cbcc56285b033bb9857b9be85f5f9be193b6f38f /src/libs/engine/events | |
parent | e6f42fd640dcbad6b2e39cc85bdf307d197278b0 (diff) | |
download | ingen-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/events')
-rw-r--r-- | src/libs/engine/events/ConnectionEvent.cpp | 13 | ||||
-rw-r--r-- | src/libs/engine/events/DisconnectionEvent.cpp | 19 | ||||
-rw-r--r-- | src/libs/engine/events/RequestPortValueEvent.cpp | 3 | ||||
-rw-r--r-- | src/libs/engine/events/SetPortValueEvent.cpp | 5 | ||||
-rw-r--r-- | src/libs/engine/events/SetPortValueQueuedEvent.cpp | 5 |
5 files changed, 20 insertions, 25 deletions
diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index fe3b991e..fcfa3bbc 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -25,7 +25,6 @@ #include "Patch.h" #include "ClientBroadcaster.h" #include "Port.h" -#include "PortInfo.h" #include "Maid.h" #include "ObjectStore.h" #include "util/Path.h" @@ -82,16 +81,16 @@ ConnectionEvent::pre_process() return; } - if (port1->port_info()->type() != port2->port_info()->type()) { + if (port1->type() != port2->type()) { m_error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; } - if (port1->port_info()->is_output() && port2->port_info()->is_input()) { + if (port1->is_output() && port2->is_input()) { m_src_port = port1; m_dst_port = port2; - } else if (port2->port_info()->is_output() && port1->port_info()->is_input()) { + } else if (port2->is_output() && port1->is_input()) { m_src_port = port2; m_dst_port = port1; } else { @@ -101,11 +100,11 @@ ConnectionEvent::pre_process() } // Create the typed event to actually do the work - const PortType type = port1->port_info()->type(); - if (type == AUDIO || type == CONTROL) { + const DataType type = port1->type(); + if (type == DataType::FLOAT) { m_typed_event = new TypedConnectionEvent<sample>(m_responder, (OutputPort<sample>*)m_src_port, (InputPort<sample>*)m_dst_port); - } else if (type == MIDI) { + } else if (type == DataType::MIDI) { m_typed_event = new TypedConnectionEvent<MidiMessage>(m_responder, (OutputPort<MidiMessage>*)m_src_port, (InputPort<MidiMessage>*)m_dst_port); } else { diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp index e7d06eab..0a3a4f7b 100644 --- a/src/libs/engine/events/DisconnectionEvent.cpp +++ b/src/libs/engine/events/DisconnectionEvent.cpp @@ -25,7 +25,6 @@ #include "Patch.h" #include "ClientBroadcaster.h" #include "Port.h" -#include "PortInfo.h" #include "Maid.h" #include "ObjectStore.h" #include "util/Path.h" @@ -62,9 +61,9 @@ DisconnectionEvent::DisconnectionEvent(CountedPtr<Responder> responder, Port* co m_typed_event(NULL), m_error(NO_ERROR) { - assert(src_port->port_info()->is_output()); - assert(dst_port->port_info()->is_input()); - assert(src_port->port_info()->type() == dst_port->port_info()->type()); + assert(src_port->is_output()); + assert(dst_port->is_input()); + assert(src_port->type() == dst_port->type()); assert(src_port->parent_node()->parent_patch() == dst_port->parent_node()->parent_patch()); } @@ -102,16 +101,16 @@ DisconnectionEvent::pre_process() return; } - if (port1->port_info()->type() != port2->port_info()->type()) { + if (port1->type() != port2->type()) { m_error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; } - if (port1->port_info()->is_output() && port2->port_info()->is_input()) { + if (port1->is_output() && port2->is_input()) { m_src_port = port1; m_dst_port = port2; - } else if (port2->port_info()->is_output() && port1->port_info()->is_input()) { + } else if (port2->is_output() && port1->is_input()) { m_src_port = port2; m_dst_port = port1; } else { @@ -122,11 +121,11 @@ DisconnectionEvent::pre_process() } // Create the typed event to actually do the work - const PortType type = m_src_port->port_info()->type(); - if (type == AUDIO || type == CONTROL) { + const DataType type = m_src_port->type(); + if (type == DataType::FLOAT) { m_typed_event = new TypedDisconnectionEvent<sample>(m_responder, (OutputPort<sample>*)m_src_port, (InputPort<sample>*)m_dst_port); - } else if (type == MIDI) { + } else if (type == DataType::MIDI) { m_typed_event = new TypedDisconnectionEvent<MidiMessage>(m_responder, (OutputPort<MidiMessage>*)m_src_port, (InputPort<MidiMessage>*)m_dst_port); } else { diff --git a/src/libs/engine/events/RequestPortValueEvent.cpp b/src/libs/engine/events/RequestPortValueEvent.cpp index e4d3985e..cd578460 100644 --- a/src/libs/engine/events/RequestPortValueEvent.cpp +++ b/src/libs/engine/events/RequestPortValueEvent.cpp @@ -21,7 +21,6 @@ #include "OmApp.h" #include "interface/ClientInterface.h" #include "PortBase.h" -#include "PortInfo.h" #include "ObjectStore.h" #include "ClientBroadcaster.h" @@ -53,7 +52,7 @@ RequestPortValueEvent::pre_process() void RequestPortValueEvent::execute(samplecount offset) { - if (m_port != NULL && m_port->port_info()->is_audio() || m_port->port_info()->is_control()) + if (m_port != NULL && m_port->type() == DataType::FLOAT) m_value = ((PortBase<sample>*)m_port)->buffer(0)->value_at(offset); else m_port = NULL; // triggers error response diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp index 964cd9ca..6ca227e0 100644 --- a/src/libs/engine/events/SetPortValueEvent.cpp +++ b/src/libs/engine/events/SetPortValueEvent.cpp @@ -19,7 +19,6 @@ #include "Om.h" #include "OmApp.h" #include "PortBase.h" -#include "PortInfo.h" #include "ClientBroadcaster.h" #include "Node.h" #include "ObjectStore.h" @@ -59,7 +58,7 @@ SetPortValueEvent::execute(samplecount offset) if (m_port == NULL) { m_error = PORT_NOT_FOUND; - } else if (!m_port->port_info()->is_audio() && !m_port->port_info()->is_control()) { + } else if (!(m_port->type() == DataType::FLOAT)) { m_error = TYPE_MISMATCH; } else { if (m_voice_num == -1) @@ -83,7 +82,7 @@ SetPortValueEvent::post_process() // Send patch port control change, if this is a bridge port Port* parent_port = m_port->parent_node()->as_port(); if (parent_port != NULL) { - assert(parent_port->port_info()->is_control() || parent_port->port_info()->is_audio()); + assert(parent_port->type() == DataType::FLOAT); om->client_broadcaster()->send_control_change(parent_port->path(), m_val); } diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.cpp b/src/libs/engine/events/SetPortValueQueuedEvent.cpp index e73c0486..b935beb9 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.cpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.cpp @@ -19,7 +19,6 @@ #include "Om.h" #include "OmApp.h" #include "PortBase.h" -#include "PortInfo.h" #include "ClientBroadcaster.h" #include "Plugin.h" #include "Node.h" @@ -60,7 +59,7 @@ SetPortValueQueuedEvent::pre_process() if (m_port == NULL) { m_error = PORT_NOT_FOUND; - } else if (!m_port->port_info()->is_audio() && !m_port->port_info()->is_control()) { + } else if ( !(m_port->type() == DataType::FLOAT) ) { m_error = TYPE_MISMATCH; } @@ -95,7 +94,7 @@ SetPortValueQueuedEvent::post_process() // Send patch port control change, if this is a bridge port Port* parent_port = m_port->parent_node()->as_port(); if (parent_port != NULL) { - assert(parent_port->port_info()->is_control() || parent_port->port_info()->is_audio()); + assert(parent_port->type() == DataType::FLOAT); om->client_broadcaster()->send_control_change(parent_port->path(), m_val); } |