wavelength 1.0.0
Loading...
Searching...
No Matches
MixTrack Class Reference

One looping track of the front-end music, with a volume that fades in and out. More...

#include <mixtrack.h>

Inheritance diagram for MixTrack:
Collaboration diagram for MixTrack:

Classes

class  VolumeRamp
 Ramp of the volume of a track. More...

Public Member Functions

void * operator new (size_t nSize)
 Allocate a track from the tagged heap under the tag MixTrack.
void operator delete (void *pBlock)
 Release a track to the tagged heap.
 MixTrack (Muse *pMuse, int nLength, unsigned char nChannel)
 Construct a silent, stopped track.
 ~MixTrack ()
 Stop the track and release its ramp.
void FadeIn (int nFadeTicks, int nPosition)
 Start the track at a position of its loop and fade its volume up to the maximum.
void FadeOut (int nFadeTicks)
 Fade a playing track's volume to 0 and stop the track once the fade has ended.
void StopNow ()
 Stop the track and its fade at once and return its volume to full.
bool IsPlaying () const
 Report whether the track plays.
void SetVolume (float fVolume)
 Send a volume, limited to the range from 0 to 1, as the expression of the track's channel.
void RampTo (float fTarget, int nTicks)
 Start moving the volume to a target.
Public Member Functions inherited from MuseLooper
 MuseLooper (Muse *pMuse, int nLength)
 Construct a stopped looper.
 ~MuseLooper ()
 Stop the piece and release it.
void Play (Scheduler *pScheduler, int nPosition)
 Start the piece at a position of the loop on a scheduler, stopping it first.
void Stop ()
 Stop the piece and withdraw the repeat.
bool IsPlaying () const
 Report whether the piece plays.
int GetLength () const
 Report the ticks of one loop.
int GetPosition () const
 Report the position of the scheduler in the current loop.

Detailed Description

One looping track of the front-end music, with a volume that fades in and out.

The RTTI includes the class name in the nested class MixTrack::VolumeRamp. The class is not polymorphic. The object is 0x24 bytes. The volume is the expression controller of the track's MIDI channel. A track that fades out stops looping once the fade has ended.

Constructor & Destructor Documentation

◆ MixTrack()

MixTrack::MixTrack ( Muse * pMuse,
int nLength,
unsigned char nChannel )

Construct a silent, stopped track.

The music_max_volume entry of the metagame configuration gives the volume the track fades in to.

Parameters
pMuseThe music of the track.
nLengthThe ticks of one loop.
nChannelThe MIDI channel of the music.
Ghidra address:
NTSC-U/C: 0x0016a0c8
Ghidra address:
PAL: 0x0016d250

◆ ~MixTrack()

MixTrack::~MixTrack ( )

Stop the track and release its ramp.

Ghidra address:
NTSC-U/C: 0x0016a1a8
Ghidra address:
PAL: 0x0016d330

Member Function Documentation

◆ operator new()

void * MixTrack::operator new ( size_t nSize)
inline

Allocate a track from the tagged heap under the tag MixTrack.

No out-of-line body exists. The callers expand the call inline.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void MixTrack::operator delete ( void * pBlock)
inline

Release a track to the tagged heap.

No out-of-line body exists. The destructor expands the call inline.

Parameters
pBlockThe block.

◆ FadeIn()

void MixTrack::FadeIn ( int nFadeTicks,
int nPosition )

Start the track at a position of its loop and fade its volume up to the maximum.

Parameters
nFadeTicksThe ticks the fade lasts.
nPositionThe position of the loop the track starts at.
Ghidra address:
NTSC-U/C: 0x0016a228
Ghidra address:
PAL: 0x0016d3b0

◆ FadeOut()

void MixTrack::FadeOut ( int nFadeTicks)

Fade a playing track's volume to 0 and stop the track once the fade has ended.

Parameters
nFadeTicksThe ticks the fade lasts.
Ghidra address:
NTSC-U/C: 0x0016a2a8
Ghidra address:
PAL: 0x0016d430

◆ StopNow()

void MixTrack::StopNow ( )

Stop the track and its fade at once and return its volume to full.

Ghidra address:
NTSC-U/C: 0x0016a318
Ghidra address:
PAL: 0x0016d4a0

◆ IsPlaying()

bool MixTrack::IsPlaying ( ) const

Report whether the track plays.

Returns
Whether the track plays.
Ghidra address:
NTSC-U/C: 0x0016a378
Ghidra address:
PAL: 0x0016d500

◆ SetVolume()

void MixTrack::SetVolume ( float fVolume)

Send a volume, limited to the range from 0 to 1, as the expression of the track's channel.

Parameters
fVolumeThe volume.
Ghidra address:
NTSC-U/C: 0x0016a398
Ghidra address:
PAL: 0x0016d520

◆ RampTo()

void MixTrack::RampTo ( float fTarget,
int nTicks )

Start moving the volume to a target.

Parameters
fTargetThe target.
nTicksThe ticks the move lasts.
Ghidra address:
NTSC-U/C: 0x0016a420
Ghidra address:
PAL: 0x0016d5a8

The documentation for this class was generated from the following file: