gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 88d03cc0dfc33b45a00f8b1c7e46c4a7a37f3dc1
parent eb8d60b4003ccb6db5c539c91a0451f0e409d1d6
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun, 28 Apr 2024 01:02:54 +0200

convert enum MidiEventSource to enum class

Diffstat:
Msource/jucePluginLib/controller.cpp | 4++--
Msource/jucePluginLib/controller.h | 2+-
Msource/jucePluginLib/processor.cpp | 8++++----
Msource/mqLib/device.cpp | 2+-
Msource/synthLib/midiTypes.h | 8++++----
Msource/virusLib/demoplayback.cpp | 6+++---
Msource/virusLib/microcontroller.cpp | 10+++++-----
Msource/xtLib/xtDevice.cpp | 2+-
8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/source/jucePluginLib/controller.cpp b/source/jucePluginLib/controller.cpp @@ -145,7 +145,7 @@ namespace pluginLib { synthLib::SMidiEvent ev; ev.sysex = msg; - ev.source = synthLib::MidiEventSourceEditor; + ev.source = synthLib::MidiEventSource::Editor; sendMidiEvent(ev); } @@ -154,7 +154,7 @@ namespace pluginLib m_processor.addMidiEvent(_ev); } - void Controller::sendMidiEvent(const uint8_t _a, const uint8_t _b, const uint8_t _c, const uint32_t _offset/* = 0*/, const synthLib::MidiEventSource _source/* = synthLib::MidiEventSourceEditor*/) const + void Controller::sendMidiEvent(const uint8_t _a, const uint8_t _b, const uint8_t _c, const uint32_t _offset/* = 0*/, const synthLib::MidiEventSource _source/* = synthLib::MidiEventSource::Editor*/) const { m_processor.addMidiEvent(synthLib::SMidiEvent(_a, _b, _c, _offset, _source)); } diff --git a/source/jucePluginLib/controller.h b/source/jucePluginLib/controller.h @@ -84,7 +84,7 @@ namespace pluginLib bool sendSysEx(const std::string& _packetName) const; bool sendSysEx(const std::string& _packetName, const std::map<pluginLib::MidiDataType, uint8_t>& _params) const; void sendMidiEvent(const synthLib::SMidiEvent& _ev) const; - void sendMidiEvent(uint8_t _a, uint8_t _b, uint8_t _c, uint32_t _offset = 0, synthLib::MidiEventSource _source = synthLib::MidiEventSourceEditor) const; + void sendMidiEvent(uint8_t _a, uint8_t _b, uint8_t _c, uint32_t _offset = 0, synthLib::MidiEventSource _source = synthLib::MidiEventSource::Editor) const; bool combineParameterChange(uint8_t& _result, const std::string& _midiPacket, const Parameter& _parameter, uint8_t _value) const; diff --git a/source/jucePluginLib/processor.cpp b/source/jucePluginLib/processor.cpp @@ -91,7 +91,7 @@ namespace pluginLib } syx.push_back(0xf7); synthLib::SMidiEvent sm; - sm.source = synthLib::MidiEventSourcePlugin; + sm.source = synthLib::MidiEventSource::Plugin; sm.sysex = syx; getController().parseSysexMessage(syx); @@ -116,7 +116,7 @@ namespace pluginLib if (count >= 1 && count <= 3) { synthLib::SMidiEvent sm; - sm.source = synthLib::MidiEventSourcePlugin; + sm.source = synthLib::MidiEventSource::Plugin; sm.a = rawData[0]; sm.b = count > 1 ? rawData[1] : 0; sm.c = count > 2 ? rawData[2] : 0; @@ -125,7 +125,7 @@ namespace pluginLib else { synthLib::SMidiEvent sm; - sm.source = synthLib::MidiEventSourcePlugin; + sm.source = synthLib::MidiEventSource::Plugin; auto syx = SysEx(); for (int i = 0; i < count; i++) { @@ -578,7 +578,7 @@ namespace pluginLib for (auto& e : m_midiOut) { - if (e.source == synthLib::MidiEventSourceEditor) + if (e.source == synthLib::MidiEventSource::Editor) continue; auto toJuceMidiMessage = [&e]() diff --git a/source/mqLib/device.cpp b/source/mqLib/device.cpp @@ -89,7 +89,7 @@ namespace mqLib if(!m_customSysexOut.empty()) { for (auto& custom : m_customSysexOut) - custom.source = synthLib::MidiEventSourceEditor; // do not send to output + custom.source = synthLib::MidiEventSource::Editor; // do not send to output _midiOut.insert(_midiOut.begin(), m_customSysexOut.begin(), m_customSysexOut.end()); m_customSysexOut.clear(); diff --git a/source/synthLib/midiTypes.h b/source/synthLib/midiTypes.h @@ -192,10 +192,10 @@ namespace synthLib Note_C8, Note_Cis8, Note_D8, Note_Dis8, Note_E8, Note_F8, Note_Fis8, Note_G8 }; - enum MidiEventSource + enum class MidiEventSource { - MidiEventSourcePlugin, - MidiEventSourceEditor, + Plugin, + Editor, }; struct SMidiEvent @@ -205,7 +205,7 @@ namespace synthLib uint32_t offset; MidiEventSource source; - SMidiEvent(const uint8_t _a = 0, const uint8_t _b = 0, const uint8_t _c = 0, const uint32_t _offset = 0, const MidiEventSource _source = MidiEventSourcePlugin) + SMidiEvent(const uint8_t _a = 0, const uint8_t _b = 0, const uint8_t _c = 0, const uint32_t _offset = 0, const MidiEventSource _source = MidiEventSource::Plugin) : a(_a), b(_b), c(_c), offset(_offset), source(_source) { } diff --git a/source/virusLib/demoplayback.cpp b/source/virusLib/demoplayback.cpp @@ -181,11 +181,11 @@ namespace virusLib // use the uc to generate our sysex header if(isMulti) { - m_mc.sendSysex({0xf0, 0x00, 0x20, 0x33, 0x01, OMNI_DEVICE_ID, 0x31, 0x01, 0x00, 0xf7}, responses, synthLib::MidiEventSourceEditor); + m_mc.sendSysex({0xf0, 0x00, 0x20, 0x33, 0x01, OMNI_DEVICE_ID, 0x31, 0x01, 0x00, 0xf7}, responses, synthLib::MidiEventSource::Editor); } else { - m_mc.sendSysex({0xf0, 0x00, 0x20, 0x33, 0x01, OMNI_DEVICE_ID, 0x30, 0x01, program, 0xf7}, responses, synthLib::MidiEventSourceEditor); + m_mc.sendSysex({0xf0, 0x00, 0x20, 0x33, 0x01, OMNI_DEVICE_ID, 0x30, 0x01, program, 0xf7}, responses, synthLib::MidiEventSource::Editor); } auto& s = responses.front().sysex; @@ -300,7 +300,7 @@ namespace virusLib case EventType::MidiSysex: { std::vector<synthLib::SMidiEvent> responses; - m_mc.sendSysex(_event.data, responses, synthLib::MidiEventSourcePlugin); + m_mc.sendSysex(_event.data, responses, synthLib::MidiEventSource::Plugin); } break; case EventType::Midi: diff --git a/source/virusLib/microcontroller.cpp b/source/virusLib/microcontroller.cpp @@ -816,11 +816,11 @@ bool Microcontroller::sendSysex(const std::vector<uint8_t>& _data, std::vector<S } // bounce back to UI if not sent by editor - if(_source != MidiEventSourceEditor) + if(_source != MidiEventSource::Editor) { SMidiEvent ev; ev.sysex = _data; - ev.source = MidiEventSourceEditor; // don't send to output + ev.source = MidiEventSource::Editor; // don't send to output _responses.push_back(ev); } @@ -1075,9 +1075,9 @@ bool Microcontroller::getState(std::vector<unsigned char>& _state, const StateTy std::vector<SMidiEvent> responses; if(_type == StateTypeGlobal) - sendSysex({M_STARTOFSYSEX, 0x00, 0x20, 0x33, 0x01, deviceId, REQUEST_TOTAL, M_ENDOFSYSEX}, responses, MidiEventSourcePlugin); + sendSysex({M_STARTOFSYSEX, 0x00, 0x20, 0x33, 0x01, deviceId, REQUEST_TOTAL, M_ENDOFSYSEX}, responses, MidiEventSource::Plugin); - sendSysex({M_STARTOFSYSEX, 0x00, 0x20, 0x33, 0x01, deviceId, REQUEST_ARRANGEMENT, M_ENDOFSYSEX}, responses, MidiEventSourcePlugin); + sendSysex({M_STARTOFSYSEX, 0x00, 0x20, 0x33, 0x01, deviceId, REQUEST_ARRANGEMENT, M_ENDOFSYSEX}, responses, MidiEventSource::Plugin); if(responses.empty()) return false; @@ -1132,7 +1132,7 @@ bool Microcontroller::setState(const std::vector<synthLib::SMidiEvent>& _events) { if(!event.sysex.empty()) { - sendSysex(event.sysex, unusedResponses, MidiEventSourcePlugin); + sendSysex(event.sysex, unusedResponses, MidiEventSource::Plugin); unusedResponses.clear(); } else diff --git a/source/xtLib/xtDevice.cpp b/source/xtLib/xtDevice.cpp @@ -73,7 +73,7 @@ namespace xt if(!m_customSysexOut.empty()) { for (auto& custom : m_customSysexOut) - custom.source = synthLib::MidiEventSourceEditor; // do not send to output + custom.source = synthLib::MidiEventSource::Editor; // do not send to output _midiOut.insert(_midiOut.begin(), m_customSysexOut.begin(), m_customSysexOut.end()); m_customSysexOut.clear();