resonance 1.0.1
Loading...
Searching...
No Matches
bgtrackgraph.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5class BarSequencer;
6class MidiDisabler;
7class Mixer;
8class MsgSink;
9class MsgSource;
10class MuseSynth;
11class TrackData;
12
25public:
34 void *operator new(size_t nSize);
35
43 void operator delete(void *pBlock);
44
55 BGTrackGraph(int nTrack, int nUnmapped);
56
64
76
84 void CreateMixer(TrackData *pTrack);
85
94
103
111 void AddSynthSink(MsgSink *pSink);
112
119 void Stop();
120
131
141
152 int CallBuildSequencer();
153
165
176 static void Delete(BGTrackGraph *pGraph);
177
178private:
179 BarSequencer *mSequencer; // +0x00
180 unsigned char mUnsetLowByte; // +0x04 0xff at construction and never read
181 unsigned char mUnsetHighByte; // +0x05 0xff at construction and never read
182 int mTrack; // +0x08
183 TrackData *mTrackData; // +0x0c
184 int mReserved; // +0x10 never read or written
185 int mUnmapped; // +0x14
186 MuseSynth *mMuseSynth; // +0x18
187 MidiDisabler *mDisabler; // +0x1c
188 Mixer *mMixer; // +0x20
189};
190
191// NTSC-U/C: 0x00193ff8, PAL: 0x00199c30
192// The out-of-line copy.
195 return 0;
196}
197
198// NTSC-U/C: 0x00194018, PAL: 0x00199c50
199// The out-of-line copy.
201 Stop();
202 return 0;
203}
204
205// NTSC-U/C: 0x00194038, PAL: 0x00199c70
206// The out-of-line copy.
207inline void BGTrackGraph::Delete(BGTrackGraph *pGraph) {
208 delete pGraph;
209}
void BuildSequencer()
Build the track's sequencer and start it.
void AttachMixerToSource(MsgSource *pSource)
Register the mixer as a sink of a source.
int CallDeleteSequencer()
Run Stop() and report zero.
Definition bgtrackgraph.h:200
void CreateMixer(TrackData *pTrack)
Record the track and build its mixer on the track's MIDI channel.
void Stop()
Delete the sequencer, if any.
void AttachMixerToSynth(MsgSink *pSynth)
Feed the synthesiser's output to the mixer and the mixer's output to a synthesiser sink.
void AddSynthSink(MsgSink *pSink)
Register a sink with the synthesiser.
int CallBuildSequencer()
Run BuildSequencer() and report zero.
Definition bgtrackgraph.h:193
BGTrackGraph(int nTrack, int nUnmapped)
Build the synthesiser and the MIDI filter, and connect the filter to the synthesiser.
static void Delete(BGTrackGraph *pGraph)
Delete a graph, which may be null.
Definition bgtrackgraph.h:207
~BGTrackGraph()
Delete the sequencer, the filter, the synthesiser, and the mixer.
void EnableMidi()
Let the track's notes reach the synthesiser.
void DisableMidi()
Stop the track's notes reaching the synthesiser.
Task that sends one track's MIDI a bar at a time.
Definition barsequencer.h:29
Filter that stops a track's notes while it is disabled and passes everything else.
Definition middisabler.h:25
Per-track MIDI mixer that sits between a track graph and the synthesiser.
Definition mixer.h:32
Receiver of engine messages.
Definition msgsink.h:37
Sender of engine messages, which stores the list of sinks that receive them.
Definition msgsource.h:26
Owner of the players that are sounding, and the sink that starts them.
Definition musesynth.h:36
Converted events of one track of a level.
Definition trackdata.h:52