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

Task that plays one narration stream of a StreamQueue. More...

#include <streamtask.h>

Inheritance diagram for StreamTask:
Collaboration diagram for StreamTask:

Public Member Functions

 ~StreamTask () override=default
 Destroy the object.
 StreamTask (const char *pszName, const char *pszDirectory)
 Construct a task for a stream file.
void SetWaitingTask (Task *pTask)
 Set the task that learns when the stream is done.
void SetPaused (bool bPaused)
 Pause or resume the stream.
const char * GetName () const
StreamPlayer * GetPlayer () const
Public Member Functions inherited from Task
 Task ()
 Construct an idle task.
virtual ~Task ()
 Release the task.
int Poll ()
 Report the state after giving a running task one poll.
void Start ()
 Enter the running state and call OnStart(), unless the task is already running.
void Stop ()
 Call OnStop() when the task is running, and return to the idle state.
void Finish (bool bSucceeded)
 End the task from outside its poll, and call OnStop() when it was running.
int GetState () const
 Report mState.

Protected Member Functions

void OnStart () override
 Open the stream file and give it to the sound output to play.
void OnStop () override
 Stop the stream and release it.
void OnPoll () override
 Once the stream has ended, release it, finish the task, and report to the waiting task.

Additional Inherited Members

Public Types inherited from Task
enum  State { kStateIdle = 0 , kStateRunning = 1 , kStateDone = 2 , kStateFailed = 3 }
 Values of mState. More...

Detailed Description

Task that plays one narration stream of a StreamQueue.

The RTTI includes the class name and records Task as the base. The task is done once the stream has played to its end, and it then reports to the task waiting for the stream, if any.

Constructor & Destructor Documentation

◆ ~StreamTask()

StreamTask::~StreamTask ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x00344028
Ghidra address:
PAL: 0x003b1560

◆ StreamTask()

StreamTask::StreamTask ( const char * pszName,
const char * pszDirectory )

Construct a task for a stream file.

The task records the pointers and does not copy the text.

Parameters
pszNameThe stream name, the file name within the directory.
pszDirectoryThe directory the stream file is read from.
Ghidra address:
NTSC-U/C: 0x001416a0
Ghidra address:
PAL: 0x00143060

Member Function Documentation

◆ SetWaitingTask()

void StreamTask::SetWaitingTask ( Task * pTask)

Set the task that learns when the stream is done.

Parameters
pTaskThe waiting task.
Ghidra address:
NTSC-U/C: 0x001416c8
Ghidra address:
PAL: 0x00143088

◆ SetPaused()

void StreamTask::SetPaused ( bool bPaused)

Pause or resume the stream.

Parameters
bPausedPause the stream.
Ghidra address:
NTSC-U/C: 0x001417f0
Ghidra address:
PAL: 0x00143190

◆ GetName()

const char * StreamTask::GetName ( ) const
inline
Returns
The stream name.

◆ GetPlayer()

StreamPlayer * StreamTask::GetPlayer ( ) const
inline
Returns
The playing stream, or null.

◆ OnStart()

void StreamTask::OnStart ( )
overrideprotectedvirtual

Open the stream file and give it to the sound output to play.

Ghidra address:
NTSC-U/C: 0x001416d0
Ghidra address:
PAL: 0x00143090

Reimplemented from Task.

◆ OnStop()

void StreamTask::OnStop ( )
overrideprotectedvirtual

Stop the stream and release it.

Ghidra address:
NTSC-U/C: 0x00141780
Ghidra address:
PAL: 0x00143120

Reimplemented from Task.

◆ OnPoll()

void StreamTask::OnPoll ( )
overrideprotectedvirtual

Once the stream has ended, release it, finish the task, and report to the waiting task.

Ghidra address:
NTSC-U/C: 0x00141810
Ghidra address:
PAL: 0x001431b0

Reimplemented from Task.


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