resonance 1.0.1
Loading...
Searching...
No Matches
erasemsg.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
28class EraseMsg : public Message {
29public:
36 static int sID;
37
45 }
46
58 EraseMsg(Player *pPlayer, Sch::Tick position, int nTrack, int nDoubleTap)
59 : mPlayer(pPlayer), mPosition(position), mTrack(nTrack), mDoubleTap(nDoubleTap) {
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 Voxer::DispatchPriv(), Scratcher::DispatchPriv(), and
112 // NotePitcher::DispatchPriv() read the members below directly, through an EraseMsg pointer
113 // from outside the hierarchy, and the image exposes no accessor. A friend declaration fits
114 // equally well.
115 Player *mPlayer; // +0x04
117 int mTrack; // +0x0c
118 int mDoubleTap; // +0x10
119};
virtual int Type()
Report this message's registered identity.
EraseMsg()
Construct a message with the position at kTickInfinity and the rest unset.
Definition erasemsg.h:44
virtual Message * Clone()
Produce a heap copy of this message.
static int sID
Identity that Type() reports.
Definition erasemsg.h:36
EraseMsg(Player *pPlayer, Sch::Tick position, int nTrack, int nDoubleTap)
Report an erase press.
Definition erasemsg.h:58
Sch::Tick mPosition
Definition erasemsg.h:116
Player * mPlayer
Definition erasemsg.h:115
int mDoubleTap
Definition erasemsg.h:118
virtual void PrintExtra(std::ostream &stream) const
Write the position and the player's colour name, separated by a space, to a diagnostic stream.
static Message * New()
Produce a default-constructed message on the heap.
virtual const char * GetName() const
Report this message's class name.
int mTrack
Definition erasemsg.h:117
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
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