From 535b64c5bb96bcc37cd4c22098d7ae26edae9b53 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 24 Jun 2019 18:02:10 -0400 Subject: [PATCH] Wrap Core plugin in core:: namespace. --- src/{Core => core}/AudioInterface.cpp | 8 ++++++++ src/{Core => core}/Blank.cpp | 8 ++++++++ src/{Core => core}/CV_CC.cpp | 8 ++++++++ src/{Core => core}/CV_Gate.cpp | 8 ++++++++ src/{Core => core}/CV_MIDI.cpp | 8 ++++++++ src/{Core => core}/MIDI_CC.cpp | 8 ++++++++ src/{Core => core}/MIDI_CV.cpp | 8 ++++++++ src/{Core => core}/MIDI_Gate.cpp | 8 ++++++++ src/{Core => core}/MIDI_Map.cpp | 8 ++++++++ src/{Core => core}/Notes.cpp | 8 ++++++++ src/{Core => core}/plugin.cpp | 8 ++++++++ src/{Core => core}/plugin.hpp | 7 ++++++- src/plugin.cpp | 7 ++++++- 13 files changed, 100 insertions(+), 2 deletions(-) rename src/{Core => core}/AudioInterface.cpp (99%) rename src/{Core => core}/Blank.cpp (98%) rename src/{Core => core}/CV_CC.cpp (98%) rename src/{Core => core}/CV_Gate.cpp (98%) rename src/{Core => core}/CV_MIDI.cpp (98%) rename src/{Core => core}/MIDI_CC.cpp (98%) rename src/{Core => core}/MIDI_CV.cpp (99%) rename src/{Core => core}/MIDI_Gate.cpp (98%) rename src/{Core => core}/MIDI_Map.cpp (99%) rename src/{Core => core}/Notes.cpp (93%) rename src/{Core => core}/plugin.cpp (82%) rename src/{Core => core}/plugin.hpp (98%) diff --git a/src/Core/AudioInterface.cpp b/src/core/AudioInterface.cpp similarity index 99% rename from src/Core/AudioInterface.cpp rename to src/core/AudioInterface.cpp index aab3ce77..75b155fc 100644 --- a/src/Core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -8,6 +8,10 @@ #include +namespace rack { +namespace core { + + template struct AudioInterfacePort : audio::Port { std::mutex engineMutex; @@ -350,3 +354,7 @@ struct AudioInterface16Widget : ModuleWidget { Model *modelAudioInterface = createModel, AudioInterface8Widget>("AudioInterface"); Model *modelAudioInterface16 = createModel, AudioInterface16Widget>("AudioInterface16"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/Blank.cpp b/src/core/Blank.cpp similarity index 98% rename from src/Core/Blank.cpp rename to src/core/Blank.cpp index 18d7804a..fbd69696 100644 --- a/src/Core/Blank.cpp +++ b/src/core/Blank.cpp @@ -2,6 +2,10 @@ #include +namespace rack { +namespace core { + + struct BlankPanel : Widget { Widget *panelBorder; @@ -150,3 +154,7 @@ struct BlankWidget : ModuleWidget { Model *modelBlank = createModel("Blank"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/CV_CC.cpp b/src/core/CV_CC.cpp similarity index 98% rename from src/Core/CV_CC.cpp rename to src/core/CV_CC.cpp index 6b9a7d5a..78a49db4 100644 --- a/src/Core/CV_CC.cpp +++ b/src/core/CV_CC.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + struct CCMidiOutput : midi::Output { int lastValues[128]; @@ -147,3 +151,7 @@ struct CV_CCWidget : ModuleWidget { Model *modelCV_CC = createModel("CV-CC"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/CV_Gate.cpp b/src/core/CV_Gate.cpp similarity index 98% rename from src/Core/CV_Gate.cpp rename to src/core/CV_Gate.cpp index 49706993..26dce800 100644 --- a/src/Core/CV_Gate.cpp +++ b/src/core/CV_Gate.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + struct GateMidiOutput : midi::Output { int vels[128]; bool lastGates[128]; @@ -213,3 +217,7 @@ struct CV_GateWidget : ModuleWidget { Model *modelCV_Gate = createModel("CV-Gate"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/CV_MIDI.cpp b/src/core/CV_MIDI.cpp similarity index 98% rename from src/Core/CV_MIDI.cpp rename to src/core/CV_MIDI.cpp index ac43c192..1855a875 100644 --- a/src/Core/CV_MIDI.cpp +++ b/src/core/CV_MIDI.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + struct MidiOutput : dsp::MidiGenerator, midi::Output { void onMessage(midi::Message message) override { midi::Output::sendMessage(message); @@ -170,3 +174,7 @@ struct CV_MIDIWidget : ModuleWidget { Model *modelCV_MIDI = createModel("CV-MIDI"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/MIDI_CC.cpp b/src/core/MIDI_CC.cpp similarity index 98% rename from src/Core/MIDI_CC.cpp rename to src/core/MIDI_CC.cpp index 2aa2fb2f..5e9866d8 100644 --- a/src/Core/MIDI_CC.cpp +++ b/src/core/MIDI_CC.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + struct MIDI_CC : Module { enum ParamIds { NUM_PARAMS @@ -181,3 +185,7 @@ struct MIDI_CCWidget : ModuleWidget { // Use legacy slug for compatibility Model *modelMIDI_CC = createModel("MIDICCToCVInterface"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/MIDI_CV.cpp b/src/core/MIDI_CV.cpp similarity index 99% rename from src/Core/MIDI_CV.cpp rename to src/core/MIDI_CV.cpp index db6faa28..2d6047ae 100644 --- a/src/Core/MIDI_CV.cpp +++ b/src/core/MIDI_CV.cpp @@ -2,6 +2,10 @@ #include +namespace rack { +namespace core { + + struct MIDI_CV : Module { enum ParamIds { NUM_PARAMS @@ -575,3 +579,7 @@ struct MIDI_CVWidget : ModuleWidget { // Use legacy slug for compatibility Model *modelMIDI_CV = createModel("MIDIToCVInterface"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/MIDI_Gate.cpp b/src/core/MIDI_Gate.cpp similarity index 98% rename from src/Core/MIDI_Gate.cpp rename to src/core/MIDI_Gate.cpp index 085cc146..1ca4dcdd 100644 --- a/src/Core/MIDI_Gate.cpp +++ b/src/core/MIDI_Gate.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + struct MIDI_Gate : Module { enum ParamIds { NUM_PARAMS @@ -220,3 +224,7 @@ struct MIDI_GateWidget : ModuleWidget { // Use legacy slug for compatibility Model *modelMIDI_Gate = createModel("MIDITriggerToCVInterface"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/MIDI_Map.cpp b/src/core/MIDI_Map.cpp similarity index 99% rename from src/Core/MIDI_Map.cpp rename to src/core/MIDI_Map.cpp index b2d13e09..bee12518 100644 --- a/src/Core/MIDI_Map.cpp +++ b/src/core/MIDI_Map.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + static const int MAX_CHANNELS = 128; @@ -453,3 +457,7 @@ struct MIDI_MapWidget : ModuleWidget { Model *modelMIDI_Map = createModel("MIDI-Map"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/Notes.cpp b/src/core/Notes.cpp similarity index 93% rename from src/Core/Notes.cpp rename to src/core/Notes.cpp index 23650562..406c889b 100644 --- a/src/Core/Notes.cpp +++ b/src/core/Notes.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + struct NotesWidget : ModuleWidget { TextField *textField; @@ -40,3 +44,7 @@ struct NotesWidget : ModuleWidget { Model *modelNotes = createModel("Notes"); + + +} // namespace core +} // namespace rack diff --git a/src/Core/plugin.cpp b/src/core/plugin.cpp similarity index 82% rename from src/Core/plugin.cpp rename to src/core/plugin.cpp index a57f1abc..0c53e964 100644 --- a/src/Core/plugin.cpp +++ b/src/core/plugin.cpp @@ -1,6 +1,10 @@ #include "plugin.hpp" +namespace rack { +namespace core { + + void init(rack::Plugin *p) { p->addModel(modelAudioInterface); p->addModel(modelAudioInterface16); @@ -14,3 +18,7 @@ void init(rack::Plugin *p) { p->addModel(modelBlank); p->addModel(modelNotes); } + + +} // namespace core +} // namespace rack diff --git a/src/Core/plugin.hpp b/src/core/plugin.hpp similarity index 98% rename from src/Core/plugin.hpp rename to src/core/plugin.hpp index c88bf420..d761a7ae 100644 --- a/src/Core/plugin.hpp +++ b/src/core/plugin.hpp @@ -1,7 +1,8 @@ #include -using namespace rack; +namespace rack { +namespace core { extern Model *modelAudioInterface; @@ -197,3 +198,7 @@ struct NoteChoice : LedDisplayChoice { } } }; + + +} // namespace core +} // namespace rack diff --git a/src/plugin.cpp b/src/plugin.cpp index 5ec7d25f..d6cf6b6d 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -33,6 +33,11 @@ namespace rack { + +namespace core { +void init(rack::plugin::Plugin *plugin); +} // namespace core + namespace plugin { @@ -133,7 +138,7 @@ static Plugin *loadPlugin(std::string path) { // Call init callback InitCallback initCallback; if (path == "") { - initCallback = ::init; + initCallback = core::init; } else { initCallback = loadLibrary(plugin);