resonance 1.0.1
Loading...
Searching...
No Matches
pitchriffmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
5#include "mid/tick.h"
6#include "msg/message.h"
7
8class Player;
9
26class PitchRiffMsg : public Message {
27public:
34 static int sID;
35
43 }
44
58 PitchRiffMsg(int nButton, Player *pPlayer, Sch::Tick position, int nTrack)
59 : mButton(nButton), mPlayer(pPlayer), mPosition(position), mTrack(nTrack) {
60 }
61
72 static Message *New();
73
81 virtual Message *Clone();
82
90 virtual int Type();
91
99 virtual const char *GetName() const;
100
109 virtual void PrintExtra(std::ostream &stream) const;
110
111 // Public because Scratcher::DispatchPriv() reads these directly, through a PitchRiffMsg
112 // pointer from outside the hierarchy, and the image exposes no accessor. A friend declaration
113 // fits equally well.
114 int mButton; // +0x04, labelled `b#` by PrintExtra()
115 Player *mPlayer; // +0x08
117 int mTrack; // +0x10
118};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Sch::Tick mPosition
Definition pitchriffmsg.h:116
static Message * New()
Produce a default-constructed message on the heap.
Player * mPlayer
Definition pitchriffmsg.h:115
int mTrack
Definition pitchriffmsg.h:117
virtual int Type()
Report this message's registered identity.
static int sID
Identity that Type() reports.
Definition pitchriffmsg.h:34
PitchRiffMsg()
Construct a message with the position at kTickInfinity and the rest unset.
Definition pitchriffmsg.h:42
int mButton
Definition pitchriffmsg.h:114
virtual Message * Clone()
Produce a heap copy of this message.
virtual const char * GetName() const
Report this message's class name.
PitchRiffMsg(int nButton, Player *pPlayer, Sch::Tick position, int nTrack)
Report the start of a riff.
Definition pitchriffmsg.h:58
virtual void PrintExtra(std::ostream &stream) const
Write the position, a space, the player's colour name, b#, and the word at +0x04 to a diagnostic str...
One participant in a session, local or remote.
Definition player.h:39
Song position in MIDI ticks, printed as measure, beat, and tick.
Definition tick.h:70