resonance 1.0.1
Loading...
Searching...
No Matches
midichase.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/msgsink.h"
4#include "mid/tickobj.h"
5
6class Message;
7class MuseMsg;
8
18class MidiChase : public MsgSink {
19public:
21 static constexpr unsigned char kUnset = 0xff;
22
24 static constexpr int kControllerCount = 128;
25
33
38 virtual ~MidiChase();
39
50 virtual void DispatchPriv(Message *pMsg);
51
62 void HandleRange(const TickObj<MuseMsg *> *pBegin, const TickObj<MuseMsg *> *pEnd);
63
75 void Replay(MsgSink *pSink);
76
77private:
78 unsigned char mChannel; // +0x04
79 unsigned char mProgram; // +0x05
80 unsigned char mBendLow; // +0x06
81 unsigned char mBendHigh; // +0x07
82 unsigned char mControllers[kControllerCount]; // +0x08
83};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
virtual void DispatchPriv(Message *pMsg)
Record the channel, and the state a controller change, a program change, or a pitch bend sets.
void Replay(MsgSink *pSink)
Send the collected state to a sink.
void HandleRange(const TickObj< MuseMsg * > *pBegin, const TickObj< MuseMsg * > *pEnd)
Pass every message of a range to MsgSink::Dispatch().
static constexpr int kControllerCount
The number of MIDI controllers.
Definition midichase.h:24
static constexpr unsigned char kUnset
The value every collected byte starts at.
Definition midichase.h:21
virtual ~MidiChase()
MidiChase()
Start with nothing collected.
Receiver of engine messages.
Definition msgsink.h:37
Abstract base shared by a family of messages.
Definition musemsg.h:28
One value at one song position.
Definition tickobj.h:20