Browse Source

Wrap Core plugin in core:: namespace.

tags/v1.1.0
Andrew Belt 5 years ago
parent
commit
535b64c5bb
13 changed files with 100 additions and 2 deletions
  1. +8
    -0
      src/core/AudioInterface.cpp
  2. +8
    -0
      src/core/Blank.cpp
  3. +8
    -0
      src/core/CV_CC.cpp
  4. +8
    -0
      src/core/CV_Gate.cpp
  5. +8
    -0
      src/core/CV_MIDI.cpp
  6. +8
    -0
      src/core/MIDI_CC.cpp
  7. +8
    -0
      src/core/MIDI_CV.cpp
  8. +8
    -0
      src/core/MIDI_Gate.cpp
  9. +8
    -0
      src/core/MIDI_Map.cpp
  10. +8
    -0
      src/core/Notes.cpp
  11. +8
    -0
      src/core/plugin.cpp
  12. +6
    -1
      src/core/plugin.hpp
  13. +6
    -1
      src/plugin.cpp

src/Core/AudioInterface.cpp → src/core/AudioInterface.cpp View File

@@ -8,6 +8,10 @@
#include <condition_variable> #include <condition_variable>




namespace rack {
namespace core {


template <int AUDIO_OUTPUTS, int AUDIO_INPUTS> template <int AUDIO_OUTPUTS, int AUDIO_INPUTS>
struct AudioInterfacePort : audio::Port { struct AudioInterfacePort : audio::Port {
std::mutex engineMutex; std::mutex engineMutex;
@@ -350,3 +354,7 @@ struct AudioInterface16Widget : ModuleWidget {


Model *modelAudioInterface = createModel<AudioInterface<8, 8>, AudioInterface8Widget>("AudioInterface"); Model *modelAudioInterface = createModel<AudioInterface<8, 8>, AudioInterface8Widget>("AudioInterface");
Model *modelAudioInterface16 = createModel<AudioInterface<16, 16>, AudioInterface16Widget>("AudioInterface16"); Model *modelAudioInterface16 = createModel<AudioInterface<16, 16>, AudioInterface16Widget>("AudioInterface16");


} // namespace core
} // namespace rack

src/Core/Blank.cpp → src/core/Blank.cpp View File

@@ -2,6 +2,10 @@
#include <app.hpp> #include <app.hpp>




namespace rack {
namespace core {


struct BlankPanel : Widget { struct BlankPanel : Widget {
Widget *panelBorder; Widget *panelBorder;


@@ -150,3 +154,7 @@ struct BlankWidget : ModuleWidget {




Model *modelBlank = createModel<Module, BlankWidget>("Blank"); Model *modelBlank = createModel<Module, BlankWidget>("Blank");


} // namespace core
} // namespace rack

src/Core/CV_CC.cpp → src/core/CV_CC.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


struct CCMidiOutput : midi::Output { struct CCMidiOutput : midi::Output {
int lastValues[128]; int lastValues[128];


@@ -147,3 +151,7 @@ struct CV_CCWidget : ModuleWidget {




Model *modelCV_CC = createModel<CV_CC, CV_CCWidget>("CV-CC"); Model *modelCV_CC = createModel<CV_CC, CV_CCWidget>("CV-CC");


} // namespace core
} // namespace rack

src/Core/CV_Gate.cpp → src/core/CV_Gate.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


struct GateMidiOutput : midi::Output { struct GateMidiOutput : midi::Output {
int vels[128]; int vels[128];
bool lastGates[128]; bool lastGates[128];
@@ -213,3 +217,7 @@ struct CV_GateWidget : ModuleWidget {




Model *modelCV_Gate = createModel<CV_Gate, CV_GateWidget>("CV-Gate"); Model *modelCV_Gate = createModel<CV_Gate, CV_GateWidget>("CV-Gate");


} // namespace core
} // namespace rack

src/Core/CV_MIDI.cpp → src/core/CV_MIDI.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


struct MidiOutput : dsp::MidiGenerator<PORT_MAX_CHANNELS>, midi::Output { struct MidiOutput : dsp::MidiGenerator<PORT_MAX_CHANNELS>, midi::Output {
void onMessage(midi::Message message) override { void onMessage(midi::Message message) override {
midi::Output::sendMessage(message); midi::Output::sendMessage(message);
@@ -170,3 +174,7 @@ struct CV_MIDIWidget : ModuleWidget {




Model *modelCV_MIDI = createModel<CV_MIDI, CV_MIDIWidget>("CV-MIDI"); Model *modelCV_MIDI = createModel<CV_MIDI, CV_MIDIWidget>("CV-MIDI");


} // namespace core
} // namespace rack

src/Core/MIDI_CC.cpp → src/core/MIDI_CC.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


struct MIDI_CC : Module { struct MIDI_CC : Module {
enum ParamIds { enum ParamIds {
NUM_PARAMS NUM_PARAMS
@@ -181,3 +185,7 @@ struct MIDI_CCWidget : ModuleWidget {


// Use legacy slug for compatibility // Use legacy slug for compatibility
Model *modelMIDI_CC = createModel<MIDI_CC, MIDI_CCWidget>("MIDICCToCVInterface"); Model *modelMIDI_CC = createModel<MIDI_CC, MIDI_CCWidget>("MIDICCToCVInterface");


} // namespace core
} // namespace rack

src/Core/MIDI_CV.cpp → src/core/MIDI_CV.cpp View File

@@ -2,6 +2,10 @@
#include <algorithm> #include <algorithm>




namespace rack {
namespace core {


struct MIDI_CV : Module { struct MIDI_CV : Module {
enum ParamIds { enum ParamIds {
NUM_PARAMS NUM_PARAMS
@@ -575,3 +579,7 @@ struct MIDI_CVWidget : ModuleWidget {


// Use legacy slug for compatibility // Use legacy slug for compatibility
Model *modelMIDI_CV = createModel<MIDI_CV, MIDI_CVWidget>("MIDIToCVInterface"); Model *modelMIDI_CV = createModel<MIDI_CV, MIDI_CVWidget>("MIDIToCVInterface");


} // namespace core
} // namespace rack

src/Core/MIDI_Gate.cpp → src/core/MIDI_Gate.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


struct MIDI_Gate : Module { struct MIDI_Gate : Module {
enum ParamIds { enum ParamIds {
NUM_PARAMS NUM_PARAMS
@@ -220,3 +224,7 @@ struct MIDI_GateWidget : ModuleWidget {


// Use legacy slug for compatibility // Use legacy slug for compatibility
Model *modelMIDI_Gate = createModel<MIDI_Gate, MIDI_GateWidget>("MIDITriggerToCVInterface"); Model *modelMIDI_Gate = createModel<MIDI_Gate, MIDI_GateWidget>("MIDITriggerToCVInterface");


} // namespace core
} // namespace rack

src/Core/MIDI_Map.cpp → src/core/MIDI_Map.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


static const int MAX_CHANNELS = 128; static const int MAX_CHANNELS = 128;




@@ -453,3 +457,7 @@ struct MIDI_MapWidget : ModuleWidget {




Model *modelMIDI_Map = createModel<MIDI_Map, MIDI_MapWidget>("MIDI-Map"); Model *modelMIDI_Map = createModel<MIDI_Map, MIDI_MapWidget>("MIDI-Map");


} // namespace core
} // namespace rack

src/Core/Notes.cpp → src/core/Notes.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


struct NotesWidget : ModuleWidget { struct NotesWidget : ModuleWidget {
TextField *textField; TextField *textField;


@@ -40,3 +44,7 @@ struct NotesWidget : ModuleWidget {




Model *modelNotes = createModel<Module, NotesWidget>("Notes"); Model *modelNotes = createModel<Module, NotesWidget>("Notes");


} // namespace core
} // namespace rack

src/Core/plugin.cpp → src/core/plugin.cpp View File

@@ -1,6 +1,10 @@
#include "plugin.hpp" #include "plugin.hpp"




namespace rack {
namespace core {


void init(rack::Plugin *p) { void init(rack::Plugin *p) {
p->addModel(modelAudioInterface); p->addModel(modelAudioInterface);
p->addModel(modelAudioInterface16); p->addModel(modelAudioInterface16);
@@ -14,3 +18,7 @@ void init(rack::Plugin *p) {
p->addModel(modelBlank); p->addModel(modelBlank);
p->addModel(modelNotes); p->addModel(modelNotes);
} }


} // namespace core
} // namespace rack

src/Core/plugin.hpp → src/core/plugin.hpp View File

@@ -1,7 +1,8 @@
#include <rack.hpp> #include <rack.hpp>




using namespace rack;
namespace rack {
namespace core {




extern Model *modelAudioInterface; extern Model *modelAudioInterface;
@@ -197,3 +198,7 @@ struct NoteChoice : LedDisplayChoice {
} }
} }
}; };


} // namespace core
} // namespace rack

+ 6
- 1
src/plugin.cpp View File

@@ -33,6 +33,11 @@




namespace rack { namespace rack {

namespace core {
void init(rack::plugin::Plugin *plugin);
} // namespace core

namespace plugin { namespace plugin {




@@ -133,7 +138,7 @@ static Plugin *loadPlugin(std::string path) {
// Call init callback // Call init callback
InitCallback initCallback; InitCallback initCallback;
if (path == "") { if (path == "") {
initCallback = ::init;
initCallback = core::init;
} }
else { else {
initCallback = loadLibrary(plugin); initCallback = loadLibrary(plugin);


Loading…
Cancel
Save