Browse Source

Move Core MIDI stuff around

tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
4d70a4d38e
5 changed files with 36 additions and 41 deletions
  1. +2
    -1
      src/core/MidiCCToCV.cpp
  2. +4
    -37
      src/core/MidiIO.hpp
  3. +2
    -2
      src/core/MidiTriggerToCV.cpp
  4. +2
    -1
      src/core/core.cpp
  5. +26
    -0
      src/core/core.hpp

+ 2
- 1
src/core/MidiCCToCV.cpp View File

@@ -189,13 +189,14 @@ void CCTextField::onMouseDown(EventMouseDown &e) {
if (e.button == 1) { if (e.button == 1) {
module->onFocus[num] = true; module->onFocus[num] = true;
} }
e.consumed = true;
} }


void CCTextField::onMouseUp(EventMouseUp &e) { void CCTextField::onMouseUp(EventMouseUp &e) {
if (e.button == 1) { if (e.button == 1) {
module->onFocus[num] = false; module->onFocus[num] = false;
} }
e.consumed = true;
} }


void CCTextField::onMouseLeave(EventMouseLeave &e) { void CCTextField::onMouseLeave(EventMouseLeave &e) {


+ 4
- 37
src/core/MidiIO.hpp View File

@@ -88,10 +88,10 @@ public:
void close(); void close();


/* called when midi port is set */ /* called when midi port is set */
virtual void resetMidi()=0;
virtual void resetMidi() {}


/* called if a user switches or sets the deivce (and after this device is initialised)*/ /* called if a user switches or sets the deivce (and after this device is initialised)*/
virtual void onDeviceChange(){};
virtual void onDeviceChange() {}
}; };


////////////////////// //////////////////////
@@ -107,9 +107,8 @@ struct MidiItem : MenuItem {
struct MidiChoice : ChoiceButton { struct MidiChoice : ChoiceButton {
MidiIO *midiModule; MidiIO *midiModule;


void onAction(EventAction &e) override;

void step() override; void step() override;
void onAction(EventAction &e) override;
}; };


struct ChannelItem : MenuItem { struct ChannelItem : MenuItem {
@@ -122,38 +121,6 @@ struct ChannelItem : MenuItem {
struct ChannelChoice : ChoiceButton { struct ChannelChoice : ChoiceButton {
MidiIO *midiModule; MidiIO *midiModule;


void onAction(EventAction &e) override;

void step() override;
};


struct MidiToCVWidget : ModuleWidget {
MidiToCVWidget();

void step() override;
};

struct MIDICCToCVWidget : ModuleWidget {
MIDICCToCVWidget();

void step() override;
};

struct MIDIClockToCVWidget : ModuleWidget {
MIDIClockToCVWidget();

void step() override;
};

struct MIDITriggerToCVWidget : ModuleWidget {
MIDITriggerToCVWidget();

void step() override;
};

struct QuadMidiToCVWidget : ModuleWidget {
QuadMidiToCVWidget();

void step() override; void step() override;
void onAction(EventAction &e) override;
}; };

+ 2
- 2
src/core/MidiTriggerToCV.cpp View File

@@ -189,13 +189,14 @@ void TriggerTextField::onMouseDown(EventMouseDown &e) {
if (e.button == 1) { if (e.button == 1) {
*onFocus = true; *onFocus = true;
} }
e.consumed = true;
} }


void TriggerTextField::onMouseUp(EventMouseUp &e) { void TriggerTextField::onMouseUp(EventMouseUp &e) {
if (e.button == 1) { if (e.button == 1) {
*onFocus = false; *onFocus = false;
} }
e.consumed = true;
} }


void TriggerTextField::onMouseLeave(EventMouseLeave &e) { void TriggerTextField::onMouseLeave(EventMouseLeave &e) {
@@ -280,6 +281,5 @@ MIDITriggerToCVWidget::MIDITriggerToCVWidget() {
} }


void MIDITriggerToCVWidget::step() { void MIDITriggerToCVWidget::step() {

ModuleWidget::step(); ModuleWidget::step();
} }

+ 2
- 1
src/core/core.cpp View File

@@ -1,10 +1,11 @@
#include "core.hpp" #include "core.hpp"
#include "MidiIO.hpp"


void init(rack::Plugin *p) { void init(rack::Plugin *p) {
p->slug = "Core"; p->slug = "Core";
p->addModel(createModel<AudioInterfaceWidget>("Core", "Core", "AudioInterface", "Audio Interface")); p->addModel(createModel<AudioInterfaceWidget>("Core", "Core", "AudioInterface", "Audio Interface"));
p->addModel(createModel<MidiToCVWidget>("Core", "Core", "MIDIToCVInterface", "MIDI-to-CV Interface")); p->addModel(createModel<MidiToCVWidget>("Core", "Core", "MIDIToCVInterface", "MIDI-to-CV Interface"));

p->addModel(createModel<MIDICCToCVWidget>("Core", "Core", "MIDICCToCVInterface", "MIDI CC-to-CV Interface")); p->addModel(createModel<MIDICCToCVWidget>("Core", "Core", "MIDICCToCVInterface", "MIDI CC-to-CV Interface"));
p->addModel(createModel<MIDIClockToCVWidget>("Core", "Core", "MIDIClockToCVInterface", "MIDI Clock-to-CV Interface")); p->addModel(createModel<MIDIClockToCVWidget>("Core", "Core", "MIDIClockToCVInterface", "MIDI Clock-to-CV Interface"));
p->addModel(createModel<MIDITriggerToCVWidget>("Core", "Core", "MIDITriggerToCVInterface", "MIDI Trigger-to-CV Interface")); p->addModel(createModel<MIDITriggerToCVWidget>("Core", "Core", "MIDITriggerToCVInterface", "MIDI Trigger-to-CV Interface"));


+ 26
- 0
src/core/core.hpp View File

@@ -12,6 +12,32 @@ struct AudioInterfaceWidget : ModuleWidget {
AudioInterfaceWidget(); AudioInterfaceWidget();
}; };


struct MidiToCVWidget : ModuleWidget {
MidiToCVWidget();
void step() override;
};

struct MIDICCToCVWidget : ModuleWidget {
MIDICCToCVWidget();
void step() override;
};

struct MIDIClockToCVWidget : ModuleWidget {
MIDIClockToCVWidget();
void step() override;
};

struct MIDITriggerToCVWidget : ModuleWidget {
MIDITriggerToCVWidget();
void step() override;
};

struct QuadMidiToCVWidget : ModuleWidget {
QuadMidiToCVWidget();
void step() override;
};


struct BridgeWidget : ModuleWidget { struct BridgeWidget : ModuleWidget {
BridgeWidget(); BridgeWidget();
}; };


Loading…
Cancel
Save