summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/ConnectionEvent.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/events/ConnectionEvent.h')
-rw-r--r--src/libs/engine/events/ConnectionEvent.h62
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