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 --- raul/JackDriver.h | 3 +++ src/JackDriver.cpp | 35 +++++++++++++++++++++++++---------- src/RDFWriter.cpp | 4 ++-- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/raul/JackDriver.h b/raul/JackDriver.h index 17d7d4c..8ec2572 100644 --- a/raul/JackDriver.h +++ b/raul/JackDriver.h @@ -42,6 +42,9 @@ public: void attach(const string& client_name, string server_name=""); void detach(); + void activate(); + void deactivate(); + bool is_attached() const { return (_client != NULL); } bool is_realtime() const { return _client && jack_is_realtime(_client); } 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*/) { diff --git a/src/RDFWriter.cpp b/src/RDFWriter.cpp index 33bc220..f2d5626 100644 --- a/src/RDFWriter.cpp +++ b/src/RDFWriter.cpp @@ -26,8 +26,8 @@ using namespace std; namespace Raul { -//static const char* const RDF_LANG = "rdfxml-abbrev"; -static const char* const RDF_LANG = "turtle"; +static const char* const RDF_LANG = "rdfxml-abbrev"; +//static const char* const RDF_LANG = "turtle"; RDFWriter::RDFWriter() -- cgit v1.2.1