Kyra::SoundDigital Class Reference

Digital audio output device. More...

#include <sound_digital.h>

Collaboration diagram for Kyra::SoundDigital:


struct  AudioCodecs
struct  Sound

Public Member Functions

 SoundDigital (KyraEngine_MR *vm, Audio::Mixer *mixer)
 ~SoundDigital ()
int playSound (const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume=255, bool loop=false, int channel=-1)
 Plays a sound. More...
bool isPlaying (int channel)
 Checks if a given channel is playing a sound. More...
void stopSound (int channel)
 Stop the playback of a sound in the given channel. More...
void stopAllSounds ()
 Stops playback of all sounds. More...
void beginFadeOut (int channel, int ticks)
 Makes the sound in a given channel fading out. More...

Private Attributes

struct Kyra::SoundDigital::Sound _sounds [4]

Static Private Attributes

static const AudioCodecs _supportedCodecs []

Detailed Description

Digital audio output device.

This is just used for Kyrandia 3.

Definition at line 47 of file sound_digital.h.

Constructor & Destructor Documentation

◆ SoundDigital()

Kyra::SoundDigital::SoundDigital ( KyraEngine_MR vm,
Audio::Mixer mixer 

Definition at line 394 of file sound_digital.cpp.

◆ ~SoundDigital()

Kyra::SoundDigital::~SoundDigital ( )

Definition at line 399 of file sound_digital.cpp.

Member Function Documentation

◆ beginFadeOut()

void Kyra::SoundDigital::beginFadeOut ( int  channel,
int  ticks 

Makes the sound in a given channel fading out.

channelchannel number
ticksfadeout time

Definition at line 514 of file sound_digital.cpp.

◆ isPlaying()

bool Kyra::SoundDigital::isPlaying ( int  channel)

Checks if a given channel is playing a sound.

channelchannel number to check
true if playing, else false

Definition at line 486 of file sound_digital.cpp.

◆ playSound()

int Kyra::SoundDigital::playSound ( const char *  filename,
uint8  priority,
Audio::Mixer::SoundType  type,
int  volume = 255,
bool  loop = false,
int  channel = -1 

Plays a sound.

filenamefile to be played
prioritypriority of the sound
volumechannel volume
looptrue if the sound should loop (endlessly)
channeltell the sound player to use a specific channel for playback
channel playing the sound

Definition at line 404 of file sound_digital.cpp.

◆ stopAllSounds()

void Kyra::SoundDigital::stopAllSounds ( )

Stops playback of all sounds.

Definition at line 507 of file sound_digital.cpp.

◆ stopSound()

void Kyra::SoundDigital::stopSound ( int  channel)

Stop the playback of a sound in the given channel.

channelchannel number

Definition at line 498 of file sound_digital.cpp.

Member Data Documentation

◆ _mixer

Audio::Mixer* Kyra::SoundDigital::_mixer

Definition at line 97 of file sound_digital.h.

◆ _sounds

struct Kyra::SoundDigital::Sound Kyra::SoundDigital::_sounds[4]

◆ _supportedCodecs

const SoundDigital::AudioCodecs Kyra::SoundDigital::_supportedCodecs
Initial value:
= {
{ ".FLA", Audio::makeFLACStream },
{ ".MP3", Audio::makeMP3Stream },
{ ".AUD", makeAUDStream },
{ 0, 0 }

Definition at line 114 of file sound_digital.h.

◆ _vm

KyraEngine_MR* Kyra::SoundDigital::_vm

Definition at line 96 of file sound_digital.h.

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