From e96c36c1a7abb062e36efc0ac95c35fedcef922e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 8 Apr 2007 06:04:32 +0000 Subject: 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 --- src/libs/engine/events/ConnectionEvent.h | 62 +++++++++++--------------------- 1 file changed, 21 insertions(+), 41 deletions(-) (limited to 'src/libs/engine/events/ConnectionEvent.h') 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 class TypedConnection; -template class InputPort; -template class OutputPort; -template 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, 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 -class TypedConnectionEvent : public QueuedEvent -{ -public: - TypedConnectionEvent(Engine& engine, SharedPtr responder, FrameTime time, OutputPort* src_port, InputPort* dst_port); + Raul::Array* _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* _patch_listnode; + Raul::ListNode* _port_listnode; -private: - OutputPort* _src_port; - InputPort* _dst_port; - - Patch* _patch; - Raul::Array* _process_order; ///< New process order for Patch - TypedConnection* _connection; - Raul::ListNode* _patch_listnode; - Raul::ListNode*>* _port_listnode; - - bool _succeeded; + ErrorType _error; }; - } // namespace Ingen #endif // CONNECTIONEVENT_H -- cgit v1.2.1