Further midi file support.

This commit is contained in:
jmsgrogan 2020-05-03 16:28:50 +01:00
parent 36826fa1d4
commit 4d5ca4d654
12 changed files with 739 additions and 200 deletions

View file

@ -0,0 +1,52 @@
#pragma once
#include "MidiEvent.h"
class MidiChannelEvent : public MidiEvent
{
public:
enum class Type{
NONE, NOTE_OFF, NOTE_ON, NOTE_AFTERTOUCH, CONTROLLER,
PROGRAM, CHANNEL_AFTERTOUCH, PITCH_BEND
};
private:
static const int NOTE_OFF = 0x8;
static const int NOTE_ON = 0x9;
static const int NOTE_AFTERTOUCH = 0xA;
static const int CONTROLLER = 0xB;
static const int PROGRAM = 0xC;
static const int CHANNEL_AFTERTOUCH = 0xD;
static const int PITCH_BEND = 0xE;
Type mType;
int mValue0;
int mValue1;
public:
MidiChannelEvent();
static std::shared_ptr<MidiChannelEvent> Create();
void SetType(Type type);
Type GetType();
void SetValues(int value0, int value1);
int GetValue0();
int GetValue1();
static bool IsControllerEvent(int c);
static bool IsNoteOnEvent(int c);
static bool IsNoteOffEvent(int c);
static bool IsNoteAfterTouchEvent(int c);
static bool IsProgramEvent(int c);
static bool IsChannelAftertouchEvent(int c);
static bool IsPitchbendEvent(int c);
static bool IsStatusByte(int c);
};
using MidiChannelEventPtr = std::shared_ptr<MidiChannelEvent>;