Skip to content
Snippets Groups Projects
Commit 8f1aae7d authored by jsiegle's avatar jsiegle
Browse files

Fix bug in StringTS related to byte numbering

parent a1885371
No related branches found
No related tags found
No related merge requests found
......@@ -77,11 +77,11 @@ StringTS::StringTS(MidiMessage &event)
{
const uint8* dataptr = event.getRawData();
int bufferSize = event.getRawDataSize();
len = bufferSize-4-8; // -4 for initial event prefix, -8 for timestamp at the end
len = bufferSize-6-8; // -6 for initial event prefix, -8 for timestamp at the end
memcpy(&timestamp, dataptr + 4+len, 8); // remember to skip first four bytes
memcpy(&timestamp, dataptr + 6+ len, 8); // remember to skip first six bytes
str = new uint8[len];
memcpy(str,dataptr+4,len);
memcpy(str,dataptr + 6, len);
}
StringTS& StringTS::operator=(const StringTS &rhs)
......
......@@ -1880,6 +1880,9 @@ bool TrialCircularBuffer::parseMessage(StringTS msg)
bool redrawNeeded = false;
std::vector<String> input = msg.splitString(' ');
String command = input[0].toLowerCase();
std::cout << "PSTH node received: " << command << std::endl;
if (command == "tictoc_print")
{
if (useThreads)
......@@ -1988,6 +1991,7 @@ bool TrialCircularBuffer::parseMessage(StringTS msg)
}
else if (command == "cleardesign")
{
std::cout << "Clearing design" << std::endl;
clearDesign();
// inform editor repaint is needed
redrawNeeded = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment