summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)