wavelength 1.0.0
Loading...
Searching...
No Matches
midichannelstate.h
Go to the documentation of this file.
1#pragma once
2
3#include "gs/muse.h"
4#include "gs/stdmidimuse.h"
5#include "os/ptr.h"
6
16public:
18 static constexpr int kNumControllers = 128;
19
27 explicit MidiChannelState(unsigned char nChannel);
28
36
49 void OnMessage(unsigned char nStatus, unsigned char nData1, unsigned char nData2);
50
59
66 void Reset();
67
75 void SetChannel(unsigned char nChannel);
76
77private:
85 StdMidiMuse *GetProgramMuse();
86
94 StdMidiMuse *GetPressureMuse();
95
103 StdMidiMuse *GetPitchBendMuse();
104
113 StdMidiMuse *GetControllerMuse(unsigned char nController);
114
115 unsigned char mChannel;
116 int mProgram;
117 int mPressure;
118 int mBendLow;
119 int mBendHigh;
120 int mControllers[kNumControllers];
121 Ptr<StdMidiMuse> mProgramMuse;
122 Ptr<StdMidiMuse> mPressureMuse;
123 Ptr<StdMidiMuse> mBendMuse;
124 Ptr<StdMidiMuse> mControllerMuses[kNumControllers];
125 Ptr<Muse> mMuse;
126 int mChanged;
127};
void Reset()
Clear the state.
MidiChannelState(unsigned char nChannel)
Construct the state of a channel with nothing set.
static constexpr int kNumControllers
Number of MIDI controllers.
Definition midichannelstate.h:18
void OnMessage(unsigned char nStatus, unsigned char nData1, unsigned char nData2)
Record a channel message of the channel that changes the state.
void SetChannel(unsigned char nChannel)
Clear the state and change the channel.
~MidiChannelState()
Release the muses.
Muse * GetMuse()
Report the muse that restores the state, built again when the state changed.
Piece of MIDI performance that a Scheduler plays.
Definition muse.h:12
Owner of one reference to an Attachment.
Definition ptr.h:16
Muse that sends one standard MIDI message.
Definition stdmidimuse.h:18