summaryrefslogtreecommitdiffstats
path: root/src/server/JackDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-02-18 18:32:02 +0100
committerDavid Robillard <d@drobilla.net>2017-02-18 19:38:13 +0100
commitf240b08a1799b3aa6a29701c90388d51c0c1b2ce (patch)
tree28ec7429aa10f28710023fdcc43d07a4f0b4ebc9 /src/server/JackDriver.cpp
parent6141b832946006a6ec3c1a3a70bd729c0404771e (diff)
downloadingen-f240b08a1799b3aa6a29701c90388d51c0c1b2ce.tar.gz
ingen-f240b08a1799b3aa6a29701c90388d51c0c1b2ce.tar.bz2
ingen-f240b08a1799b3aa6a29701c90388d51c0c1b2ce.zip
Add experimental PortAudio driver
Diffstat (limited to 'src/server/JackDriver.cpp')
-rw-r--r--src/server/JackDriver.cpp12
1 files changed, 9 insertions, 3 deletions
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<char>(),
world->conf().option("jack-name").ptr<char>(), 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<char>());
}
+ 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