From f240b08a1799b3aa6a29701c90388d51c0c1b2ce Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 18 Feb 2017 18:32:02 +0100 Subject: Add experimental PortAudio driver --- src/server/JackDriver.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/server/JackDriver.cpp') diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 77eb62b3..b228faf7 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -140,31 +140,36 @@ JackDriver::attach(const std::string& server_name, return true; } -void +bool JackDriver::activate() { World* world = _engine.world(); if (_is_activated) { _engine.log().warn("Jack driver already activated\n"); - return; + return false; } if (!_client) attach(world->conf().option("jack-server").ptr(), world->conf().option("jack-name").ptr(), NULL); + if (!_client) { + return false; + } + jack_set_process_callback(_client, process_cb, this); _is_activated = true; if (jack_activate(_client)) { _engine.log().error("Could not activate Jack client, aborting\n"); - exit(EXIT_FAILURE); + return false; } else { _engine.log().info(fmt("Activated Jack client `%1%'\n") % world->conf().option("jack-name").ptr()); } + return true; } void @@ -479,6 +484,7 @@ JackDriver::_process_cb(jack_nframes_t nframes) pre_process_port(_engine.run_context(), &p); } + // Process _engine.run(nframes); // Write output -- cgit v1.2.1