Core lib building
This commit is contained in:
parent
3ed195d7dd
commit
94fcc42aed
73 changed files with 625 additions and 661 deletions
|
@ -1,7 +1,7 @@
|
|||
#include "MidiChannelEventAdapter.h"
|
||||
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
#include "Bits.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
@ -19,7 +19,7 @@ int MidiChannelEventAdapter::readEvent(std::ifstream* file, char firstByte, Midi
|
|||
unsigned byteCount = 0;
|
||||
//std::cout << "Channel: " << midi_channel << std::endl;
|
||||
|
||||
const bool isStatusByte = ByteUtils::MostSignificantBitIsOne(firstByte);
|
||||
const bool isStatusByte = Bits::MostSignificantBitIsOne(firstByte);
|
||||
if(isStatusByte)
|
||||
{
|
||||
event->SetTypeAndChannel(firstByte);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "MidiMetaEventAdapter.h"
|
||||
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
#include "Bits.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
@ -108,7 +108,7 @@ int MidiMetaEventAdapter::ReadIntEvent(std::ifstream* file, MetaMidiEvent* event
|
|||
BinaryStream::getNextNBytes(file, buffer.data(), length);
|
||||
byteCount += length;
|
||||
|
||||
const int value = ByteUtils::ToType<ByteUtils::DWord>(buffer.data(), length);
|
||||
const int value = Bits::ToType<Bits::DWord>(buffer.data(), length);
|
||||
event->SetValue(value);
|
||||
return byteCount;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ int MidiMetaEventAdapter::ReadChannelPrefixEvent(std::ifstream* file, MetaMidiEv
|
|||
BinaryStream::getNextNBytes(file, buffer.data(), length);
|
||||
byteCount += length;
|
||||
|
||||
const int value = ByteUtils::ToType<ByteUtils::DWord>(buffer.data(), length);
|
||||
const int value = Bits::ToType<Bits::DWord>(buffer.data(), length);
|
||||
event->SetValue(value);
|
||||
lastMidiChannel = value;
|
||||
return byteCount;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "MidiReader.h"
|
||||
|
||||
#include "MidiDocument.h"
|
||||
#include "ByteUtils.h"
|
||||
#include "Bits.h"
|
||||
#include "MidiTrack.h"
|
||||
#include "BinaryStream.h"
|
||||
#include "FileLogger.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "MidiTimeAdapter.h"
|
||||
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
#include "Bits.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
@ -13,7 +13,7 @@ int MidiTimeAdapter::ReadEventTimeDelta(std::ifstream* file, int& delta)
|
|||
file->get(c);
|
||||
byteCount++;
|
||||
|
||||
if(!ByteUtils::MostSignificantBitIsOne(c))
|
||||
if(!Bits::MostSignificantBitIsOne(c))
|
||||
{
|
||||
delta = int(c);
|
||||
//std::cout << "Time delta final: " << delta << std::endl;
|
||||
|
@ -54,13 +54,13 @@ int MidiTimeAdapter::ReadTimeDivision(std::ifstream* file, MidiTimeDivision& div
|
|||
return -1;
|
||||
}
|
||||
|
||||
division.mUseFps = ByteUtils::GetWordFirstBit(*time_division);
|
||||
division.mUseFps = Bits::GetWordFirstBit(*time_division);
|
||||
if (division.mUseFps)
|
||||
{
|
||||
const int TOP_7_BITS = 0x7F00; // 0111 1111 - 0000 0000
|
||||
division.mFps = ((~(*time_division) & TOP_7_BITS) >> 8) - 1; // Reverse 2complement of next 7 bits
|
||||
}
|
||||
|
||||
division.mTicks = ByteUtils::GetWordLastByte(*time_division);
|
||||
division.mTicks = Bits::GetWordLastByte(*time_division);
|
||||
return 2; // Bytes advanced
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue