SoundTrack Class Reference

#include <SoundTrack.h>

Inheritance diagram for SoundTrack:
Object

# Public Types

enum  SoundTrackTypes
enum  SoundEvents
typedef const SoundTrackSpec SoundTrackROMSpec

# Public Member Functions

void constructor (const SoundTrackSpec *soundTrackSpec)
void start (bool wasPaused)
void stop ()
 Stop the playback.
void pause ()
 Pause the playback.
void unpause ()
 Unpause the playback.
void suspend ()
 Suspend the output of sound.
void resume ()
 Resume the output of sound.
void rewind ()
 Rewind the track.
bool update (uint32 elapsedMicroseconds, uint32 targetPCMUpdates, fix7_9_ext tickStep, fix7_9_ext targetTimerResolutionFactor, fixed_t leftVolumeFactor, fixed_t rightVolumeFactor, int8 volumeReduction, uint8 volumenScalePower, uint16 frequencyDelta)
uint32 getTicks ()
float getElapsedTicksPercentaje ()
uint32 getTotalPlaybackMilliseconds (uint16 targetTimerResolutionUS)

# Static Public Member Functions

static void setPCMTargetPlaybackRefreshRate (uint16 pcmTargetPlaybackRefreshRate)

# Protected Attributes

const SoundTrackSpecsoundTrackSpec
 Pointer to the spec that defines how to initialize the soundtrack.
uint32 samples
 Channel's effective length.
uint32 cursor
 Position within the sound track.
uint32 cursorSxINT
 SxINT cursor.
uint32 cursorSxLRV
 SxLRV cursor.
uint32 cursorSxFQ
 SxFQ cursor.
uint32 cursorSxEV0
 SxEV0 cursor.
uint32 cursorSxEV1
 SxEV1 cursor.
uint32 cursorSxRAM
 SxRAM cursor.
uint32 cursorSxSWP
 SxSWP cursor.
uint32 cursorSxMOD
 SxMOD cursor.
uint32 ticks
 Total number of ticks.
fix7_9_ext elapsedTicks
 Ticks before moving the cursor.
fix7_9_ext nextElapsedTicksTarget
 Next ticks target.
bool finished
 If true, the playback is complete.

# Additional Inherited Members

- Private Member Functions inherited from Object
void constructor ()
 Class' constructor.
const void * getVTable ()
bool mutateTo (const void *targetClass)
- Static Private Member Functions inherited from Object
static Object getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod)
- Private Attributes inherited from Object
void * vTable
 Pointer to the class's virtual table.

# Detailed Description

Class SoundTrack

Inherits from Object

Implements a sound track.

Definition at line 257 of file SoundTrack.h.

# Member Typedef Documentation

# SoundTrackROMSpec

A SoundTrack spec that is stored in ROM

Definition at line 246 of file SoundTrack.h.

# Member Enumeration Documentation

# SoundEvents

Sound events that the sound player recongnizes

Definition at line 174 of file SoundTrack.h.

# SoundTrackTypes

Sound track types

Definition at line 166 of file SoundTrack.h.

# Member Function Documentation

# constructor()

void SoundTrack::constructor ( const SoundTrackSpec * soundTrackSpec)

Class' constructor

Parameters
soundTrackSpecSpecification that determines how to configure the sound track

Definition at line 191 of file SoundTrack.c.

# getElapsedTicksPercentaje()

float SoundTrack::getElapsedTicksPercentaje ( )

Retrieve the sound track's percentage of elapsed ticks.

Returns
Percentaje of elapsed ticks

Definition at line 155 of file SoundTrack.c.

# getTicks()

uint32 SoundTrack::getTicks ( )

Retrieve the sound track's total ticks.

Returns
Total number of ticks

Definition at line 148 of file SoundTrack.c.

# getTotalPlaybackMilliseconds()

uint32 SoundTrack::getTotalPlaybackMilliseconds ( uint16 targetTimerResolutionUS)

Retrieve the total time of playback in milliseconds.

Parameters
targetTimerResolutionUSTarget timer resolution in US
Returns
The total time of playback in milliseconds

Definition at line 167 of file SoundTrack.c.

# pause()

void SoundTrack::pause ( )

Pause the playback.

Definition at line 72 of file SoundTrack.c.

# resume()

void SoundTrack::resume ( )

Resume the output of sound.

Definition at line 89 of file SoundTrack.c.

# rewind()

void SoundTrack::rewind ( )

Rewind the track.

Definition at line 94 of file SoundTrack.c.

# setPCMTargetPlaybackRefreshRate()

static void SoundTrack::setPCMTargetPlaybackRefreshRate ( uint16 pcmTargetPlaybackRefreshRate)
static

Set the target refresh rate for PCM playback.

Parameters
pcmTargetPlaybackRefreshRateTarget refresh rate for PCM playback

Definition at line 34 of file SoundTrack.c.

# start()

void SoundTrack::start ( bool wasPaused)

Start the playback.

Parameters
wasPausedIf true, the playback is resuming

Definition at line 47 of file SoundTrack.c.

# stop()

void SoundTrack::stop ( )

Stop the playback.

Definition at line 62 of file SoundTrack.c.

# suspend()

void SoundTrack::suspend ( )

Suspend the output of sound.

Definition at line 84 of file SoundTrack.c.

# unpause()

void SoundTrack::unpause ( )

Unpause the playback.

Definition at line 79 of file SoundTrack.c.

# update()

bool SoundTrack::update ( uint32 elapsedMicroseconds,
uint32 targetPCMUpdates,
fix7_9_ext tickStep,
fix7_9_ext targetTimerResolutionFactor,
fixed_t leftVolumeFactor,
fixed_t rightVolumeFactor,
int8 volumeReduction,
uint8 volumenScalePower,
uint16 frequencyDelta )

Advance the playback on the sound's MIDI tracks.

Parameters
elapsedMicrosecondsElapsed time since the last call
targetPCMUpdatesIdeal Elapsed time since the last call
tickStepTick step per timer interrupt
targetTimerResolutionFactorFactor to apply to the tick step
leftVolumeFactorFactor to apply to the left speaker's volume
rightVolumeFactorFactor to apply to the right speaker's volume
volumeReductionVolume reduction used for fade effects
volumenScalePower2's power to divide to the final volume value
frequencyDeltaadded to the frequency registers
Returns
True if the playback is complete; false otherwise

Definition at line 118 of file SoundTrack.c.

# Member Data Documentation

# cursor

uint32 SoundTrack::cursor
protected

Position within the sound track.

Definition at line 268 of file SoundTrack.h.

# cursorSxEV0

uint32 SoundTrack::cursorSxEV0
protected

SxEV0 cursor.

Definition at line 280 of file SoundTrack.h.

# cursorSxEV1

uint32 SoundTrack::cursorSxEV1
protected

SxEV1 cursor.

Definition at line 283 of file SoundTrack.h.

# cursorSxFQ

uint32 SoundTrack::cursorSxFQ
protected

SxFQ cursor.

Definition at line 277 of file SoundTrack.h.

# cursorSxINT

uint32 SoundTrack::cursorSxINT
protected

SxINT cursor.

Definition at line 271 of file SoundTrack.h.

# cursorSxLRV

uint32 SoundTrack::cursorSxLRV
protected

SxLRV cursor.

Definition at line 274 of file SoundTrack.h.

# cursorSxMOD

uint32 SoundTrack::cursorSxMOD
protected

SxMOD cursor.

Definition at line 292 of file SoundTrack.h.

# cursorSxRAM

uint32 SoundTrack::cursorSxRAM
protected

SxRAM cursor.

Definition at line 286 of file SoundTrack.h.

# cursorSxSWP

uint32 SoundTrack::cursorSxSWP
protected

SxSWP cursor.

Definition at line 289 of file SoundTrack.h.

# elapsedTicks

fix7_9_ext SoundTrack::elapsedTicks
protected

Ticks before moving the cursor.

Definition at line 298 of file SoundTrack.h.

# finished

bool SoundTrack::finished
protected

If true, the playback is complete.

Definition at line 304 of file SoundTrack.h.

# nextElapsedTicksTarget

fix7_9_ext SoundTrack::nextElapsedTicksTarget
protected

Next ticks target.

Definition at line 301 of file SoundTrack.h.

# samples

uint32 SoundTrack::samples
protected

Channel's effective length.

Definition at line 265 of file SoundTrack.h.

# soundTrackSpec

const SoundTrackSpec* SoundTrack::soundTrackSpec
protected

Pointer to the spec that defines how to initialize the soundtrack.

Definition at line 262 of file SoundTrack.h.

# ticks

uint32 SoundTrack::ticks
protected

Total number of ticks.

Definition at line 295 of file SoundTrack.h.


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