diff options
author | David Robillard <d@drobilla.net> | 2007-12-19 23:15:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-12-19 23:15:34 +0000 |
commit | 5fa2982af5927d1e6a72969b86ab64c98414fe2c (patch) | |
tree | 59a5f9b86fcb8faac131c240aff48c6c8ea967d0 /src/PatchageEvent.hpp | |
parent | 5c092eb9b185c92fe11926a72a7bdaeb638520b3 (diff) | |
download | patchage-5fa2982af5927d1e6a72969b86ab64c98414fe2c.tar.gz patchage-5fa2982af5927d1e6a72969b86ab64c98414fe2c.tar.bz2 patchage-5fa2982af5927d1e6a72969b86ab64c98414fe2c.zip |
Tidy.
git-svn-id: http://svn.drobilla.net/lad/patchage@985 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.hpp')
-rw-r--r-- | src/PatchageEvent.hpp | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/src/PatchageEvent.hpp b/src/PatchageEvent.hpp index 79f6948..0d982bf 100644 --- a/src/PatchageEvent.hpp +++ b/src/PatchageEvent.hpp @@ -25,9 +25,6 @@ #endif #include "PatchagePort.hpp" -#include <iostream> -using namespace std; - class Patchage; @@ -48,25 +45,19 @@ public: : _type(type) {} - PatchageEvent(Type type, jack_port_id_t port) + template <typename P> + PatchageEvent(Type type, P port) : _type(type) , _port_1(port) {} - PatchageEvent(Type type, jack_port_id_t port_1, jack_port_id_t port_2) - : _type(type) - , _port_1(port_1) - , _port_2(port_2) - {} - -#ifdef HAVE_ALSA - PatchageEvent(Type type, snd_seq_addr_t port_1, snd_seq_addr_t port_2) + template <typename P> + PatchageEvent(Type type, P port_1, P port_2) : _type(type) , _port_1(port_1, false) , _port_2(port_2, true) {} -#endif - + void execute(Patchage* patchage); inline Type type() const { return (Type)_type; } @@ -77,28 +68,28 @@ private: struct PortRef { PortRef() : type(NULL_PORT_REF) { memset(&id, 0, sizeof(id)); } - PortRef(jack_port_id_t jack_id) : type(JACK_ID) { id.jack_id = jack_id; } - PortRef(jack_port_t* jack_port) : type(JACK_PORT) { id.jack_port = jack_port; } + PortRef(jack_port_id_t jack_id, bool ign=false) + : type(JACK_ID) { id.jack_id = jack_id; } + + PortRef(jack_port_t* jack_port, bool ign=false) + : type(JACK_PORT) { id.jack_port = jack_port; } #ifdef HAVE_ALSA - PortRef(snd_seq_addr_t addr, bool input) : type(ALSA_ADDR) - { id.alsa_addr = addr; is_input = input; } + PortRef(snd_seq_addr_t addr, bool in) + : type(ALSA_ADDR) { id.alsa_addr = addr; is_input = in; } + + bool is_input; #endif enum { NULL_PORT_REF, JACK_ID, JACK_PORT, ALSA_ADDR } type; union { - jack_port_t* jack_port; + jack_port_t* jack_port; jack_port_id_t jack_id; #ifdef HAVE_ALSA snd_seq_addr_t alsa_addr; #endif } id; - -#ifdef HAVE_ALSA - bool is_input; -#endif - }; PortRef _port_1; |