summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/dgreftest/midiinputengine.cc5
-rw-r--r--test/dgreftest/midiinputengine.h1
-rw-r--r--test/enginetest.cc34
3 files changed, 24 insertions, 16 deletions
diff --git a/test/dgreftest/midiinputengine.cc b/test/dgreftest/midiinputengine.cc
index 84f4cc6..e984d58 100644
--- a/test/dgreftest/midiinputengine.cc
+++ b/test/dgreftest/midiinputengine.cc
@@ -192,6 +192,11 @@ void MidifileInputEngine::post()
{
}
+void MidifileInputEngine::setSampleRate(double sample_rate)
+{
+ this->samplerate = sample_rate;
+}
+
bool MidifileInputEngine::isFreewheeling() const
{
return true;
diff --git a/test/dgreftest/midiinputengine.h b/test/dgreftest/midiinputengine.h
index a752ff5..ffd22f8 100644
--- a/test/dgreftest/midiinputengine.h
+++ b/test/dgreftest/midiinputengine.h
@@ -50,6 +50,7 @@ public:
void pre() override;
void run(size_t pos, size_t len, std::vector<event_t>& events) override;
void post() override;
+ void setSampleRate(double sample_rate) override;
bool isFreewheeling() const override;
private:
diff --git a/test/enginetest.cc b/test/enginetest.cc
index cb21609..585b0d1 100644
--- a/test/enginetest.cc
+++ b/test/enginetest.cc
@@ -37,34 +37,36 @@ class AudioOutputEngineDummy
: public AudioOutputEngine
{
public:
- bool init(const Channels& channels) { return true; }
+ bool init(const Channels& channels) override { return true; }
- void setParm(const std::string& parm, const std::string& value) {}
+ void setParm(const std::string& parm, const std::string& value) override {}
- bool start() { return true; }
- void stop() {}
+ bool start() override { return true; }
+ void stop() override {}
- void pre(size_t nsamples) {}
- void run(int ch, sample_t *samples, size_t nsamples) {}
- void post(size_t nsamples) {}
- bool isFreewheeling() const { return true; }
+ void pre(size_t nsamples) override {}
+ void run(int ch, sample_t *samples, size_t nsamples) override {}
+ void post(size_t nsamples) override {}
+ std::size_t getSamplerate() const override { return 44100; }
+ bool isFreewheeling() const override { return true; }
};
class AudioInputEngineDummy
: public AudioInputEngine
{
public:
- bool init(const Instruments& instruments) { return true; }
+ bool init(const Instruments& instruments) override { return true; }
- void setParm(const std::string& parm, const std::string& value) {}
+ void setParm(const std::string& parm, const std::string& value) override {}
- bool start() { return true; }
- void stop() {}
+ bool start() override { return true; }
+ void stop() override {}
- void pre() {}
- void run(size_t pos, size_t len, std::vector<event_t>& events) {}
- void post() {}
- bool isFreewheeling() const { return true; }
+ void pre() override {}
+ void run(size_t pos, size_t len, std::vector<event_t>& events) override {}
+ void post() override {}
+ void setSampleRate(double sample_rate) override {}
+ bool isFreewheeling() const override { return true; }
};
class test_engine : public DGUnit