diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2015-07-30 18:22:16 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2016-01-20 13:31:10 +0100 |
commit | c3841a8cec9d239bca27a113c013a032dfc658bd (patch) | |
tree | c5ce7fab48505ac383ac72acd80de030c8f18a2d /drumgizmo/jackclient.cc | |
parent | 91f5d293bce4a15a1883d0693f478917bb256b40 (diff) |
Add free-wheel mode for Jack (untested).
Diffstat (limited to 'drumgizmo/jackclient.cc')
-rw-r--r-- | drumgizmo/jackclient.cc | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/drumgizmo/jackclient.cc b/drumgizmo/jackclient.cc index e4af141..a24d53a 100644 --- a/drumgizmo/jackclient.cc +++ b/drumgizmo/jackclient.cc @@ -26,20 +26,33 @@ */ #include "jackclient.h" +#include <drumgizmo.h> + extern "C" { - int _wrap_jack_process(jack_nframes_t nframes, void *arg){ - return ((JackClient*)arg)->process(nframes);} + +static int jack_process_callback(jack_nframes_t nframes, void *arg) +{ + return ((JackClient*)arg)->process(nframes); +} + +static void jack_free_wheel_callback(int starting, void *arg) +{ + ((JackClient*)arg)->setFreeWheel(starting); +} + } // extern "C" JackClient::JackClient() : refcnt(0) + , drumgizmo(NULL) { jack_status_t status; jack_client = jack_client_open("DrumGizmo", JackNullOption, &status); - jack_set_process_callback(jack_client, _wrap_jack_process, this); + jack_set_process_callback(jack_client, jack_process_callback, this); + jack_set_freewheel_callback(jack_client, jack_free_wheel_callback, this); active = false; } @@ -79,6 +92,18 @@ int JackClient::process(jack_nframes_t nframes) return 0; } +void JackClient::setFreeWheel(bool freewheel) +{ + if(drumgizmo) { + drumgizmo->setFreeWheel(freewheel); + } +} + +void JackClient::setEngine(DrumGizmo* drumgizmo) +{ + this->drumgizmo = drumgizmo; +} + JackClient *jackclient = NULL; JackClient *init_jack_client() |