Add Windows support.

This commit is contained in:
david 2020-07-04 19:43:08 +01:00
parent ee51f3ee09
commit 683ba5447f
37 changed files with 477 additions and 113 deletions

View file

@ -123,11 +123,11 @@ bool MidiReader::ProcessSetTempoMetaEvent(std::ifstream& file, MetaMidiEvent& ev
BinaryFile::GetNextByteAsInt(file, length);
mTrackByteCount ++;
char buffer[length];
BinaryFile::GetNextNBytes(file, buffer, length);
std::string buffer;
BinaryFile::GetNextNBytes(file, buffer.data(), length);
mTrackByteCount += length;
int tempo = ByteUtils::ToInt(buffer, length);
int tempo = ByteUtils::ToInt(buffer.data(), length);
const int MICROSECONDS_PER_MINUTE = 60000000;
std::cout << "Got tempo "<< tempo << "|" << MICROSECONDS_PER_MINUTE/tempo<< std::endl;
event.SetValue(tempo);
@ -331,7 +331,7 @@ bool MidiReader::ProcessTrackChunk(std::ifstream& file, bool debug)
mTrackByteCount = 0;
MidiTrack track;
unsigned iter_count = 0;
while(mTrackByteCount < chunkSize)
while(mTrackByteCount < unsigned(chunkSize))
{
std::cout << "-------------" << std::endl;
ProcessEvent(file, track);