summaryrefslogtreecommitdiff
path: root/drumgizmo/output
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo/output')
-rw-r--r--drumgizmo/output/alsa.cc6
-rw-r--r--drumgizmo/output/alsa.h6
-rw-r--r--drumgizmo/output/jackaudio.cc8
-rw-r--r--drumgizmo/output/jackaudio.h8
-rw-r--r--drumgizmo/output/outputdummy.cc4
-rw-r--r--drumgizmo/output/outputdummy.h4
-rw-r--r--drumgizmo/output/wavfile.cc6
-rw-r--r--drumgizmo/output/wavfile.h6
8 files changed, 24 insertions, 24 deletions
diff --git a/drumgizmo/output/alsa.cc b/drumgizmo/output/alsa.cc
index 20a5366..aea80a6 100644
--- a/drumgizmo/output/alsa.cc
+++ b/drumgizmo/output/alsa.cc
@@ -71,7 +71,7 @@ AlsaOutputEngine::~AlsaOutputEngine()
}
}
-bool AlsaOutputEngine::init(Channels channels)
+bool AlsaOutputEngine::init(const Channels& channels)
{
// try to initialize alsa
try
@@ -120,7 +120,7 @@ bool AlsaOutputEngine::init(Channels channels)
return true;
}
-void AlsaOutputEngine::setParm(std::string parm, std::string value)
+void AlsaOutputEngine::setParm(const std::string& parm, const std::string& value)
{
if(parm == "dev")
{
@@ -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 f3fb457..cc28f94 100644
--- a/drumgizmo/output/alsa.h
+++ b/drumgizmo/output/alsa.h
@@ -42,14 +42,14 @@ public:
~AlsaOutputEngine();
// based on AudioOutputEngine
- bool init(Channels chan) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Channels& chan) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
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 90ac63b..7710e14 100644
--- a/drumgizmo/output/jackaudio.cc
+++ b/drumgizmo/output/jackaudio.cc
@@ -43,7 +43,7 @@ JackAudioOutputEngine::~JackAudioOutputEngine()
client.remove(*this);
}
-bool JackAudioOutputEngine::init(Channels data)
+bool JackAudioOutputEngine::init(const Channels& data)
{
channels.clear();
channels.reserve(data.size());
@@ -67,7 +67,7 @@ bool JackAudioOutputEngine::init(Channels data)
return true;
}
-void JackAudioOutputEngine::setParm(std::string parm, std::string value)
+void JackAudioOutputEngine::setParm(const std::string& parm, const std::string& value)
{
}
@@ -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 e22d978..324e95a 100644
--- a/drumgizmo/output/jackaudio.h
+++ b/drumgizmo/output/jackaudio.h
@@ -40,15 +40,15 @@ public:
~JackAudioOutputEngine();
// based on AudioOutputEngine
- bool init(Channels chan) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Channels& chan) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
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/outputdummy.cc b/drumgizmo/output/outputdummy.cc
index 2edcc28..4ff0816 100644
--- a/drumgizmo/output/outputdummy.cc
+++ b/drumgizmo/output/outputdummy.cc
@@ -34,12 +34,12 @@ DummyOutputEngine::~DummyOutputEngine()
{
}
-bool DummyOutputEngine::init(Channels data)
+bool DummyOutputEngine::init(const Channels& data)
{
return true;
}
-void DummyOutputEngine::setParm(std::string parm, std::string value)
+void DummyOutputEngine::setParm(const std::string& parm, const std::string& value)
{
}
diff --git a/drumgizmo/output/outputdummy.h b/drumgizmo/output/outputdummy.h
index 023ba42..5a1b2fa 100644
--- a/drumgizmo/output/outputdummy.h
+++ b/drumgizmo/output/outputdummy.h
@@ -35,8 +35,8 @@ public:
~DummyOutputEngine();
// based on AudioOutputEngine
- bool init(Channels chan) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Channels& chan) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
void pre(size_t nsamples) override;
diff --git a/drumgizmo/output/wavfile.cc b/drumgizmo/output/wavfile.cc
index b19f700..a9d8b0b 100644
--- a/drumgizmo/output/wavfile.cc
+++ b/drumgizmo/output/wavfile.cc
@@ -50,7 +50,7 @@ WavfileOutputEngine::~WavfileOutputEngine()
}
}
-bool WavfileOutputEngine::init(Channels data)
+bool WavfileOutputEngine::init(const Channels& data)
{
channels.clear();
channels.resize(data.size()); // value-initialized with null
@@ -69,7 +69,7 @@ bool WavfileOutputEngine::init(Channels data)
return true;
}
-void WavfileOutputEngine::setParm(std::string parm, std::string value)
+void WavfileOutputEngine::setParm(const std::string& parm, const std::string& value)
{
if(parm == "file")
{
@@ -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 1dddfa1..dfe422c 100644
--- a/drumgizmo/output/wavfile.h
+++ b/drumgizmo/output/wavfile.h
@@ -40,14 +40,14 @@ public:
~WavfileOutputEngine();
// based on AudioOutputEngine
- bool init(Channels data) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Channels& data) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
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;