summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-29 10:09:18 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2016-03-31 17:35:47 +0200
commit0f18336bc2a597f2625a46ea714e838d03e340b2 (patch)
tree78f328863e70a875ca35db1a64beb18fa7e437cc
parent53909b3a74e9c752d3405fda7bc63146b9abdc7a (diff)
more consistent style of output engines' getters
-rw-r--r--drumgizmo/drumgizmoc.cc2
-rw-r--r--drumgizmo/output/alsa.cc2
-rw-r--r--drumgizmo/output/alsa.h2
-rw-r--r--drumgizmo/output/jackaudio.cc4
-rw-r--r--drumgizmo/output/jackaudio.h4
-rw-r--r--drumgizmo/output/wavfile.cc2
-rw-r--r--drumgizmo/output/wavfile.h2
-rw-r--r--plugin/drumgizmo_plugin.cc4
-rw-r--r--plugin/drumgizmo_plugin.h4
-rw-r--r--src/audiooutputengine.h6
10 files changed, 16 insertions, 16 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index 14a71b3..24d16e8 100644
--- a/drumgizmo/drumgizmoc.cc
+++ b/drumgizmo/drumgizmoc.cc
@@ -398,7 +398,7 @@ int CliMain::run(int argc, char* argv[])
}
printf("done.\n");
- gizmo.setSamplerate(oe->samplerate());
+ gizmo.setSamplerate(oe->getSamplerate());
if(!gizmo.init())
{
diff --git a/drumgizmo/output/alsa.cc b/drumgizmo/output/alsa.cc
index 66a78c0..aea80a6 100644
--- a/drumgizmo/output/alsa.cc
+++ b/drumgizmo/output/alsa.cc
@@ -187,7 +187,7 @@ void AlsaOutputEngine::post(size_t nsamples)
snd_pcm_writei(handle, data.data(), nsamples);
}
-size_t AlsaOutputEngine::samplerate()
+size_t AlsaOutputEngine::getSamplerate() const
{
return srate;
}
diff --git a/drumgizmo/output/alsa.h b/drumgizmo/output/alsa.h
index a769c54..cc28f94 100644
--- a/drumgizmo/output/alsa.h
+++ b/drumgizmo/output/alsa.h
@@ -49,7 +49,7 @@ public:
void pre(size_t nsamples) override;
void run(int ch, sample_t* samples, size_t nsamples) override;
void post(size_t nsamples) override;
- size_t samplerate() override;
+ size_t getSamplerate() const override;
private:
snd_pcm_t* handle;
diff --git a/drumgizmo/output/jackaudio.cc b/drumgizmo/output/jackaudio.cc
index 52e1d41..7710e14 100644
--- a/drumgizmo/output/jackaudio.cc
+++ b/drumgizmo/output/jackaudio.cc
@@ -113,12 +113,12 @@ void JackAudioOutputEngine::process(jack_nframes_t num_frames)
sema.post();
}
-size_t JackAudioOutputEngine::getBufferSize()
+size_t JackAudioOutputEngine::getBufferSize() const
{
return client.getBufferSize();
}
-size_t JackAudioOutputEngine::samplerate()
+size_t JackAudioOutputEngine::getSamplerate() const
{
return client.getSampleRate();
}
diff --git a/drumgizmo/output/jackaudio.h b/drumgizmo/output/jackaudio.h
index b71ff8e..324e95a 100644
--- a/drumgizmo/output/jackaudio.h
+++ b/drumgizmo/output/jackaudio.h
@@ -47,8 +47,8 @@ public:
void pre(size_t nsamples) override;
void run(int ch, sample_t* samples, size_t nsamples) override;
void post(size_t nsamples) override;
- size_t getBufferSize() override;
- size_t samplerate() override;
+ size_t getBufferSize() const override;
+ size_t getSamplerate() const override;
// based on JackProcess
void process(jack_nframes_t num_frames) override;
diff --git a/drumgizmo/output/wavfile.cc b/drumgizmo/output/wavfile.cc
index 78f7899..a9d8b0b 100644
--- a/drumgizmo/output/wavfile.cc
+++ b/drumgizmo/output/wavfile.cc
@@ -125,7 +125,7 @@ void WavfileOutputEngine::post(size_t nsamples)
{
}
-size_t WavfileOutputEngine::samplerate()
+size_t WavfileOutputEngine::getSamplerate() const
{
return info.samplerate;
}
diff --git a/drumgizmo/output/wavfile.h b/drumgizmo/output/wavfile.h
index a0019d3..dfe422c 100644
--- a/drumgizmo/output/wavfile.h
+++ b/drumgizmo/output/wavfile.h
@@ -47,7 +47,7 @@ public:
void pre(size_t nsamples) override;
void run(int ch, sample_t* samples, size_t nsamples) override;
void post(size_t nsamples) override;
- size_t samplerate() override;
+ size_t getSamplerate() const override;
private:
SF_INFO info;
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc
index b41879d..b8f8822 100644
--- a/plugin/drumgizmo_plugin.cc
+++ b/plugin/drumgizmo_plugin.cc
@@ -291,7 +291,7 @@ void DrumGizmoPlugin::Output::post(size_t nsamples)
{
}
-sample_t* DrumGizmoPlugin::Output::getBuffer(int ch)
+sample_t* DrumGizmoPlugin::Output::getBuffer(int ch) const
{
assert(plugin.output_samples);
@@ -303,7 +303,7 @@ sample_t* DrumGizmoPlugin::Output::getBuffer(int ch)
return (*plugin.output_samples)[ch];
}
-size_t DrumGizmoPlugin::Output::getBufferSize()
+size_t DrumGizmoPlugin::Output::getBufferSize() const
{
return plugin.getFramesize();
}
diff --git a/plugin/drumgizmo_plugin.h b/plugin/drumgizmo_plugin.h
index 8cddef6..28a1b8f 100644
--- a/plugin/drumgizmo_plugin.h
+++ b/plugin/drumgizmo_plugin.h
@@ -141,8 +141,8 @@ private:
void run(int ch, sample_t *samples, size_t nsamples) override;
void post(size_t nsamples) override;
- sample_t *getBuffer(int ch) override;
- size_t getBufferSize() override;
+ sample_t *getBuffer(int ch) const override;
+ size_t getBufferSize() const override;
protected:
DrumGizmoPlugin& plugin;
diff --git a/src/audiooutputengine.h b/src/audiooutputengine.h
index 530ca13..df8b0ee 100644
--- a/src/audiooutputengine.h
+++ b/src/audiooutputengine.h
@@ -49,14 +49,14 @@ public:
virtual void post(size_t nsamples) = 0;
// Reimplement this if you wish to use internal buffer directly.
- virtual sample_t *getBuffer(int ch) { return NULL; }
+ virtual sample_t *getBuffer(int ch) const { return NULL; }
/*
* Overload this method to force engine to use different buffer size.
*/
- virtual size_t getBufferSize() { return 1024; }
+ virtual size_t getBufferSize() const { return 1024; }
- virtual size_t samplerate() { return 44100; }
+ virtual size_t getSamplerate() const { return 44100; }
};
#endif/*__DRUMGIZMO_AUDIOOUTPUTENGINE_H__*/