|
resonance 1.0.1
|
Audio graph of one background track. More...
#include <bgtrackgraph.h>
Public Member Functions | |
| void * | operator new (size_t nSize) |
| Allocate a graph from the tagged heap under the tag "BGTrackGraph". | |
| void | operator delete (void *pBlock) |
| Release a graph to the tagged heap. | |
| BGTrackGraph (int nTrack, int nUnmapped) | |
| Build the synthesiser and the MIDI filter, and connect the filter to the synthesiser. | |
| ~BGTrackGraph () | |
| Delete the sequencer, the filter, the synthesiser, and the mixer. | |
| void | BuildSequencer () |
| Build the track's sequencer and start it. | |
| void | CreateMixer (TrackData *pTrack) |
| Record the track and build its mixer on the track's MIDI channel. | |
| void | AttachMixerToSource (MsgSource *pSource) |
| Register the mixer as a sink of a source. | |
| 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. | |
| void | Stop () |
| Delete the sequencer, if any. | |
| void | EnableMidi () |
| Let the track's notes reach the synthesiser. | |
| void | DisableMidi () |
| Stop the track's notes reaching the synthesiser. | |
| int | CallBuildSequencer () |
| Run BuildSequencer() and report zero. | |
| int | CallDeleteSequencer () |
| Run Stop() and report zero. | |
Static Public Member Functions | |
| static void | Delete (BGTrackGraph *pGraph) |
| Delete a graph, which may be null. | |
Audio graph of one background track.
The class is not polymorphic and has no RTTI. The title comes from the literal BGTrackGraph that RndWorld's draw pass allocates the object under at 0x0018cf5c and that the destructor frees it under. Its unit spans 0x0013fb10 through 0x00140578, and RndWorld's draw pass constructs one per background track.
The track's MIDI runs from the sequencer through a MidiDisabler into a MuseSynth, whose players feed a Mixer. Gamer switches the MidiDisabler bar by bar.
| BGTrackGraph::BGTrackGraph | ( | int | nTrack, |
| int | nUnmapped ) |
Build the synthesiser and the MIDI filter, and connect the filter to the synthesiser.
The filter starts passing notes. The sequencer and the mixer are created later.
| nTrack | The track's index. |
| nUnmapped | The value the sequencer receives as BarSequencer's nUnmapped. |
| BGTrackGraph::~BGTrackGraph | ( | ) |
Delete the sequencer, the filter, the synthesiser, and the mixer.
| void * BGTrackGraph::operator new | ( | size_t | nSize | ) |
Allocate a graph from the tagged heap under the tag "BGTrackGraph".
No out-of-line body exists. GrooveWorld::BuildGraphs() at 0x0018cce8 inlines the call.
| nSize | The object size the compiler supplies. |
| void BGTrackGraph::operator delete | ( | void * | pBlock | ) |
Release a graph to the tagged heap.
No out-of-line body exists. The destructor's release branch inlines the call.
| pBlock | The block. |
| void BGTrackGraph::BuildSequencer | ( | ) |
Build the track's sequencer and start it.
Replays the controller state every bar of the track's MIDI leaves behind into the synthesiser through a MidiChase, then creates a BarSequencer on the song clock that sends through the filter and starts it. The title is inferred.
| void BGTrackGraph::CreateMixer | ( | TrackData * | pTrack | ) |
Record the track and build its mixer on the track's MIDI channel.
| pTrack | The track. |
| void BGTrackGraph::AttachMixerToSource | ( | MsgSource * | pSource | ) |
Register the mixer as a sink of a source.
| pSource | The source. |
| void BGTrackGraph::AttachMixerToSynth | ( | MsgSink * | pSynth | ) |
Feed the synthesiser's output to the mixer and the mixer's output to a synthesiser sink.
| pSynth | The sink the mixer emits to. |
| void BGTrackGraph::AddSynthSink | ( | MsgSink * | pSink | ) |
Register a sink with the synthesiser.
| pSink | The sink. |
| void BGTrackGraph::Stop | ( | ) |
Delete the sequencer, if any.
| void BGTrackGraph::EnableMidi | ( | ) |
Let the track's notes reach the synthesiser.
Calls MidiDisabler::Enable(). Gamer's per-bar update calls it when its background enable manager reports the bar for the track, and DisableMidi() otherwise.
| void BGTrackGraph::DisableMidi | ( | ) |
Stop the track's notes reaching the synthesiser.
Calls MidiDisabler::Disable(), which also silences the notes already sounding.
|
inline |
Run BuildSequencer() and report zero.
Inline. GrooveWorld::StartSequencers() reaches it through a pointer to member, and the address is its uncalled out-of-line copy in the GrooveWorld unit.
|
inline |
Run Stop() and report zero.
Inline. GrooveWorld::StartSequencers() and FinishSong() reach it through a pointer to member, and the address is its uncalled out-of-line copy in the GrooveWorld unit.
|
inlinestatic |
Delete a graph, which may be null.
Inline. GrooveWorld::DestroyGraphs() passes it to std::for_each, and the out-of-line copy sits in the GrooveWorld unit.
| pGraph | The graph. |