From 72a91851b2d33e76937702579ef8c3efb9825aa9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 24 Feb 2007 02:48:12 +0000 Subject: Split JackDriver 'attaching' and 'activating' to give derived classes a chance to set things up in overloaded attach methods before the process callback starts firing. Switch RDF syntax to RDF/XML (temporarily, until raptor 1.1.14 hits distros). git-svn-id: http://svn.drobilla.net/lad/raul@333 a436a847-0d15-0410-975c-d299462d15a1 --- src/JackDriver.cpp | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'src/JackDriver.cpp') diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index cededca..486f076 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -78,16 +78,7 @@ JackDriver::attach(const string& client_name, string server_name) //_is_dirty = true; _buffer_size = jack_get_buffer_size(_client); - - if (!jack_activate(_client)) { - _is_activated = true; - //signal_attached.emit(); - //_app->status_message("[JACK] Attached"); - } else { - //_app->status_message("[JACK] ERROR: Failed to attach"); - _is_activated = false; } - } } @@ -95,7 +86,7 @@ void JackDriver::detach() { if (_client) { - jack_deactivate(_client); + deactivate(); jack_client_close(_client); _client = NULL; _is_activated = false; @@ -104,6 +95,30 @@ JackDriver::detach() } +void +JackDriver::activate() +{ + if (!jack_activate(_client)) { + _is_activated = true; + //signal_attached.emit(); + //_app->status_message("[JACK] Attached"); + } else { + //_app->status_message("[JACK] ERROR: Failed to attach"); + _is_activated = false; + } +} + + +void +JackDriver::deactivate() +{ + if (_client) + jack_deactivate(_client); + + _is_activated = false; +} + + void JackDriver::jack_port_registration_cb(jack_port_id_t /*port_id*/, int /*registered*/, void* /*jack_driver*/) { -- cgit v1.2.1