From 2c86dc7a3c25e95e3c35c945f9b54ff8c0b858a1 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 24 Mar 2016 11:43:28 +0100 Subject: Make jack process callback private. --- drumgizmo/jackclient.cc | 9 ++++++--- drumgizmo/jackclient.h | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'drumgizmo') diff --git a/drumgizmo/jackclient.cc b/drumgizmo/jackclient.cc index 4f14c09..e493e1b 100644 --- a/drumgizmo/jackclient.cc +++ b/drumgizmo/jackclient.cc @@ -52,16 +52,19 @@ JackPort::~JackPort() // -------------------------------------------------------------------- -static int _wrap_jack_process(jack_nframes_t nframes, void* arg) +int JackClient::wrapJackProcess(jack_nframes_t nframes, void* arg) { return static_cast(arg)->process(nframes); } -JackClient::JackClient() : client{nullptr}, processes{}, is_active{false} +JackClient::JackClient() + : client{nullptr} + , processes{} + , is_active{false} { jack_status_t status; client = jack_client_open("DrumGizmo", JackNullOption, &status); - jack_set_process_callback(client, _wrap_jack_process, this); + jack_set_process_callback(client, JackClient::wrapJackProcess, this); } JackClient::~JackClient() diff --git a/drumgizmo/jackclient.h b/drumgizmo/jackclient.h index f219ec1..82cc0ed 100644 --- a/drumgizmo/jackclient.h +++ b/drumgizmo/jackclient.h @@ -68,7 +68,7 @@ public: void add(JackProcess& process); void remove(JackProcess& process); void activate(); - int process(jack_nframes_t num_frames); + std::size_t getBufferSize() const; std::size_t getSampleRate() const; @@ -76,4 +76,8 @@ private: jack_client_t* client; std::set processes; bool is_active; + + int process(jack_nframes_t num_frames); + + static int wrapJackProcess(jack_nframes_t nframes, void* arg); }; -- cgit v1.2.3