mirror of https://github.com/AxioDL/boo.git
Allow MIDIDecoder to handle multiple messages per pass
This commit is contained in:
parent
f73e4f08fa
commit
fd2a92e2c2
|
@ -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 end)
|
||||||
{
|
{
|
||||||
std::vector<uint8_t>::const_iterator it = begin;
|
std::vector<uint8_t>::const_iterator it = begin;
|
||||||
if (it == end)
|
while (it != end)
|
||||||
return begin;
|
{
|
||||||
|
|
||||||
uint8_t a = *it++;
|
uint8_t a = *it++;
|
||||||
uint8_t b;
|
uint8_t b;
|
||||||
if (a & 0x80)
|
if (a & 0x80)
|
||||||
|
@ -61,8 +60,7 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
_readContinuedValue(it, end, length);
|
_readContinuedValue(it, end, length);
|
||||||
it += length;
|
it += length;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
uint8_t chan = m_status & 0xf;
|
uint8_t chan = m_status & 0xf;
|
||||||
switch (Status(m_status & 0xf0))
|
switch (Status(m_status & 0xf0))
|
||||||
|
@ -195,14 +193,16 @@ MIDIDecoder::receiveBytes(std::vector<uint8_t>::const_iterator begin,
|
||||||
case Status::SysExTerm:
|
case Status::SysExTerm:
|
||||||
case Status::TimingClock:
|
case Status::TimingClock:
|
||||||
case Status::ActiveSensing:
|
case Status::ActiveSensing:
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue