From 5c24064f179d2d3b838d9b4bcfeb1d6c516ea3bb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 8 Jun 2007 17:01:52 +0000 Subject: 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 --- src/PatchageEvent.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/PatchageEvent.h') 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 #include #include "../config.h" +#ifdef HAVE_ALSA +#include +#endif #include "PatchagePort.h" class Patchage; @@ -49,6 +52,15 @@ public: , _port_1(port) {} + 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) @@ -56,6 +68,7 @@ public: , _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; }; -- cgit v1.2.1