libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
OgcAudioDriver Class Reference

GC/Wii AudioDriver: AESND-based fixed voices for one-shots, wraps a GuiSoundOggPlayer for the background stream. More...

#include <OgcAudioDriver.h>

Inheritance diagram for OgcAudioDriver:
[legend]

Public Member Functions

void init () override
 Allocates the backend's audio resources. Does not start playback; see start().
 
void shutdown () override
 Releases everything init() allocated. Call stop() first.
 
void start () override
 Starts the audio backend running (eg. registers the DSP/AX callback).
 
void stop () override
 Stops the audio backend.
 
int32_t playVoice (const uint8_t *data, int32_t length, int volume) override
 Start a one-shot/short PCM voice.
 
void stopVoice (int32_t voice) override
 Stops a voice returned by playVoice() and frees its slot.
 
void pauseVoice (int32_t voice) override
 Pauses a playing voice, keeping its position and slot.
 
void resumeVoice (int32_t voice) override
 Resumes a voice paused with pauseVoice().
 
bool isVoicePlaying (int32_t voice) override
 
void setVoiceVolume (int32_t voice, int volume) override
 Changes the volume of a playing voice.
 
void playStream (const uint8_t *data, int32_t length, bool loop, int volume) override
 Streamed (OGG) playback.
 
void stopStream () override
 Stops the stream started by playStream().
 
void pauseStream () override
 Pauses the stream, keeping its position.
 
void resumeStream () override
 Resumes a stream paused with pauseStream().
 
bool isStreamPlaying () override
 
void setStreamVolume (int volume) override
 Changes the stream volume.
 
void handleStreamCallback (int voice)
 AESND callback hook, called from interrupt context to refill the stream voice.
 

Detailed Description

GC/Wii AudioDriver: AESND-based fixed voices for one-shots, wraps a GuiSoundOggPlayer for the background stream.

Definition at line 15 of file OgcAudioDriver.h.

Member Function Documentation

◆ handleStreamCallback()

void OgcAudioDriver::handleStreamCallback ( int voice)

AESND callback hook, called from interrupt context to refill the stream voice.

Not part of the AudioDriver interface.

Definition at line 19 of file OgcAudioDriver.cpp.

◆ init()

void OgcAudioDriver::init ( )
overridevirtual

Allocates the backend's audio resources. Does not start playback; see start().

Implements AudioDriver.

Definition at line 33 of file OgcAudioDriver.cpp.

◆ isStreamPlaying()

bool OgcAudioDriver::isStreamPlaying ( )
overridevirtual
Returns
true while the stream is playing.

Implements AudioDriver.

Definition at line 126 of file OgcAudioDriver.cpp.

◆ isVoicePlaying()

bool OgcAudioDriver::isVoicePlaying ( int32_t voice)
overridevirtual
Returns
true while the voice is still playing (false once it has finished or been stopped).

Implements AudioDriver.

Definition at line 82 of file OgcAudioDriver.cpp.

◆ pauseStream()

void OgcAudioDriver::pauseStream ( )
overridevirtual

Pauses the stream, keeping its position.

Implements AudioDriver.

Definition at line 116 of file OgcAudioDriver.cpp.

◆ pauseVoice()

void OgcAudioDriver::pauseVoice ( int32_t voice)
overridevirtual

Pauses a playing voice, keeping its position and slot.

Implements AudioDriver.

Definition at line 75 of file OgcAudioDriver.cpp.

◆ playStream()

void OgcAudioDriver::playStream ( const uint8_t * data,
int32_t length,
bool loop,
int volume )
overridevirtual

Streamed (OGG) playback.

There is no per-call stream handle, only one can play at a time.

Implements AudioDriver.

Definition at line 90 of file OgcAudioDriver.cpp.

◆ playVoice()

int32_t OgcAudioDriver::playVoice ( const uint8_t * data,
int32_t length,
int volume )
overridevirtual

Start a one-shot/short PCM voice.

Returns a backend-defined voice handle (>=0) on success, or a negative value if no voice was available.

Implements AudioDriver.

Definition at line 65 of file OgcAudioDriver.cpp.

◆ resumeStream()

void OgcAudioDriver::resumeStream ( )
overridevirtual

Resumes a stream paused with pauseStream().

Implements AudioDriver.

Definition at line 121 of file OgcAudioDriver.cpp.

◆ resumeVoice()

void OgcAudioDriver::resumeVoice ( int32_t voice)
overridevirtual

Resumes a voice paused with pauseVoice().

Implements AudioDriver.

Definition at line 78 of file OgcAudioDriver.cpp.

◆ setStreamVolume()

void OgcAudioDriver::setStreamVolume ( int volume)
overridevirtual

Changes the stream volume.

Parameters
volumeVolume, 0-100

Implements AudioDriver.

Definition at line 130 of file OgcAudioDriver.cpp.

◆ setVoiceVolume()

void OgcAudioDriver::setVoiceVolume ( int32_t voice,
int volume )
overridevirtual

Changes the volume of a playing voice.

Parameters
voiceVoice handle returned by playVoice()
volumeVolume, 0-100

Implements AudioDriver.

Definition at line 86 of file OgcAudioDriver.cpp.

◆ shutdown()

void OgcAudioDriver::shutdown ( )
overridevirtual

Releases everything init() allocated. Call stop() first.

Implements AudioDriver.

Definition at line 53 of file OgcAudioDriver.cpp.

◆ start()

void OgcAudioDriver::start ( )
overridevirtual

Starts the audio backend running (eg. registers the DSP/AX callback).

Implements AudioDriver.

Definition at line 39 of file OgcAudioDriver.cpp.

◆ stop()

void OgcAudioDriver::stop ( )
overridevirtual

Stops the audio backend.

Implements AudioDriver.

Definition at line 45 of file OgcAudioDriver.cpp.

◆ stopStream()

void OgcAudioDriver::stopStream ( )
overridevirtual

Stops the stream started by playStream().

Implements AudioDriver.

Definition at line 111 of file OgcAudioDriver.cpp.

◆ stopVoice()

void OgcAudioDriver::stopVoice ( int32_t voice)
overridevirtual

Stops a voice returned by playVoice() and frees its slot.

Implements AudioDriver.

Definition at line 72 of file OgcAudioDriver.cpp.


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