Start font reading support.
This commit is contained in:
parent
92e7a78710
commit
ed925afabf
22 changed files with 599 additions and 220 deletions
|
@ -1,6 +1,6 @@
|
|||
#include "MidiChannelEventAdapter.h"
|
||||
|
||||
#include "BinaryFile.h"
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
|
@ -15,7 +15,7 @@ int MidiChannelEventAdapter::ReadEvent(std::ifstream* file, char firstByte, Midi
|
|||
unsigned byteCount = 0;
|
||||
std::cout << "Channel: " << midi_channel << std::endl;
|
||||
|
||||
const bool isStatusByte = ByteUtils::MSBIsOne(firstByte);
|
||||
const bool isStatusByte = ByteUtils::MostSignificantBitIsOne(firstByte);
|
||||
if(isStatusByte)
|
||||
{
|
||||
event->SetTypeAndChannel(firstByte);
|
||||
|
@ -44,8 +44,7 @@ int MidiChannelEventAdapter::ReadEvent(std::ifstream* file, char firstByte, Midi
|
|||
}
|
||||
case MidiChannelEvent::Type::PROGRAM:
|
||||
{
|
||||
int value0 = 0;
|
||||
BinaryFile::GetNextByteAsInt(file, value0);
|
||||
int value0 = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount ++;
|
||||
break;
|
||||
}
|
||||
|
@ -59,19 +58,15 @@ int MidiChannelEventAdapter::ReadEvent(std::ifstream* file, char firstByte, Midi
|
|||
int MidiChannelEventAdapter::ReadEventData(std::ifstream* file, MidiChannelEvent* event, char c)
|
||||
{
|
||||
int value0 = int(c);
|
||||
int value1 = 0;
|
||||
BinaryFile::GetNextByteAsInt(file, value1);
|
||||
int value1 = *BinaryStream::getNextByteAsInt(file);
|
||||
event->SetValues(value0, value1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int MidiChannelEventAdapter::ReadEventData(std::ifstream* file, MidiChannelEvent* event)
|
||||
{
|
||||
int value0 = 0;
|
||||
BinaryFile::GetNextByteAsInt(file, value0);
|
||||
|
||||
int value1 = 0;
|
||||
BinaryFile::GetNextByteAsInt(file, value1);
|
||||
int value0 = *BinaryStream::getNextByteAsInt(file);
|
||||
int value1 = *BinaryStream::getNextByteAsInt(file);
|
||||
event->SetValues(value0, value1);
|
||||
return 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue