#include "MidiEvent.h"

MidiEvent::MidiEvent()
    : mTimeDelta(0)
{

}

std::unique_ptr<MidiEvent> MidiEvent::Create()
{
    return std::make_unique<MidiEvent>();
}

void MidiEvent::SetTimeDelta(int delta)
{
    mTimeDelta = delta;
}

bool MidiEvent::IsMetaEvent(char c)
{
    return (c & META_EVENT) == META_EVENT;
}

bool MidiEvent::IsSysExEvent(char c)
{
    return IsNormalSysExEvent(c) || IsDividedSysExEvent(c);
}

bool MidiEvent::IsNormalSysExEvent(char c)
{
    return (c & SYSEX_EVENT) == SYSEX_EVENT;
}

bool MidiEvent::IsDividedSysExEvent(char c)
{
    return (c & DIVIDED_SYSEX_EVENT) == DIVIDED_SYSEX_EVENT;
}
