Allow MIDIDecoder to handle multiple messages per pass

This commit is contained in:
Jack Andersen 2018-08-24 22:37:26 -10:00
parent f73e4f08fa
commit fd2a92e2c2
1 changed files with 135 additions and 135 deletions

View File

@ -41,9 +41,8 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
std::vector<uint8_t>::const_iterator end)
{
std::vector<uint8_t>::const_iterator it = begin;
if (it == end)
return begin;
while (it != end)
{
uint8_t a = *it++;
uint8_t b;
if (a & 0x80)
@ -61,8 +60,7 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
uint32_t length;
_readContinuedValue(it, end, length);
it += length;
}
else
} else
{
uint8_t chan = m_status & 0xf;
switch (Status(m_status & 0xf0))
@ -195,14 +193,16 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
case Status::SysExTerm:
case Status::TimingClock:
case Status::ActiveSensing:
default: break;
default:
break;
}
break;
}
default: break;
default:
break;
}
}
}
return it;
}