diff options
Diffstat (limited to 'src/libs/engine/events/DisconnectionEvent.h')
-rw-r--r-- | src/libs/engine/events/DisconnectionEvent.h | 63 |
1 files changed, 22 insertions, 41 deletions
diff --git a/src/libs/engine/events/DisconnectionEvent.h b/src/libs/engine/events/DisconnectionEvent.h index 01a72e85..3faeb23e 100644 --- a/src/libs/engine/events/DisconnectionEvent.h +++ b/src/libs/engine/events/DisconnectionEvent.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 TypedDisconnectionEvent; // helper, defined below +class Connection; +class InputPort; +class OutputPort; /** Make a Connection between two Ports. @@ -51,7 +50,6 @@ 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(); void pre_process(); void execute(SampleCount nframes, FrameTime start, FrameTime end); @@ -59,50 +57,33 @@ public: private: - enum ErrorType { NO_ERROR, PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, TYPE_MISMATCH }; - - Path _src_port_path; - Path _dst_port_path; + enum ErrorType { + NO_ERROR, + PARENT_PATCH_DIFFERENT, + PORT_NOT_FOUND, + TYPE_MISMATCH, + NOT_CONNECTED, + PARENTS_NOT_FOUND, + CONNECTION_NOT_FOUND + }; - Patch* _patch; - Port* _src_port; - Port* _dst_port; - - bool _lookup; - QueuedEvent* _typed_event; + Path _src_port_path; + Path _dst_port_path; - ErrorType _error; -}; + Patch* _patch; + Port* _src_port; + Port* _dst_port; + OutputPort* _src_output_port; + InputPort* _dst_input_port; - -/** Templated DisconnectionEvent. - * - * Intended to be called from DisconnectionEvent so callers (ie OSCReceiver) - * can use DisconnectionEvent without knowing anything about types (which - * they can't, since all they have is Port paths). - */ -template <typename T> -class TypedDisconnectionEvent : public QueuedEvent -{ -public: - TypedDisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, OutputPort<T>* src_port, InputPort<T>* dst_port); + bool _lookup; - void pre_process(); - void execute(SampleCount nframes, FrameTime start, FrameTime end); - void post_process(); - -private: - OutputPort<T>* _src_port; - InputPort<T>* _dst_port; - - Patch* _patch; - Raul::Array<Node*>* _process_order; ///< New process order for Patch + Raul::Array<Node*>* _process_order; ///< New process order for Patch - bool _succeeded; + ErrorType _error; }; - } // namespace Ingen #endif // DISCONNECTIONEVENT_H |