summaryrefslogtreecommitdiff
path: root/drumgizmo/audiooutputenginedl.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-05-20 08:26:48 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-05-20 08:26:48 +0200
commita609e6895a96db134697acce266e0cb94488f60b (patch)
tree77d854e202e973349e3500b10dc36069e388105b /drumgizmo/audiooutputenginedl.cc
parent98430d96a1d25cba36ad304fde6518e493fe3441 (diff)
Centralise jackclient code for reuse among the jack client modules. Implement most of the jackaudio output module (probably broken atm.).
Diffstat (limited to 'drumgizmo/audiooutputenginedl.cc')
-rw-r--r--drumgizmo/audiooutputenginedl.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/drumgizmo/audiooutputenginedl.cc b/drumgizmo/audiooutputenginedl.cc
index 411c14b..ad8d815 100644
--- a/drumgizmo/audiooutputenginedl.cc
+++ b/drumgizmo/audiooutputenginedl.cc
@@ -33,6 +33,8 @@
AudioOutputEngineDL::AudioOutputEngineDL(std::string name)
{
+ is_jack_plugin = strstr(name.c_str(), "jack");
+
std::string plugin = OUTPUT_PLUGIN_DIR"/lib" + name + ".so";
void *lib = dlopen(plugin.c_str(), RTLD_LAZY);
if(!lib) {
@@ -104,11 +106,19 @@ AudioOutputEngineDL::AudioOutputEngineDL(std::string name)
}
ptr = o_create();
+
+ if(is_jack_plugin) {
+ char ptrbuf[32];
+ jackclient = init_jack_client();
+ sprintf(ptrbuf, "%p", jackclient);
+ setParm("jack_client", ptrbuf);
+ }
}
AudioOutputEngineDL::~AudioOutputEngineDL()
{
o_destroy(ptr);
+ if(is_jack_plugin) close_jack_client();
}
bool AudioOutputEngineDL::init(Channels channels)
@@ -135,6 +145,7 @@ void AudioOutputEngineDL::setParm(std::string parm, std::string value)
bool AudioOutputEngineDL::start()
{
+ if(is_jack_plugin) jackclient->activate();
return o_start(ptr);
}