diff options
author | David Robillard <d@drobilla.net> | 2007-10-07 23:09:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-07 23:09:48 +0000 |
commit | 971c02f3707c4872a2da9a3b946b6508290c5ab4 (patch) | |
tree | 1dd28dabb27f75a1c5fc79bb583e50c8ec98974f /src/libs/engine/events | |
parent | 288a04a65de1ff86ff0ca6e02e611f83e881d159 (diff) | |
download | ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.tar.gz ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.tar.bz2 ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.zip |
Added shared abstract interface for ports.
Moved DataType to shared.
Switch data type URIs to match LV2 type semantics (e.g. separate audio/control types).
git-svn-id: http://svn.drobilla.net/lad/ingen@840 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
39 files changed, 101 insertions, 103 deletions
diff --git a/src/libs/engine/events/ClearPatchEvent.cpp b/src/libs/engine/events/ClearPatchEvent.cpp index 891ca53b..1e6c0748 100644 --- a/src/libs/engine/events/ClearPatchEvent.cpp +++ b/src/libs/engine/events/ClearPatchEvent.cpp @@ -23,7 +23,7 @@ #include "ClientBroadcaster.hpp" #include "util.hpp" #include "ObjectStore.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "NodeImpl.hpp" #include "Connection.hpp" #include "QueuedEventSource.hpp" diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index d1ec1a89..7f8fa18e 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -27,7 +27,7 @@ #include "OutputPort.hpp" #include "Patch.hpp" #include "ClientBroadcaster.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectStore.hpp" using std::string; diff --git a/src/libs/engine/events/ConnectionEvent.hpp b/src/libs/engine/events/ConnectionEvent.hpp index eb128660..8fa8c489 100644 --- a/src/libs/engine/events/ConnectionEvent.hpp +++ b/src/libs/engine/events/ConnectionEvent.hpp @@ -35,7 +35,7 @@ class Patch; class NodeImpl; class Connection; class MidiMessage; -class Port; +class PortImpl; class Connection; class InputPort; class OutputPort; @@ -71,8 +71,8 @@ private: Raul::Path _dst_port_path; Patch* _patch; - Port* _src_port; - Port* _dst_port; + PortImpl* _src_port; + PortImpl* _dst_port; OutputPort* _src_output_port; InputPort* _dst_input_port; diff --git a/src/libs/engine/events/CreateNodeEvent.cpp b/src/libs/engine/events/CreateNodeEvent.cpp index df891cd3..3a2715e0 100644 --- a/src/libs/engine/events/CreateNodeEvent.cpp +++ b/src/libs/engine/events/CreateNodeEvent.cpp @@ -28,7 +28,7 @@ #include "NodeFactory.hpp" #include "ClientBroadcaster.hpp" #include "ObjectStore.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" namespace Ingen { diff --git a/src/libs/engine/events/CreateNodeEvent.hpp b/src/libs/engine/events/CreateNodeEvent.hpp index 1452df05..75dfe3d7 100644 --- a/src/libs/engine/events/CreateNodeEvent.hpp +++ b/src/libs/engine/events/CreateNodeEvent.hpp @@ -30,7 +30,6 @@ namespace Ingen { class Patch; class NodeImpl; -class Plugin; class CompiledPatch; diff --git a/src/libs/engine/events/CreatePatchEvent.hpp b/src/libs/engine/events/CreatePatchEvent.hpp index 0b614013..15b67ffb 100644 --- a/src/libs/engine/events/CreatePatchEvent.hpp +++ b/src/libs/engine/events/CreatePatchEvent.hpp @@ -30,8 +30,6 @@ template<typename T> class TreeNode; namespace Ingen { class Patch; -class NodeImpl; -class Plugin; class CompiledPatch; diff --git a/src/libs/engine/events/CreatePortEvent.cpp b/src/libs/engine/events/CreatePortEvent.cpp index 065ca4a3..21875290 100644 --- a/src/libs/engine/events/CreatePortEvent.cpp +++ b/src/libs/engine/events/CreatePortEvent.cpp @@ -28,7 +28,7 @@ #include "QueuedEventSource.hpp" #include "ObjectStore.hpp" #include "ClientBroadcaster.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "AudioDriver.hpp" #include "MidiDriver.hpp" #include "OSCDriver.hpp" @@ -45,10 +45,11 @@ CreatePortEvent::CreatePortEvent(Engine& engine, bool is_output, QueuedEventSource* source) : QueuedEvent(engine, responder, timestamp, true, source), + _error(NO_ERROR), _path(path), _type(type), _is_output(is_output), - _data_type(DataType::UNKNOWN), + _data_type(type), _patch(NULL), _patch_port(NULL), _driver_port(NULL) @@ -61,20 +62,17 @@ CreatePortEvent::CreatePortEvent(Engine& engine, * FIXME: fix this using RCU */ - string type_str; - if (type == "ingen:control" || type == "ingen:audio") - _data_type = DataType::FLOAT; - else if (type == "ingen:midi") - _data_type = DataType::MIDI; - else if (type == "ingen:osc") - _data_type = DataType::OSC; + if (_data_type == DataType::UNKNOWN) { + cerr << "[CreatePortEvent] Unknown port type " << type << endl; + _error = UNKNOWN_TYPE; + } } void CreatePortEvent::pre_process() { - if (_engine.object_store()->find_object(_path) != NULL) { + if (_error == UNKNOWN_TYPE || _engine.object_store()->find_object(_path)) { QueuedEvent::pre_process(); return; } @@ -97,14 +95,14 @@ CreatePortEvent::pre_process() if (_patch_port) { if (_is_output) - _patch->add_output(new Raul::ListNode<Port*>(_patch_port)); + _patch->add_output(new Raul::ListNode<PortImpl*>(_patch_port)); else - _patch->add_input(new Raul::ListNode<Port*>(_patch_port)); + _patch->add_input(new Raul::ListNode<PortImpl*>(_patch_port)); if (_patch->external_ports()) - _ports_array = new Raul::Array<Port*>(old_num_ports + 1, *_patch->external_ports()); + _ports_array = new Raul::Array<PortImpl*>(old_num_ports + 1, *_patch->external_ports()); else - _ports_array = new Raul::Array<Port*>(old_num_ports + 1, NULL); + _ports_array = new Raul::Array<PortImpl*>(old_num_ports + 1, NULL); _ports_array->at(_patch->num_ports()-1) = _patch_port; @@ -160,7 +158,7 @@ CreatePortEvent::execute(ProcessContext& context) void CreatePortEvent::post_process() { - if (!_patch_port) { + if (_error != NO_ERROR || !_patch_port) { const string msg = string("Could not create port - ").append(_path); _responder->respond_error(msg); } else { diff --git a/src/libs/engine/events/CreatePortEvent.hpp b/src/libs/engine/events/CreatePortEvent.hpp index adae4892..d7835a25 100644 --- a/src/libs/engine/events/CreatePortEvent.hpp +++ b/src/libs/engine/events/CreatePortEvent.hpp @@ -21,7 +21,7 @@ #include "QueuedEvent.hpp" #include <raul/Path.hpp> #include <raul/Array.hpp> -#include "DataType.hpp" +#include "interface/DataType.hpp" #include <string> using std::string; @@ -30,8 +30,7 @@ template <typename T> class Array; namespace Ingen { class Patch; -class Port; -class Plugin; +class PortImpl; class DriverPort; @@ -49,15 +48,22 @@ public: void post_process(); private: - Raul::Path _path; - string _type; - bool _is_output; - DataType _data_type; - Patch* _patch; - Port* _patch_port; - Raul::Array<Port*>* _ports_array; ///< New (external) ports array for Patch - DriverPort* _driver_port; ///< Driver (eg Jack) port if this is a toplevel port - bool _succeeded; + + enum ErrorType { + NO_ERROR, + UNKNOWN_TYPE + }; + + ErrorType _error; + Raul::Path _path; + string _type; + bool _is_output; + DataType _data_type; + Patch* _patch; + PortImpl* _patch_port; + Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports array for Patch + DriverPort* _driver_port; ///< Driver (eg Jack) port if this is a toplevel port + bool _succeeded; }; diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 575b1973..7fdda39f 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -30,7 +30,7 @@ #include "ClientBroadcaster.hpp" #include "ObjectStore.hpp" #include "QueuedEventSource.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" namespace Ingen { @@ -70,7 +70,7 @@ DestroyEvent::pre_process() _node = dynamic_cast<NodeImpl*>(_store_iterator->second); if (!_node) - _port = dynamic_cast<Port*>(_store_iterator->second); + _port = dynamic_cast<PortImpl*>(_store_iterator->second); } if (_store_iterator != _engine.object_store()->objects().end()) { @@ -155,7 +155,7 @@ DestroyEvent::execute(ProcessContext& context) _port->parent_patch()->external_ports(_ports_array); if ( ! _port->parent_patch()->parent()) { - if (_port->type() == DataType::FLOAT) + if (_port->type() == DataType::AUDIO) _driver_port = _engine.audio_driver()->remove_port(_port->path()); else if (_port->type() == DataType::MIDI) _driver_port = _engine.midi_driver()->remove_port(_port->path()); diff --git a/src/libs/engine/events/DestroyEvent.hpp b/src/libs/engine/events/DestroyEvent.hpp index 78ff3d7b..59a932b3 100644 --- a/src/libs/engine/events/DestroyEvent.hpp +++ b/src/libs/engine/events/DestroyEvent.hpp @@ -36,9 +36,8 @@ namespace Ingen { class GraphObjectImpl; class Patch; class NodeImpl; -class Port; +class PortImpl; class DriverPort; -class Plugin; class DisconnectNodeEvent; class DisconnectPortEvent; class CompiledPatch; @@ -63,11 +62,11 @@ private: ObjectStore::Objects::iterator _store_iterator; Table<Path,GraphObjectImpl*> _removed_table; NodeImpl* _node; ///< Same as _object if it is a Node, otherwise NULL - Port* _port; ///< Same as _object if it is a Port, otherwise NULL + PortImpl* _port; ///< Same as _object if it is a Port, otherwise NULL DriverPort* _driver_port; Raul::ListNode<NodeImpl*>* _patch_node_listnode; - Raul::ListNode<Port*>* _patch_port_listnode; - Raul::Array<Port*>* _ports_array; ///< New (external) ports array for Patch + Raul::ListNode<PortImpl*>* _patch_port_listnode; + Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports array for Patch CompiledPatch* _compiled_patch; ///< Patch's new process order DisconnectNodeEvent* _disconnect_node_event; DisconnectPortEvent* _disconnect_port_event; diff --git a/src/libs/engine/events/DisablePortMonitoringEvent.cpp b/src/libs/engine/events/DisablePortMonitoringEvent.cpp index 3b5950ee..d5b99618 100644 --- a/src/libs/engine/events/DisablePortMonitoringEvent.cpp +++ b/src/libs/engine/events/DisablePortMonitoringEvent.cpp @@ -20,7 +20,7 @@ #include "events/DisablePortMonitoringEvent.hpp" #include "Responder.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectStore.hpp" #include "ClientBroadcaster.hpp" #include "AudioBuffer.hpp" diff --git a/src/libs/engine/events/DisablePortMonitoringEvent.hpp b/src/libs/engine/events/DisablePortMonitoringEvent.hpp index b2fac41b..7a8e23f7 100644 --- a/src/libs/engine/events/DisablePortMonitoringEvent.hpp +++ b/src/libs/engine/events/DisablePortMonitoringEvent.hpp @@ -26,7 +26,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; namespace Shared { class ClientInterface; } using Shared::ClientInterface; diff --git a/src/libs/engine/events/DisconnectNodeEvent.cpp b/src/libs/engine/events/DisconnectNodeEvent.cpp index 3ee93b81..8612d012 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.cpp +++ b/src/libs/engine/events/DisconnectNodeEvent.cpp @@ -29,7 +29,7 @@ #include "ObjectStore.hpp" #include "OutputPort.hpp" #include "Patch.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "Responder.hpp" #include "util.hpp" diff --git a/src/libs/engine/events/DisconnectNodeEvent.hpp b/src/libs/engine/events/DisconnectNodeEvent.hpp index 5decb923..cefe5a25 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.hpp +++ b/src/libs/engine/events/DisconnectNodeEvent.hpp @@ -31,7 +31,7 @@ class DisconnectionEvent; class Patch; class NodeImpl; class Connection; -class Port; +class PortImpl; class InputPort; class OutputPort; diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp index 6ed328cf..f7ad9925 100644 --- a/src/libs/engine/events/DisconnectPortEvent.cpp +++ b/src/libs/engine/events/DisconnectPortEvent.cpp @@ -25,7 +25,7 @@ #include "NodeImpl.hpp" #include "Connection.hpp" #include "DisconnectionEvent.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" #include "Patch.hpp" diff --git a/src/libs/engine/events/DisconnectPortEvent.hpp b/src/libs/engine/events/DisconnectPortEvent.hpp index 85c37ed3..b30151ed 100644 --- a/src/libs/engine/events/DisconnectPortEvent.hpp +++ b/src/libs/engine/events/DisconnectPortEvent.hpp @@ -31,7 +31,7 @@ namespace Ingen { class Patch; class NodeImpl; class Connection; -class Port; +class PortImpl; class DisconnectionEvent; using std::string; diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp index 33dbdeeb..215e0202 100644 --- a/src/libs/engine/events/DisconnectionEvent.cpp +++ b/src/libs/engine/events/DisconnectionEvent.cpp @@ -26,7 +26,7 @@ #include "OutputPort.hpp" #include "Patch.hpp" #include "ClientBroadcaster.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectStore.hpp" using std::string; @@ -50,7 +50,7 @@ DisconnectionEvent::DisconnectionEvent(Engine& engine, SharedPtr<Responder> resp } -DisconnectionEvent::DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Port* const src_port, Port* const dst_port) +DisconnectionEvent::DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, PortImpl* const src_port, PortImpl* const dst_port) : QueuedEvent(engine, responder, timestamp), _src_port_path(src_port->path()), _dst_port_path(dst_port->path()), diff --git a/src/libs/engine/events/DisconnectionEvent.hpp b/src/libs/engine/events/DisconnectionEvent.hpp index 46b2c015..aacb5082 100644 --- a/src/libs/engine/events/DisconnectionEvent.hpp +++ b/src/libs/engine/events/DisconnectionEvent.hpp @@ -35,7 +35,7 @@ class Patch; class NodeImpl; class Connection; class MidiMessage; -class Port; +class PortImpl; class Connection; class InputPort; class OutputPort; @@ -50,7 +50,7 @@ class DisconnectionEvent : public QueuedEvent { public: DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& src_port_path, const string& dst_port_path); - DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Port* const src_port, Port* const dst_port); + DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, PortImpl* const src_port, PortImpl* const dst_port); void pre_process(); void execute(ProcessContext& context); @@ -72,8 +72,8 @@ private: Raul::Path _dst_port_path; Patch* _patch; - Port* _src_port; - Port* _dst_port; + PortImpl* _src_port; + PortImpl* _dst_port; OutputPort* _src_output_port; InputPort* _dst_input_port; diff --git a/src/libs/engine/events/EnablePortBroadcastingEvent.cpp b/src/libs/engine/events/EnablePortBroadcastingEvent.cpp index 018fd3cf..dcc09ac4 100644 --- a/src/libs/engine/events/EnablePortBroadcastingEvent.cpp +++ b/src/libs/engine/events/EnablePortBroadcastingEvent.cpp @@ -20,7 +20,7 @@ #include "events/EnablePortBroadcastingEvent.hpp" #include "Responder.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectStore.hpp" #include "ClientBroadcaster.hpp" #include "AudioBuffer.hpp" diff --git a/src/libs/engine/events/EnablePortBroadcastingEvent.hpp b/src/libs/engine/events/EnablePortBroadcastingEvent.hpp index e24389cb..f9bc4e98 100644 --- a/src/libs/engine/events/EnablePortBroadcastingEvent.hpp +++ b/src/libs/engine/events/EnablePortBroadcastingEvent.hpp @@ -26,7 +26,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; namespace Shared { class ClientInterface; } using Shared::ClientInterface; @@ -50,7 +50,7 @@ public: private: const std::string _port_path; - Port* _port; + PortImpl* _port; bool _enable; }; diff --git a/src/libs/engine/events/LoadPluginsEvent.hpp b/src/libs/engine/events/LoadPluginsEvent.hpp index 966e3275..cd9a2884 100644 --- a/src/libs/engine/events/LoadPluginsEvent.hpp +++ b/src/libs/engine/events/LoadPluginsEvent.hpp @@ -23,8 +23,6 @@ namespace Ingen { -class Plugin; - /** Loads all plugins into the internal plugin database (in NodeFactory). * diff --git a/src/libs/engine/events/MidiLearnEvent.cpp b/src/libs/engine/events/MidiLearnEvent.cpp index 2cb39c0e..c2f2c4e5 100644 --- a/src/libs/engine/events/MidiLearnEvent.cpp +++ b/src/libs/engine/events/MidiLearnEvent.cpp @@ -64,8 +64,8 @@ MidiLearnEvent::execute(ProcessContext& context) QueuedEvent::execute(context); // FIXME: this isn't very good at all. - if (_node != NULL && _node->plugin()->type() == Plugin::Internal - && _node->plugin()->plug_label() == "midi_control_in") { + if (_node != NULL && _node->plugin_impl()->type() == Plugin::Internal + && _node->plugin_impl()->plug_label() == "midi_control_in") { ((MidiControlNode*)_node)->learn(_response_event); } } diff --git a/src/libs/engine/events/NoteEvent.cpp b/src/libs/engine/events/NoteEvent.cpp index 9c69b9df..fb0347af 100644 --- a/src/libs/engine/events/NoteEvent.cpp +++ b/src/libs/engine/events/NoteEvent.cpp @@ -71,14 +71,14 @@ NoteEvent::execute(ProcessContext& context) if (_node != NULL && _node->plugin()->type() == Plugin::Internal) { if (_on) { - if (_node->plugin()->plug_label() == "note_in") + if (_node->plugin_impl()->plug_label() == "note_in") ((MidiNoteNode*)_node)->note_on(_note_num, _velocity, _time, context); - else if (_node->plugin()->plug_label() == "trigger_in") + else if (_node->plugin_impl()->plug_label() == "trigger_in") ((MidiTriggerNode*)_node)->note_on(_note_num, _velocity, _time, context); } else { - if (_node->plugin()->plug_label() == "note_in") + if (_node->plugin_impl()->plug_label() == "note_in") ((MidiNoteNode*)_node)->note_off(_note_num, _time, context); - else if (_node->plugin()->plug_label() == "trigger_in") + else if (_node->plugin_impl()->plug_label() == "trigger_in") ((MidiTriggerNode*)_node)->note_off(_note_num, _time, context); } } diff --git a/src/libs/engine/events/PingQueuedEvent.hpp b/src/libs/engine/events/PingQueuedEvent.hpp index 88c03aaa..08897bfe 100644 --- a/src/libs/engine/events/PingQueuedEvent.hpp +++ b/src/libs/engine/events/PingQueuedEvent.hpp @@ -24,7 +24,7 @@ namespace Ingen { -class Port; +class PortImpl; /** A ping that travels through the pre-processed event queue before responding diff --git a/src/libs/engine/events/RenameEvent.cpp b/src/libs/engine/events/RenameEvent.cpp index edd67fad..72e27ec9 100644 --- a/src/libs/engine/events/RenameEvent.cpp +++ b/src/libs/engine/events/RenameEvent.cpp @@ -105,11 +105,11 @@ RenameEvent::execute(ProcessContext& context) { QueuedEvent::execute(context); - Port* port = dynamic_cast<Port*>(_store_iterator->second); + PortImpl* port = dynamic_cast<PortImpl*>(_store_iterator->second); if (port && port->parent()->parent() == NULL) { DriverPort* driver_port = NULL; - if (port->type() == DataType::FLOAT) + if (port->type() == DataType::AUDIO) driver_port = _engine.audio_driver()->driver_port(_new_path); else if (port->type() == DataType::MIDI) driver_port = _engine.midi_driver()->driver_port(_new_path); diff --git a/src/libs/engine/events/RequestObjectEvent.cpp b/src/libs/engine/events/RequestObjectEvent.cpp index 0c46546f..13ad936e 100644 --- a/src/libs/engine/events/RequestObjectEvent.cpp +++ b/src/libs/engine/events/RequestObjectEvent.cpp @@ -24,7 +24,7 @@ #include "ClientBroadcaster.hpp" #include "Patch.hpp" #include "NodeImpl.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectSender.hpp" #include "ProcessContext.hpp" @@ -79,7 +79,7 @@ RequestObjectEvent::post_process() return; } - Port* const port = dynamic_cast<Port*>(_object); + PortImpl* const port = dynamic_cast<PortImpl*>(_object); if (port) { _responder->respond_ok(); ObjectSender::send_port(_responder->client(), port); diff --git a/src/libs/engine/events/RequestPluginEvent.cpp b/src/libs/engine/events/RequestPluginEvent.cpp index f2886902..21ad97d4 100644 --- a/src/libs/engine/events/RequestPluginEvent.cpp +++ b/src/libs/engine/events/RequestPluginEvent.cpp @@ -20,7 +20,7 @@ #include "RequestPluginEvent.hpp" #include "Responder.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectStore.hpp" #include "ClientBroadcaster.hpp" #include "NodeFactory.hpp" diff --git a/src/libs/engine/events/RequestPortValueEvent.cpp b/src/libs/engine/events/RequestPortValueEvent.cpp index 224c3045..e26b1036 100644 --- a/src/libs/engine/events/RequestPortValueEvent.cpp +++ b/src/libs/engine/events/RequestPortValueEvent.cpp @@ -20,7 +20,7 @@ #include "interface/ClientInterface.hpp" #include "Responder.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ObjectStore.hpp" #include "ClientBroadcaster.hpp" #include "AudioBuffer.hpp" @@ -55,7 +55,7 @@ RequestPortValueEvent::execute(ProcessContext& context) QueuedEvent::execute(context); assert(_time >= context.start() && _time <= context.end()); - if (_port != NULL && _port->type() == DataType::FLOAT) + if (_port != NULL && (_port->type() == DataType::CONTROL || _port->type() == DataType::AUDIO)) _value = ((AudioBuffer*)_port->buffer(0))->value_at(0/*_time - start*/); else _port = NULL; // triggers error response diff --git a/src/libs/engine/events/RequestPortValueEvent.hpp b/src/libs/engine/events/RequestPortValueEvent.hpp index d3bccfdc..dd52c535 100644 --- a/src/libs/engine/events/RequestPortValueEvent.hpp +++ b/src/libs/engine/events/RequestPortValueEvent.hpp @@ -26,7 +26,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; namespace Shared { class ClientInterface; } using Shared::ClientInterface; @@ -45,9 +45,9 @@ public: void post_process(); private: - string _port_path; - Port* _port; - Sample _value; + const string _port_path; + PortImpl* _port; + Sample _value; }; diff --git a/src/libs/engine/events/SendPortActivityEvent.cpp b/src/libs/engine/events/SendPortActivityEvent.cpp index 9d8f786d..0ab3abdd 100644 --- a/src/libs/engine/events/SendPortActivityEvent.cpp +++ b/src/libs/engine/events/SendPortActivityEvent.cpp @@ -17,7 +17,7 @@ #include "SendPortActivityEvent.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ClientBroadcaster.hpp" namespace Ingen { diff --git a/src/libs/engine/events/SendPortActivityEvent.hpp b/src/libs/engine/events/SendPortActivityEvent.hpp index 565167d3..dfbb8a10 100644 --- a/src/libs/engine/events/SendPortActivityEvent.hpp +++ b/src/libs/engine/events/SendPortActivityEvent.hpp @@ -25,7 +25,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; /** A special event used internally to send port activity notification (e.g. @@ -45,7 +45,7 @@ class SendPortActivityEvent : public Event public: inline SendPortActivityEvent(Engine& engine, SampleCount timestamp, - Port* port) + PortImpl* port) : Event(engine, SharedPtr<Responder>(), timestamp) , _port(port) { @@ -58,7 +58,7 @@ public: void post_process(); private: - Port* _port; + PortImpl* _port; }; diff --git a/src/libs/engine/events/SendPortValueEvent.cpp b/src/libs/engine/events/SendPortValueEvent.cpp index f663f85c..89e8c9e0 100644 --- a/src/libs/engine/events/SendPortValueEvent.cpp +++ b/src/libs/engine/events/SendPortValueEvent.cpp @@ -18,7 +18,7 @@ #include <sstream> #include "SendPortValueEvent.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ClientBroadcaster.hpp" using namespace std; diff --git a/src/libs/engine/events/SendPortValueEvent.hpp b/src/libs/engine/events/SendPortValueEvent.hpp index 407f0119..e8505914 100644 --- a/src/libs/engine/events/SendPortValueEvent.hpp +++ b/src/libs/engine/events/SendPortValueEvent.hpp @@ -25,7 +25,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; /** A special event used internally to send port values from the audio thread. @@ -44,7 +44,7 @@ class SendPortValueEvent : public Event public: inline SendPortValueEvent(Engine& engine, SampleCount timestamp, - Port* port, + PortImpl* port, bool omni, uint32_t voice_num, Sample value) @@ -66,10 +66,10 @@ public: void post_process(); private: - Port* _port; - bool _omni; - uint32_t _voice_num; - Sample _value; + PortImpl* _port; + bool _omni; + uint32_t _voice_num; + Sample _value; }; diff --git a/src/libs/engine/events/SetPolyphonicEvent.cpp b/src/libs/engine/events/SetPolyphonicEvent.cpp index 04bdc6aa..8cca2373 100644 --- a/src/libs/engine/events/SetPolyphonicEvent.cpp +++ b/src/libs/engine/events/SetPolyphonicEvent.cpp @@ -23,7 +23,7 @@ #include "ClientBroadcaster.hpp" #include "util.hpp" #include "ObjectStore.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "NodeImpl.hpp" #include "Connection.hpp" #include "QueuedEventSource.hpp" diff --git a/src/libs/engine/events/SetPolyphonyEvent.cpp b/src/libs/engine/events/SetPolyphonyEvent.cpp index a1f03add..8e0d12cd 100644 --- a/src/libs/engine/events/SetPolyphonyEvent.cpp +++ b/src/libs/engine/events/SetPolyphonyEvent.cpp @@ -23,7 +23,7 @@ #include "ClientBroadcaster.hpp" #include "util.hpp" #include "ObjectStore.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "NodeImpl.hpp" #include "Connection.hpp" #include "QueuedEventSource.hpp" diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp index cc7a79e3..f278c083 100644 --- a/src/libs/engine/events/SetPortValueEvent.cpp +++ b/src/libs/engine/events/SetPortValueEvent.cpp @@ -19,7 +19,7 @@ #include "Responder.hpp" #include "SetPortValueEvent.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ClientBroadcaster.hpp" #include "NodeImpl.hpp" #include "ObjectStore.hpp" @@ -34,11 +34,11 @@ namespace Ingen { /** Omni (all voices) control setting */ SetPortValueEvent::SetPortValueEvent(Engine& engine, - SharedPtr<Responder> responder, - SampleCount timestamp, - const string& port_path, - uint32_t data_size, - const void* data) + SharedPtr<Responder> responder, + SampleCount timestamp, + const string& port_path, + uint32_t data_size, + const void* data) : Event(engine, responder, timestamp), _omni(true), _voice_num(0), diff --git a/src/libs/engine/events/SetPortValueEvent.hpp b/src/libs/engine/events/SetPortValueEvent.hpp index 0761ed39..c9d46a8e 100644 --- a/src/libs/engine/events/SetPortValueEvent.hpp +++ b/src/libs/engine/events/SetPortValueEvent.hpp @@ -25,7 +25,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; /** An event to change the value of a port. @@ -63,7 +63,7 @@ private: string _port_path; uint32_t _data_size; void* _data; - Port* _port; + PortImpl* _port; ErrorType _error; }; diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.cpp b/src/libs/engine/events/SetPortValueQueuedEvent.cpp index 026f22b6..7d11b1ae 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.cpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.cpp @@ -19,7 +19,7 @@ #include "SetPortValueQueuedEvent.hpp" #include "Responder.hpp" #include "Engine.hpp" -#include "Port.hpp" +#include "PortImpl.hpp" #include "ClientBroadcaster.hpp" #include "PluginImpl.hpp" #include "NodeImpl.hpp" diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.hpp b/src/libs/engine/events/SetPortValueQueuedEvent.hpp index c6a3c0ee..382a574e 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.hpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.hpp @@ -25,7 +25,7 @@ using std::string; namespace Ingen { -class Port; +class PortImpl; /** An event to change the value of a port. @@ -62,7 +62,7 @@ private: string _port_path; uint32_t _data_size; void* _data; - Port* _port; + PortImpl* _port; ErrorType _error; }; |