diff options
author | David Robillard <d@drobilla.net> | 2007-06-08 17:01:52 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-08 17:01:52 +0000 |
commit | 5c24064f179d2d3b838d9b4bcfeb1d6c516ea3bb (patch) | |
tree | b54ce73a2bdc402685d3c2dcf2154d88a511a84e /src/PatchageEvent.h | |
parent | b11af4da2f170107124f5fb171a826d7ebb003fb (diff) | |
download | patchage-5c24064f179d2d3b838d9b4bcfeb1d6c516ea3bb.tar.gz patchage-5c24064f179d2d3b838d9b4bcfeb1d6c516ea3bb.tar.bz2 patchage-5c24064f179d2d3b838d9b4bcfeb1d6c516ea3bb.zip |
Use new Jack connection notifications instead of a full refresh (huge performance improvement).
git-svn-id: http://svn.drobilla.net/lad/patchage@536 a436a847-0d15-0410-975c-d299462d15a1
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; }; |