resonance 1.0.1
Loading...
Searching...
No Matches
musesynth.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "app/msgsink.h"
6#include "gs/msgsplitter.h"
7#include "gs/museparent.h"
8#include "gs/museplayer.h"
9#include "msg/message.h"
10#include "sch/tickclock.h"
11
12class StdMidiMsg;
13class SustainNoteMsg;
14class SynthSustainer;
15
36class MuseSynth : public MsgSink, public MuseParent {
37public:
44
51 virtual ~MuseSynth();
52
60 void AddSink(MsgSink *pSink);
61
73
78 virtual void RetainOnly(MusePlayer *pPlayer);
79
84 virtual void PlayerFinished(MusePlayer *pPlayer);
85
95 int IsActive() const;
96
104
105protected:
117
131
141 virtual void DispatchPriv(Message *pMsg);
142
152
160
170
171 // The clock every player is scheduled against.
173 // Every player this object created reports back to it and sends through it.
175 // Null until CreateSustainer() stores the new SynthSustainer here.
177 // The sink every player is started against. It addresses mSplitter until CreateSustainer()
178 // points it at the sustainer, whose own output is mSplitter.
179 MsgSink *mOutput; // +0x28
180 // Every player currently sounding. A four-byte element places the value at +0x08 of a 16-byte
181 // node.
182 std::list<MusePlayer *> mPlayers; // +0x2c
183};
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
Sink that delivers everything it receives to every registered sink.
Definition msgsplitter.h:19
Owner a MusePlayer reports back to.
Definition museparent.h:18
Something that turns one muse into messages over time.
Definition museplayer.h:24
void StartNotePlayer(Message *pMsg)
Start a note player for one NoteMsg.
void CreateSustainer()
Build the sustain filter this synthesiser feeds through.
void StartMultiMusePlayer(Message *pMsg)
Start a MultiMusePlayer for one MultiMuseMsg.
virtual ~MuseSynth()
Release every player and then the splitter.
SynthSustainer * mSustainer
Definition musesynth.h:176
virtual void RetainOnly(MusePlayer *pPlayer)
int IsActive() const
Report whether any player is sounding.
void AddSink(MsgSink *pSink)
Register a sink with the splitter every player sends to.
virtual void PlayerFinished(MusePlayer *pPlayer)
void OnAllNotesOff()
The out-of-line copy of the AllNotesOffMsg branch DispatchPriv() expands inline.
MsgSplitter mSplitter
Definition musesynth.h:174
void ReleaseAllPlayers()
Stop and release every player.
void OnStdMidi(StdMidiMsg *pMsg)
The out-of-line copy of the StdMidiMsg branch DispatchPriv() expands inline.
MsgSink * mOutput
Definition musesynth.h:179
MuseSynth(Sch::TickClock *pClock)
void OnSustainNote(SustainNoteMsg *pMsg)
The out-of-line copy of the SustainNoteMsg branch DispatchPriv() expands inline.
virtual void DispatchPriv(Message *pMsg)
Act on a message.
Sch::TickClock * mClock
Definition musesynth.h:172
std::list< MusePlayer * > mPlayers
Definition musesynth.h:182
Pausable view of scheduler time, together with the tempo that maps it to a song position.
Definition tickclock.h:40
Event the game passes between a MsgSource and a MsgSink.
Definition stdmidimsg.h:27
Event the game passes between a MsgSource and a MsgSink.
Definition sustainnotemsg.h:27
Message filter that suppresses note-offs for the notes a sustain request covers.
Definition synthsustainer.h:25