diff options
author | David Robillard <d@drobilla.net> | 2007-04-08 06:04:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-04-08 06:04:32 +0000 |
commit | e96c36c1a7abb062e36efc0ac95c35fedcef922e (patch) | |
tree | 826d5caa0392201472d12c02a1c3df4cf7b275be /src/libs/engine/events/ConnectionEvent.h | |
parent | 7d69e89f22304e37fa325ce4f39a374a02072a69 (diff) | |
download | ingen-e96c36c1a7abb062e36efc0ac95c35fedcef922e.tar.gz ingen-e96c36c1a7abb062e36efc0ac95c35fedcef922e.tar.bz2 ingen-e96c36c1a7abb062e36efc0ac95c35fedcef922e.zip |
De-template-ification of port types (req. for LV2 MIDI, but nice code size reduction).
LV2 MIDI patching support (LV2 style MIDI throughout, inc. internal plugins).
git-svn-id: http://svn.drobilla.net/lad/ingen@415 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/ConnectionEvent.h')
-rw-r--r-- | src/libs/engine/events/ConnectionEvent.h | 62 |
1 files changed, 21 insertions, 41 deletions
diff --git a/src/libs/engine/events/ConnectionEvent.h b/src/libs/engine/events/ConnectionEvent.h index 79ffeaa3..8f5e1cc2 100644 --- a/src/libs/engine/events/ConnectionEvent.h +++ b/src/libs/engine/events/ConnectionEvent.h @@ -36,10 +36,9 @@ class Node; class Connection; class MidiMessage; class Port; -template <typename T> class TypedConnection; -template <typename T> class InputPort; -template <typename T> class OutputPort; -template <typename T> class TypedConnectionEvent; // helper, defined below +class Connection; +class InputPort; +class OutputPort; /** Make a Connection between two Ports. @@ -50,7 +49,6 @@ class ConnectionEvent : public QueuedEvent { public: ConnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& src_port_path, const string& dst_port_path); - ~ConnectionEvent(); void pre_process(); void execute(SampleCount nframes, FrameTime start, FrameTime end); @@ -58,52 +56,34 @@ public: private: - enum ErrorType { NO_ERROR, PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, TYPE_MISMATCH }; + enum ErrorType { + NO_ERROR, + PARENT_PATCH_DIFFERENT, + PORT_NOT_FOUND, + TYPE_MISMATCH, + ALREADY_CONNECTED, + PARENTS_NOT_FOUND + }; Raul::Path _src_port_path; Raul::Path _dst_port_path; - Patch* _patch; - Port* _src_port; - Port* _dst_port; - - QueuedEvent* _typed_event; - - ErrorType _error; -}; + Patch* _patch; + Port* _src_port; + Port* _dst_port; + OutputPort* _src_output_port; + InputPort* _dst_input_port; - -/** Templated ConnectionEvent. - * - * Intended to be called from ConnectionEvent so callers (ie OSCReceiver) - * can use ConnectionEvent without knowing anything about types (which - * they can't, since all they have is Port paths). - */ -template <typename T> -class TypedConnectionEvent : public QueuedEvent -{ -public: - TypedConnectionEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, OutputPort<T>* src_port, InputPort<T>* dst_port); + Raul::Array<Node*>* _process_order; ///< New process order for Patch - void pre_process(); - void execute(SampleCount nframes, FrameTime start, FrameTime end); - void post_process(); + Connection* _connection; + Raul::ListNode<Connection*>* _patch_listnode; + Raul::ListNode<Connection*>* _port_listnode; -private: - OutputPort<T>* _src_port; - InputPort<T>* _dst_port; - - Patch* _patch; - Raul::Array<Node*>* _process_order; ///< New process order for Patch - TypedConnection<T>* _connection; - Raul::ListNode<Connection*>* _patch_listnode; - Raul::ListNode<TypedConnection<T>*>* _port_listnode; - - bool _succeeded; + ErrorType _error; }; - } // namespace Ingen #endif // CONNECTIONEVENT_H |