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

Stream of sound data read from a file and handed to the sound output a run at a time. More...

#include <streamplayer.h>

Public Member Functions

 StreamPlayer (int nChannel, const char *pszFile, bool bAudio)
 Open a stream file, or SoundFX/default.str when the file does not open.
 ~StreamPlayer ()
 Close the stream file.
void Poll ()
 Pass the next run of the file to the sound output, and end the stream once the file ends.
bool IsFinished ()
 Report whether the file ended and the end of the stream was sent.
void SetPlaying (bool bPlaying)
 Set whether the stream plays.
bool IsPlaying () const
 Report whether the stream plays.
int GetChannel () const
FileStreamBuffer * GetBuffer () const

Detailed Description

Stream of sound data read from a file and handed to the sound output a run at a time.

The class is not polymorphic and has no RTTI. The name is inferred. The object is 0x18 bytes. Synth::SetStream() gives the output the stream to play, and the output polls it once a frame.

Constructor & Destructor Documentation

◆ StreamPlayer()

StreamPlayer::StreamPlayer ( int nChannel,
const char * pszFile,
bool bAudio )

Open a stream file, or SoundFX/default.str when the file does not open.

Parameters
nChannelThe value recorded first in the object. SongPreview passes 0.
pszFileThe stream file.
bAudioWhether the file is one of the audio streams, passed to the file opener.
Ghidra address:
NTSC-U/C: 0x00251a90
Ghidra address:
PAL: 0x0025a438

◆ ~StreamPlayer()

StreamPlayer::~StreamPlayer ( )

Close the stream file.

Ghidra address:
NTSC-U/C: 0x00251b58
Ghidra address:
PAL: 0x0025a500

Member Function Documentation

◆ Poll()

void StreamPlayer::Poll ( )

Pass the next run of the file to the sound output, and end the stream once the file ends.

The end is sent 40 milliseconds after the last run. A stream that does not play is unchanged. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00251bb8
Ghidra address:
PAL: 0x0025a560

◆ IsFinished()

bool StreamPlayer::IsFinished ( )

Report whether the file ended and the end of the stream was sent.

The name is inferred.

Returns
Whether the stream finished.
Ghidra address:
NTSC-U/C: 0x00251dc0
Ghidra address:
PAL: 0x0025a768

◆ SetPlaying()

void StreamPlayer::SetPlaying ( bool bPlaying)

Set whether the stream plays.

The stream clears the flag once it has finished.

Parameters
bPlayingWhether the stream plays.
Ghidra address:
NTSC-U/C: 0x00251e08
Ghidra address:
PAL: 0x0025a7b0

◆ IsPlaying()

bool StreamPlayer::IsPlaying ( ) const

Report whether the stream plays.

Returns
Whether the stream plays.
Ghidra address:
NTSC-U/C: 0x00251e10
Ghidra address:
PAL: 0x0025a7b8

◆ GetChannel()

int StreamPlayer::GetChannel ( ) const
inline
Returns
The value the constructor received first.

◆ GetBuffer()

FileStreamBuffer * StreamPlayer::GetBuffer ( ) const
inline
Returns
The reader of the stream file.

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