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 14c10741190d896bcfe6ff424f3dabb7bf373372
parent da22bed79f01de17806ebe02e7ac48a616b7ceb4
Author: Tal Aviram <me@talaviram.com>
Date:   Wed, 28 Jul 2021 09:57:24 +0300

Moved parseData to be in parseSingle as its redundant.

Diffstat:
Msource/jucePlugin/VirusController.cpp | 30+++++++++++++-----------------
Msource/jucePlugin/VirusController.h | 1-
2 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/source/jucePlugin/VirusController.cpp b/source/jucePlugin/VirusController.cpp @@ -61,7 +61,19 @@ namespace Virus pos++; const auto progNum = msg[pos]; pos++; - parseData(msg, pos); + + constexpr auto pageSize = 128; + constexpr auto expectedDataSize = pageSize * 2; // we have 2 pages + constexpr auto checkSumSize = 1; + + const auto dataSize = msg.size() - pos - 1; + const auto hasChecksum = dataSize == expectedDataSize + checkSumSize; + assert(hasChecksum || dataSize == expectedDataSize); + + const auto namePos = 128 + 112; + assert(pos + namePos < msg.size()); + auto progName = parseAsciiText(msg, pos + namePos); + DBG(progName); } void Controller::parseMulti(const SysEx &msg) @@ -100,22 +112,6 @@ namespace Virus return sum; } - void Controller::parseData(const SysEx &msg, const size_t startPos) - { - constexpr auto pageSize = 128; - constexpr auto expectedDataSize = pageSize * 2; // we have 2 pages - constexpr auto checkSumSize = 1; - - const auto dataSize = msg.size() - startPos - 1; - const auto hasChecksum = dataSize == expectedDataSize + checkSumSize; - assert(hasChecksum || dataSize == expectedDataSize); - - const auto namePos = 128 + 112; - assert(startPos + namePos < msg.size()); - auto progName = parseAsciiText(msg, startPos + namePos); - DBG(progName); - } - juce::String Controller::parseAsciiText(const SysEx &msg, const int start) { char text[kNameLength + 1]; diff --git a/source/jucePlugin/VirusController.h b/source/jucePlugin/VirusController.h @@ -38,7 +38,6 @@ namespace Virus void parseMessage(const SysEx &); void parseSingle(const SysEx &); void parseMulti(const SysEx &); - void parseData(const SysEx &, size_t startPos); void sendSysEx(const SysEx &); std::vector<uint8_t> constructMessage(SysEx msg);