resonance 1.0.1
Loading...
Searching...
No Matches
stdmidimsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "msg/musemsg.h"
6
7class IBStream;
8class OBStream;
9
27class StdMidiMsg : public MuseMsg {
28public:
35 static unsigned int sID;
36
44 }
45
57 StdMidiMsg(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2)
58 : MuseMsg(nTick), mStatus(nStatus), mData1(nData1), mData2(nData2) {
59 }
60
71 static Message *New();
72
80 virtual Message *Clone();
81
89 virtual int Type();
90
98 virtual const char *GetName() const;
99
111 virtual void PrintExtra(std::ostream &stream) const;
112
122 virtual void saveGuts(OBStream &stream) const;
123
131 virtual void restoreGuts(IBStream &stream);
132
147 unsigned char mStatus;
148 unsigned char mData1;
149 unsigned char mData2;
150};
Input half of the byte stream interface.
Definition ibstream.h:36
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
MuseMsg()
Start the song position at kTickInfinity.
Definition musemsg.h:38
Output half of the byte stream interface.
Definition obstream.h:25
static unsigned int sID
Identity that Type() reports.
Definition stdmidimsg.h:35
virtual void restoreGuts(IBStream &stream)
Read the three bytes back in place, one byte each through IBStream::Read().
virtual void saveGuts(OBStream &stream) const
Write the three bytes to a stream, one byte each through OBStream::Write().
StdMidiMsg(int nTick, unsigned char nStatus, unsigned char nData1, unsigned char nData2)
Construct one channel message at a song position.
Definition stdmidimsg.h:57
StdMidiMsg()
Construct a message with the song position at kTickInfinity and the three bytes unset.
Definition stdmidimsg.h:43
static Message * New()
Produce a default-constructed message on the heap.
unsigned char mStatus
The three bytes of one Standard MIDI channel message.
Definition stdmidimsg.h:147
virtual const char * GetName() const
Report this message's class name.
virtual Message * Clone()
Produce a heap copy of this message.
virtual void PrintExtra(std::ostream &stream) const
Write the message to a diagnostic stream.
unsigned char mData2
Definition stdmidimsg.h:149
virtual int Type()
Report this message's registered identity.
unsigned char mData1
Definition stdmidimsg.h:148