From 32606894c67e6be27ba853a8bc3e97c808c14987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Wed, 13 Jul 2016 16:33:11 +0200 Subject: Introduce output engine isFreewheeling method. --- drumgizmo/output/alsa.cc | 5 +++++ drumgizmo/output/alsa.h | 1 + drumgizmo/output/jackaudio.cc | 5 +++++ drumgizmo/output/jackaudio.h | 1 + drumgizmo/output/outputdummy.cc | 5 +++++ drumgizmo/output/outputdummy.h | 1 + drumgizmo/output/wavfile.cc | 5 +++++ drumgizmo/output/wavfile.h | 1 + 8 files changed, 24 insertions(+) (limited to 'drumgizmo/output') diff --git a/drumgizmo/output/alsa.cc b/drumgizmo/output/alsa.cc index aea80a6..1241cad 100644 --- a/drumgizmo/output/alsa.cc +++ b/drumgizmo/output/alsa.cc @@ -191,3 +191,8 @@ size_t AlsaOutputEngine::getSamplerate() const { return srate; } + +bool AlsaOutputEngine::isFreewheeling() const +{ + return false; +} diff --git a/drumgizmo/output/alsa.h b/drumgizmo/output/alsa.h index cc28f94..56011b6 100644 --- a/drumgizmo/output/alsa.h +++ b/drumgizmo/output/alsa.h @@ -50,6 +50,7 @@ public: void run(int ch, sample_t* samples, size_t nsamples) override; void post(size_t nsamples) override; size_t getSamplerate() const override; + bool isFreewheeling() const override; private: snd_pcm_t* handle; diff --git a/drumgizmo/output/jackaudio.cc b/drumgizmo/output/jackaudio.cc index 75766d1..2274bea 100644 --- a/drumgizmo/output/jackaudio.cc +++ b/drumgizmo/output/jackaudio.cc @@ -123,6 +123,11 @@ size_t JackAudioOutputEngine::getSamplerate() const return client.getSampleRate(); } +bool JackAudioOutputEngine::isFreewheeling() const +{ + return client.isFreewheeling(); +} + void JackAudioOutputEngine::onLatencyChange(std::size_t latency) { this->latency = latency; diff --git a/drumgizmo/output/jackaudio.h b/drumgizmo/output/jackaudio.h index b8fbcab..ce18f6f 100644 --- a/drumgizmo/output/jackaudio.h +++ b/drumgizmo/output/jackaudio.h @@ -49,6 +49,7 @@ public: void post(size_t nsamples) override; size_t getBufferSize() const override; size_t getSamplerate() const override; + bool isFreewheeling() const override; void onLatencyChange(std::size_t latency) override; // based on JackProcess diff --git a/drumgizmo/output/outputdummy.cc b/drumgizmo/output/outputdummy.cc index 4ff0816..3cb3ac4 100644 --- a/drumgizmo/output/outputdummy.cc +++ b/drumgizmo/output/outputdummy.cc @@ -63,3 +63,8 @@ void DummyOutputEngine::run(int ch, sample_t* samples, size_t nsamples) void DummyOutputEngine::post(size_t nsamples) { } + +bool DummyOutputEngine::isFreewheeling() const +{ + return false; +} diff --git a/drumgizmo/output/outputdummy.h b/drumgizmo/output/outputdummy.h index 5a1b2fa..3e24495 100644 --- a/drumgizmo/output/outputdummy.h +++ b/drumgizmo/output/outputdummy.h @@ -42,4 +42,5 @@ public: void pre(size_t nsamples) override; void run(int ch, sample_t* samples, size_t nsamples) override; void post(size_t nsamples) override; + bool isFreewheeling() const override; }; diff --git a/drumgizmo/output/wavfile.cc b/drumgizmo/output/wavfile.cc index 20b63bd..c82a365 100644 --- a/drumgizmo/output/wavfile.cc +++ b/drumgizmo/output/wavfile.cc @@ -152,3 +152,8 @@ void WavfileOutputEngine::onLatencyChange(std::size_t latency) { this->latency = latency; } + +bool WavfileOutputEngine::isFreewheeling() const +{ + return true; +} diff --git a/drumgizmo/output/wavfile.h b/drumgizmo/output/wavfile.h index 656c0cd..63bf0e4 100644 --- a/drumgizmo/output/wavfile.h +++ b/drumgizmo/output/wavfile.h @@ -51,6 +51,7 @@ public: void post(std::size_t nsamples) override; std::size_t getSamplerate() const override; void onLatencyChange(std::size_t latency) override; + bool isFreewheeling() const override; private: SF_INFO info; -- cgit v1.2.3