summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-12-19 22:58:06 +0000
committerDavid Robillard <d@drobilla.net>2007-12-19 22:58:06 +0000
commit5c092eb9b185c92fe11926a72a7bdaeb638520b3 (patch)
treeb421007d88df4fa82a02b98d498425bbf54df0f0
parent507ddc607504f0629e9cc110fa1a6b1c28477f85 (diff)
downloadpatchage-5c092eb9b185c92fe11926a72a7bdaeb638520b3.tar.gz
patchage-5c092eb9b185c92fe11926a72a7bdaeb638520b3.tar.bz2
patchage-5c092eb9b185c92fe11926a72a7bdaeb638520b3.zip
Follow ALSA changes, in a kludgey ridiculously slow way.
git-svn-id: http://svn.drobilla.net/lad/patchage@984 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/AlsaDriver.cpp3
-rw-r--r--src/PatchageEvent.cpp4
-rw-r--r--src/PatchageEvent.hpp5
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)