summaryrefslogtreecommitdiff
path: root/drumgizmo
diff options
context:
space:
mode:
Diffstat (limited to 'drumgizmo')
-rw-r--r--drumgizmo/drumgizmoc.cc2
-rw-r--r--drumgizmo/input/inputdummy.cc4
-rw-r--r--drumgizmo/input/inputdummy.h4
-rw-r--r--drumgizmo/input/jackmidi.cc4
-rw-r--r--drumgizmo/input/jackmidi.h4
-rw-r--r--drumgizmo/input/midifile.cc4
-rw-r--r--drumgizmo/input/midifile.h4
-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
15 files changed, 37 insertions, 37 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index 3164c2e..357877d 100644
--- a/drumgizmo/drumgizmoc.cc
+++ b/drumgizmo/drumgizmoc.cc
@@ -399,7 +399,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/input/inputdummy.cc b/drumgizmo/input/inputdummy.cc
index 74464ef..971ef29 100644
--- a/drumgizmo/input/inputdummy.cc
+++ b/drumgizmo/input/inputdummy.cc
@@ -34,12 +34,12 @@ DummyInputEngine::~DummyInputEngine()
{
}
-bool DummyInputEngine::init(Instruments& instruments)
+bool DummyInputEngine::init(const Instruments& instruments)
{
return true;
}
-void DummyInputEngine::setParm(std::string parm, std::string value)
+void DummyInputEngine::setParm(const std::string& parm, const std::string& value)
{
}
diff --git a/drumgizmo/input/inputdummy.h b/drumgizmo/input/inputdummy.h
index 79f325a..7888f33 100644
--- a/drumgizmo/input/inputdummy.h
+++ b/drumgizmo/input/inputdummy.h
@@ -35,8 +35,8 @@ public:
~DummyInputEngine();
// based on AudioInputEngine
- bool init(Instruments& instruments) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Instruments& instruments) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
void pre() override;
diff --git a/drumgizmo/input/jackmidi.cc b/drumgizmo/input/jackmidi.cc
index ff2f030..73098c5 100644
--- a/drumgizmo/input/jackmidi.cc
+++ b/drumgizmo/input/jackmidi.cc
@@ -48,7 +48,7 @@ JackMidiInputEngine::~JackMidiInputEngine()
client.remove(*this);
}
-bool JackMidiInputEngine::init(Instruments& instruments)
+bool JackMidiInputEngine::init(const Instruments& instruments)
{
if(!loadMidiMap(midimap, instruments))
{
@@ -62,7 +62,7 @@ bool JackMidiInputEngine::init(Instruments& instruments)
return true;
}
-void JackMidiInputEngine::setParm(std::string parm, std::string value)
+void JackMidiInputEngine::setParm(const std::string& parm, const std::string& value)
{
if(parm == "midimap")
{
diff --git a/drumgizmo/input/jackmidi.h b/drumgizmo/input/jackmidi.h
index fbf6ef1..15707c4 100644
--- a/drumgizmo/input/jackmidi.h
+++ b/drumgizmo/input/jackmidi.h
@@ -43,8 +43,8 @@ public:
~JackMidiInputEngine();
// based on AudioInputEngineMidi
- bool init(Instruments& instruments) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Instruments& instruments) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
void pre() override;
diff --git a/drumgizmo/input/midifile.cc b/drumgizmo/input/midifile.cc
index 5fc1a42..76dff12 100644
--- a/drumgizmo/input/midifile.cc
+++ b/drumgizmo/input/midifile.cc
@@ -52,7 +52,7 @@ MidifileInputEngine::~MidifileInputEngine()
}
}
-bool MidifileInputEngine::init(Instruments& instruments)
+bool MidifileInputEngine::init(const Instruments& instruments)
{
if(file == "")
{
@@ -80,7 +80,7 @@ bool MidifileInputEngine::init(Instruments& instruments)
return true;
}
-void MidifileInputEngine::setParm(std::string parm, std::string value)
+void MidifileInputEngine::setParm(const std::string& parm, const std::string& value)
{
if(parm == "file")
{
diff --git a/drumgizmo/input/midifile.h b/drumgizmo/input/midifile.h
index a5c79e4..08dc249 100644
--- a/drumgizmo/input/midifile.h
+++ b/drumgizmo/input/midifile.h
@@ -42,8 +42,8 @@ public:
~MidifileInputEngine();
// based on AudioInputEngineMidi
- bool init(Instruments& instruments) override;
- void setParm(std::string parm, std::string value) override;
+ bool init(const Instruments& instruments) override;
+ void setParm(const std::string& parm, const std::string& value) override;
bool start() override;
void stop() override;
void pre() override;
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;