resonance 1.0.1
Loading...
Searching...
No Matches
riffrangefinder.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/msgsink.h"
4#include "gs/multimuse.h"
5#include "msg/message.h"
6
16class RiffRangeFinder : public MsgSink {
17public:
31 RiffRangeFinder(MultiMuse *pMuse, int *pLow, int *pHigh) : mLow(kHighestNote), mHigh(0) {
32 for (const auto &entry : pMuse->mEntries) {
33 DispatchPriv(entry.mValue);
34 }
35 *pLow = mLow;
36 *pHigh = mHigh;
37 }
38
48 virtual void DispatchPriv(Message *pMsg);
49
50private:
51 static constexpr unsigned int kHighestNote = 127;
52
53 unsigned int mLow; // +0x04
54 unsigned int mHigh; // +0x08
55};
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
Receiver of engine messages.
Definition msgsink.h:37
Sequence of messages, each at a song position.
Definition multimuse.h:30
std::vector< TickObj< MuseMsg * > > mEntries
Every message of the sequence, in ascending song position.
Definition multimuse.h:149
virtual void DispatchPriv(Message *pMsg)
Widen the range to the note of a NoteMsg.
RiffRangeFinder(MultiMuse *pMuse, int *pLow, int *pHigh)
Visit every message of a sequence and report the note range.
Definition riffrangefinder.h:31