summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/DisconnectionEvent.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-08 06:04:32 +0000
committerDavid Robillard <d@drobilla.net>2007-04-08 06:04:32 +0000
commite96c36c1a7abb062e36efc0ac95c35fedcef922e (patch)
tree826d5caa0392201472d12c02a1c3df4cf7b275be /src/libs/engine/events/DisconnectionEvent.h
parent7d69e89f22304e37fa325ce4f39a374a02072a69 (diff)
downloadingen-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/DisconnectionEvent.h')
-rw-r--r--src/libs/engine/events/DisconnectionEvent.h63
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