resonance 1.0.1
Loading...
Searching...
No Matches
sustainnotemsg.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 SustainNoteMsg : public MuseMsg {
28public:
35 static unsigned int sID;
36
45
55 SustainNoteMsg(int nTick, unsigned char nNote) : MuseMsg(nTick), mNote(nNote) {
56 }
57
68 static Message *New();
69
77 virtual Message *Clone();
78
86 virtual int Type();
87
95 virtual const char *GetName() const;
96
107 virtual void PrintExtra(std::ostream &stream) const;
108
116 virtual void saveGuts(OBStream &stream) const;
117
125 virtual void restoreGuts(IBStream &stream);
126
135 unsigned char mNote;
136};
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
unsigned char mNote
The note number, and the one byte the message includes.
Definition sustainnotemsg.h:135
SustainNoteMsg(int nTick, unsigned char nNote)
Report a sustained note at a song position.
Definition sustainnotemsg.h:55
virtual const char * GetName() const
Report this message's class name.
SustainNoteMsg()
Construct a message with the song position at kTickInfinity and the byte unset.
Definition sustainnotemsg.h:43
virtual void saveGuts(OBStream &stream) const
Write the byte to a stream through OBStream::Write().
static Message * New()
Produce a default-constructed message on the heap.
virtual Message * Clone()
Produce a heap copy of this message.
virtual void PrintExtra(std::ostream &stream) const
Write the song position and the byte, as a character, to a diagnostic stream.
virtual void restoreGuts(IBStream &stream)
Read the byte back in place through IBStream::Read().
virtual int Type()
Report this message's registered identity.
static unsigned int sID
Identity that Type() reports.
Definition sustainnotemsg.h:35