summaryrefslogtreecommitdiffstats
path: root/src/JackDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-02-20 18:40:16 +0000
committerDavid Robillard <d@drobilla.net>2008-02-20 18:40:16 +0000
commit75b652d59639cf0171fe51a0c1442d03081f3b2f (patch)
tree91234a404baba903e3a3a3327de2a49fe9d51ba7 /src/JackDriver.cpp
parentbbb3abbe4b86a23ef884d38ca299aff13b8f9242 (diff)
downloadpatchage-75b652d59639cf0171fe51a0c1442d03081f3b2f.tar.gz
patchage-75b652d59639cf0171fe51a0c1442d03081f3b2f.tar.bz2
patchage-75b652d59639cf0171fe51a0c1442d03081f3b2f.zip
Support jack client de-registration event.
git-svn-id: http://svn.drobilla.net/lad/patchage@1152 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/JackDriver.cpp')
-rw-r--r--src/JackDriver.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp
index 3a57047..0586717 100644
--- a/src/JackDriver.cpp
+++ b/src/JackDriver.cpp
@@ -75,6 +75,7 @@ JackDriver::attach(bool launch_daemon)
jack_set_error_function(error_cb);
jack_on_shutdown(client, jack_shutdown_cb, this);
+ jack_set_client_registration_callback(client, jack_client_registration_cb, this);
jack_set_port_registration_callback(client, jack_port_registration_cb, this);
jack_set_port_connect_callback(client, jack_port_connect_cb, this);
jack_set_graph_order_callback(client, jack_graph_order_cb, this);
@@ -461,15 +462,33 @@ JackDriver::disconnect(boost::shared_ptr<PatchagePort> const src_port, boost::sh
void
-JackDriver::jack_port_registration_cb(jack_port_id_t port_id, int registered, void* jack_driver)
+JackDriver::jack_client_registration_cb(const char* name, int registered, void* jack_driver)
{
assert(jack_driver);
JackDriver* me = reinterpret_cast<JackDriver*>(jack_driver);
assert(me->_client);
- jack_port_t* const port = jack_port_by_id(me->_client, port_id);
- const string full_name = jack_port_name(port);
+ jack_reset_max_delayed_usecs(me->_client);
+
+ // FIXME: This sucks, not realtime :(
+ if (registered) {
+ me->_events.push(PatchageEvent(me, PatchageEvent::CLIENT_CREATION, name));
+ } else {
+ me->_events.push(PatchageEvent(me, PatchageEvent::CLIENT_DESTRUCTION, name));
+ }
+}
+
+
+void
+JackDriver::jack_port_registration_cb(jack_port_id_t port_id, int registered, void* jack_driver)
+{
+ assert(jack_driver);
+ JackDriver* me = reinterpret_cast<JackDriver*>(jack_driver);
+ assert(me->_client);
+ //jack_port_t* const port = jack_port_by_id(me->_client, port_id);
+ //const string full_name = jack_port_name(port);
+
jack_reset_max_delayed_usecs(me->_client);
if (registered) {