From 9a61e61db6d811c32a25beec8c34e790170662e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Tue, 29 Mar 2016 09:53:07 +0200 Subject: made input engine more const-correct --- drumgizmo/input/inputdummy.cc | 2 +- drumgizmo/input/inputdummy.h | 2 +- drumgizmo/input/jackmidi.cc | 2 +- drumgizmo/input/jackmidi.h | 2 +- drumgizmo/input/midifile.cc | 2 +- drumgizmo/input/midifile.h | 2 +- plugin/drumgizmo_plugin.cc | 2 +- plugin/drumgizmo_plugin.h | 4 ++-- src/audioinputengine.h | 2 +- src/audioinputenginemidi.cc | 2 +- src/audioinputenginemidi.h | 4 ++-- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drumgizmo/input/inputdummy.cc b/drumgizmo/input/inputdummy.cc index 7d7b272..971ef29 100644 --- a/drumgizmo/input/inputdummy.cc +++ b/drumgizmo/input/inputdummy.cc @@ -34,7 +34,7 @@ DummyInputEngine::~DummyInputEngine() { } -bool DummyInputEngine::init(Instruments& instruments) +bool DummyInputEngine::init(const Instruments& instruments) { return true; } diff --git a/drumgizmo/input/inputdummy.h b/drumgizmo/input/inputdummy.h index f2353e5..7888f33 100644 --- a/drumgizmo/input/inputdummy.h +++ b/drumgizmo/input/inputdummy.h @@ -35,7 +35,7 @@ public: ~DummyInputEngine(); // based on AudioInputEngine - bool init(Instruments& instruments) override; + bool init(const Instruments& instruments) override; void setParm(const std::string& parm, const std::string& value) override; bool start() override; void stop() override; diff --git a/drumgizmo/input/jackmidi.cc b/drumgizmo/input/jackmidi.cc index befb763..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)) { diff --git a/drumgizmo/input/jackmidi.h b/drumgizmo/input/jackmidi.h index 5e9e48f..15707c4 100644 --- a/drumgizmo/input/jackmidi.h +++ b/drumgizmo/input/jackmidi.h @@ -43,7 +43,7 @@ public: ~JackMidiInputEngine(); // based on AudioInputEngineMidi - bool init(Instruments& instruments) override; + bool init(const Instruments& instruments) override; void setParm(const std::string& parm, const std::string& value) override; bool start() override; void stop() override; diff --git a/drumgizmo/input/midifile.cc b/drumgizmo/input/midifile.cc index 2149029..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 == "") { diff --git a/drumgizmo/input/midifile.h b/drumgizmo/input/midifile.h index ff2e3b6..08dc249 100644 --- a/drumgizmo/input/midifile.h +++ b/drumgizmo/input/midifile.h @@ -42,7 +42,7 @@ public: ~MidifileInputEngine(); // based on AudioInputEngineMidi - bool init(Instruments& instruments) override; + bool init(const Instruments& instruments) override; void setParm(const std::string& parm, const std::string& value) override; bool start() override; void stop() override; diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc index 4e3252d..f1cebd3 100644 --- a/plugin/drumgizmo_plugin.cc +++ b/plugin/drumgizmo_plugin.cc @@ -182,7 +182,7 @@ DrumGizmoPlugin::Input::Input(DrumGizmoPlugin& plugin) { } -bool DrumGizmoPlugin::Input::init(Instruments &instruments) +bool DrumGizmoPlugin::Input::init(const Instruments &instruments) { this->instruments = &instruments; return true; diff --git a/plugin/drumgizmo_plugin.h b/plugin/drumgizmo_plugin.h index bd970f1..767060c 100644 --- a/plugin/drumgizmo_plugin.h +++ b/plugin/drumgizmo_plugin.h @@ -108,7 +108,7 @@ private: public: Input(DrumGizmoPlugin& plugin); - bool init(Instruments& instruments) override; + bool init(const Instruments& instruments) override; void setParm(const std::string& parm, const std::string& value) override; @@ -121,7 +121,7 @@ private: protected: DrumGizmoPlugin& plugin; - Instruments* instruments{nullptr}; + const Instruments* instruments{nullptr}; }; class Output diff --git a/src/audioinputengine.h b/src/audioinputengine.h index d7ac9c9..105db49 100644 --- a/src/audioinputengine.h +++ b/src/audioinputengine.h @@ -40,7 +40,7 @@ public: virtual bool isMidiEngine() { return false; } - virtual bool init(Instruments& instruments) = 0; + virtual bool init(const Instruments& instruments) = 0; virtual void setParm(const std::string& parm, const std::string& value) = 0; diff --git a/src/audioinputenginemidi.cc b/src/audioinputenginemidi.cc index e3cb796..e18e446 100644 --- a/src/audioinputenginemidi.cc +++ b/src/audioinputenginemidi.cc @@ -38,7 +38,7 @@ AudioInputEngineMidi::AudioInputEngineMidi() is_valid = false; } -bool AudioInputEngineMidi::loadMidiMap(std::string file, Instruments &instruments) +bool AudioInputEngineMidi::loadMidiMap(const std::string& file, const Instruments& instruments) { std::string f = file; diff --git a/src/audioinputenginemidi.h b/src/audioinputenginemidi.h index 36fcbaa..82121b7 100644 --- a/src/audioinputenginemidi.h +++ b/src/audioinputenginemidi.h @@ -43,7 +43,7 @@ public: bool isMidiEngine() { return true; } - virtual bool init(Instruments &instruments) = 0; + virtual bool init(const Instruments &instruments) = 0; virtual void setParm(const std::string& parm, const std::string& value) = 0; @@ -54,7 +54,7 @@ public: virtual void run(size_t pos, size_t len, std::vector& events) = 0; virtual void post() = 0; - bool loadMidiMap(std::string file, Instruments &i); + bool loadMidiMap(const std::string& file, const Instruments& i); std::string midimapFile(); -- cgit v1.2.3