diff options
Diffstat (limited to 'src/PatchageEvent.h')
-rw-r--r-- | src/PatchageEvent.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/PatchageEvent.h b/src/PatchageEvent.h index da2526b..c249613 100644 --- a/src/PatchageEvent.h +++ b/src/PatchageEvent.h @@ -21,6 +21,9 @@ #include <string> #include <jack/jack.h> #include "../config.h" +#ifdef HAVE_ALSA +#include <alsa/asoundlib.h> +#endif #include "PatchagePort.h" class Patchage; @@ -50,12 +53,22 @@ public: {} PatchageEvent(Patchage* patchage, Type type, + jack_port_id_t port_1, jack_port_id_t port_2) + : _patchage(patchage) + , _type(type) + , _port_1(port_1) + , _port_2(port_2) + {} + +#ifdef HAVE_ALSA + PatchageEvent(Patchage* patchage, Type type, snd_seq_addr_t port_1, snd_seq_addr_t port_2) : _patchage(patchage) , _type(type) , _port_1(port_1) , _port_2(port_2) {} +#endif void execute(); @@ -66,19 +79,22 @@ private: Type _type; struct PortRef { - PortRef() : type((PortType)0xdeadbeef) { id.jack = 0; } + PortRef() : type(NULL_PORT_REF) { id.jack_id = 0; } - PortRef(jack_port_id_t jack_id) : type(JACK_ANY) { id.jack = jack_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; } #ifdef HAVE_ALSA - PortRef(snd_seq_addr_t addr) : type(ALSA_MIDI) { id.alsa = addr; } + PortRef(snd_seq_addr_t addr) : type(ALSA_ADDR) { id.alsa_addr = addr; } #endif - PortType type; + enum { NULL_PORT_REF, JACK_ID, JACK_PORT, ALSA_ADDR } type; + union { - jack_port_id_t jack; + jack_port_t* jack_port; + jack_port_id_t jack_id; #ifdef HAVE_ALSA - snd_seq_addr_t alsa; + snd_seq_addr_t alsa_addr; #endif } id; }; |