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

Platform audio backend GuiSound delegates to: fixed one-shot PCM voices plus one background OGG stream. More...

#include <AudioDriver.h>

Inheritance diagram for AudioDriver:
[legend]

Public Member Functions

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

Detailed Description

Platform audio backend GuiSound delegates to: fixed one-shot PCM voices plus one background OGG stream.

Exactly one driver implements this and assigns the single global Platform instance.

Definition at line 17 of file AudioDriver.h.

Member Function Documentation

◆ init()

virtual void AudioDriver::init ( )
pure virtual

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

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ isStreamPlaying()

virtual bool AudioDriver::isStreamPlaying ( )
pure virtual
Returns
true while the stream is playing.

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ isVoicePlaying()

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

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ pauseStream()

virtual void AudioDriver::pauseStream ( )
pure virtual

Pauses the stream, keeping its position.

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ pauseVoice()

virtual void AudioDriver::pauseVoice ( int32_t voice)
pure virtual

Pauses a playing voice, keeping its position and slot.

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ playStream()

virtual void AudioDriver::playStream ( const uint8_t * data,
int32_t length,
bool loop,
int volume )
pure virtual

Streamed (OGG) playback.

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

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ playVoice()

virtual int32_t AudioDriver::playVoice ( const uint8_t * data,
int32_t length,
int volume )
pure virtual

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.

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ resumeStream()

virtual void AudioDriver::resumeStream ( )
pure virtual

Resumes a stream paused with pauseStream().

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ resumeVoice()

virtual void AudioDriver::resumeVoice ( int32_t voice)
pure virtual

Resumes a voice paused with pauseVoice().

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ setStreamVolume()

virtual void AudioDriver::setStreamVolume ( int volume)
pure virtual

Changes the stream volume.

Parameters
volumeVolume, 0-100

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ setVoiceVolume()

virtual void AudioDriver::setVoiceVolume ( int32_t voice,
int volume )
pure virtual

Changes the volume of a playing voice.

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

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ shutdown()

virtual void AudioDriver::shutdown ( )
pure virtual

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

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ start()

virtual void AudioDriver::start ( )
pure virtual

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

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ stop()

virtual void AudioDriver::stop ( )
pure virtual

Stops the audio backend.

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ stopStream()

virtual void AudioDriver::stopStream ( )
pure virtual

Stops the stream started by playStream().

Implemented in OgcAudioDriver, and WutAudioDriver.

◆ stopVoice()

virtual void AudioDriver::stopVoice ( int32_t voice)
pure virtual

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

Implemented in OgcAudioDriver, and WutAudioDriver.


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