From eb3a5e8834c1af80fc5196e5c8f5788e8a2b2167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Wed, 13 Jul 2016 18:32:52 +0200 Subject: Introduce input engine isFreewheeling method. --- drumgizmo/input/inputdummy.cc | 5 +++++ drumgizmo/input/inputdummy.h | 1 + drumgizmo/input/jackmidi.cc | 5 +++++ drumgizmo/input/jackmidi.h | 1 + drumgizmo/input/midifile.cc | 5 +++++ drumgizmo/input/midifile.h | 1 + drumgizmo/input/test.cc | 5 +++++ drumgizmo/input/test.h | 1 + 8 files changed, 24 insertions(+) (limited to 'drumgizmo') diff --git a/drumgizmo/input/inputdummy.cc b/drumgizmo/input/inputdummy.cc index 971ef29..54643ae 100644 --- a/drumgizmo/input/inputdummy.cc +++ b/drumgizmo/input/inputdummy.cc @@ -63,3 +63,8 @@ void DummyInputEngine::run(size_t pos, size_t len, std::vector& events) void DummyInputEngine::post() { } + +bool DummyInputEngine::isFreewheeling() const +{ + return false; +} diff --git a/drumgizmo/input/inputdummy.h b/drumgizmo/input/inputdummy.h index 7888f33..9420319 100644 --- a/drumgizmo/input/inputdummy.h +++ b/drumgizmo/input/inputdummy.h @@ -42,4 +42,5 @@ public: void pre() override; void run(size_t pos, size_t len, std::vector& events) override; void post() override; + bool isFreewheeling() const override; }; diff --git a/drumgizmo/input/jackmidi.cc b/drumgizmo/input/jackmidi.cc index 7eeae7d..7c5cf1c 100644 --- a/drumgizmo/input/jackmidi.cc +++ b/drumgizmo/input/jackmidi.cc @@ -101,6 +101,11 @@ void JackMidiInputEngine::post() { } +bool JackMidiInputEngine::isFreewheeling() const +{ + return client.isFreewheeling(); +} + void JackMidiInputEngine::process(jack_nframes_t num_frames) { assert(port != nullptr); diff --git a/drumgizmo/input/jackmidi.h b/drumgizmo/input/jackmidi.h index 1532b18..96e2d03 100644 --- a/drumgizmo/input/jackmidi.h +++ b/drumgizmo/input/jackmidi.h @@ -50,6 +50,7 @@ public: void pre() override; void run(size_t pos, size_t len, std::vector& events) override; void post() override; + bool isFreewheeling() const override; // based on JackProcess void process(jack_nframes_t num_frames) override; diff --git a/drumgizmo/input/midifile.cc b/drumgizmo/input/midifile.cc index 6a24a00..89ffa6b 100644 --- a/drumgizmo/input/midifile.cc +++ b/drumgizmo/input/midifile.cc @@ -195,3 +195,8 @@ void MidifileInputEngine::setSampleRate(double sample_rate) { this->samplerate = sample_rate; } + +bool MidifileInputEngine::isFreewheeling() const +{ + return true; +} diff --git a/drumgizmo/input/midifile.h b/drumgizmo/input/midifile.h index 518d8d2..5756718 100644 --- a/drumgizmo/input/midifile.h +++ b/drumgizmo/input/midifile.h @@ -50,6 +50,7 @@ public: void run(size_t pos, size_t len, std::vector& events) override; void post() override; void setSampleRate(double sample_rate) override; + bool isFreewheeling() const override; private: smf_t* smf; diff --git a/drumgizmo/input/test.cc b/drumgizmo/input/test.cc index 5025d2c..75b6774 100644 --- a/drumgizmo/input/test.cc +++ b/drumgizmo/input/test.cc @@ -118,3 +118,8 @@ void TestInputEngine::setSampleRate(double sample_rate) { this->sample_rate = sample_rate; } + +bool TestInputEngine::isFreewheeling() const +{ + return false; +} diff --git a/drumgizmo/input/test.h b/drumgizmo/input/test.h index 70936ea..baf7c95 100644 --- a/drumgizmo/input/test.h +++ b/drumgizmo/input/test.h @@ -46,6 +46,7 @@ public: void run(size_t pos, size_t len, std::vector& events) override; void post() override; void setSampleRate(double sample_rate) override; + bool isFreewheeling() const override; private: float probability; -- cgit v1.2.3