From 5c092eb9b185c92fe11926a72a7bdaeb638520b3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 19 Dec 2007 22:58:06 +0000 Subject: Follow ALSA changes, in a kludgey ridiculously slow way. git-svn-id: http://svn.drobilla.net/lad/patchage@984 a436a847-0d15-0410-975c-d299462d15a1 --- src/AlsaDriver.cpp | 3 ++- src/PatchageEvent.cpp | 4 +++- src/PatchageEvent.hpp | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index d42cd7c..24cb850 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -544,7 +544,8 @@ AlsaDriver::_refresh_main() case SND_SEQ_EVENT_CLIENT_CHANGE: case SND_SEQ_EVENT_RESET: default: - cout << "Unknown ALSA event: " << (int)ev->type << endl; + // FIXME: Ultra slow kludge, use proper find-grained events + _events.push(PatchageEvent(PatchageEvent::REFRESH)); } } } diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index c3fd144..2b2941b 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -71,7 +71,9 @@ PatchageEvent::execute(Patchage* patchage) { //cerr << "{ EXECUTING EVENT" << endl; - if (_type == PORT_CREATION) { + if (_type == REFRESH) { + patchage->refresh(); + } else if (_type == PORT_CREATION) { jack_port_t* jack_port = NULL; if (patchage->jack_driver()->client()) jack_port = jack_port_by_id(patchage->jack_driver()->client(), _port_1.id.jack_id); diff --git a/src/PatchageEvent.hpp b/src/PatchageEvent.hpp index 678f7e0..79f6948 100644 --- a/src/PatchageEvent.hpp +++ b/src/PatchageEvent.hpp @@ -37,14 +37,15 @@ class PatchageEvent { public: enum Type { NULL_EVENT = 0, + REFRESH, PORT_CREATION, PORT_DESTRUCTION, CONNECTION, DISCONNECTION }; - PatchageEvent() - : _type(NULL_EVENT) + PatchageEvent(Type type=NULL_EVENT) + : _type(type) {} PatchageEvent(Type type, jack_port_id_t port) -- cgit v1.2.1