commit 90d7a565fc1820cb682a3e616bd1d82a25dfd7aa
parent bc0a62b6331e7e524c305a86ac607378cc1c9895
Author: Tal Aviram <me@talaviram.com>
Date: Fri, 23 Jul 2021 19:59:15 +0300
controller - add basic print utility func.
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/source/jucePlugin/VirusController.cpp b/source/jucePlugin/VirusController.cpp
@@ -7,6 +7,15 @@ namespace Virus
{
}
+ void Controller::printMessage(const SysEx &msg) const
+ {
+ for (auto &m : msg)
+ {
+ std::cout << std::hex << (int)m << ",";
+ }
+ std::cout << std::endl;
+ }
+
std::vector<uint8_t> Controller::constructMessage(SysEx msg)
{
uint8_t start[] = {0xf0, 0x00, 0x20, 0x33, 0x01, static_cast<uint8_t>(m_deviceId)};
@@ -21,6 +30,7 @@ namespace Virus
for (auto msg : m_virusOut)
{
// parse here
+ printMessage(msg.sysex);
}
}
}; // namespace Virus
diff --git a/source/jucePlugin/VirusController.h b/source/jucePlugin/VirusController.h
@@ -15,6 +15,8 @@ namespace Virus
// this is called by the plug-in on audio thread!
void dispatchVirusOut(const std::vector<synthLib::SMidiEvent> &);
+ void printMessage(const SysEx &) const;
+
private:
std::vector<uint8_t> constructMessage(SysEx msg);