#include <sound.h>
Classes | |
struct | SoundChannel |
Public Types | |
enum | kType { kAdLib, kMidiMT32, kMidiGM, kTowns, kPC98, kPCSpkr, kPCjr, kAmiga, kSegaCD, kMac } |
Public Member Functions | |
Sound (KyraEngine_v1 *vm, Audio::Mixer *mixer) | |
virtual kType | getMusicType () const =0 |
virtual kType | getSfxType () const |
virtual bool | useDigitalSfx () const |
virtual bool | init ()=0 |
virtual void | process () |
virtual void | updateVolumeSettings () |
virtual void | initAudioResourceInfo (int set, void *info)=0 |
virtual void | selectAudioResourceSet (int set)=0 |
virtual bool | hasSoundFile (uint file) const =0 |
virtual void | loadSoundFile (uint file)=0 |
virtual void | loadSoundFile (const Common::Path &file)=0 |
virtual void | unloadSoundFile (const Common::String &file) |
virtual void | loadSfxFile (const Common::Path &file) |
virtual void | playTrack (uint8 track)=0 |
virtual void | haltTrack ()=0 |
virtual void | playSoundEffect (uint16 track, uint8 volume=0xFF)=0 |
virtual void | stopAllSoundEffects () |
virtual bool | isPlaying () const |
virtual void | beginFadeOut ()=0 |
virtual void | beginFadeOut (int) |
virtual void | pause (bool paused) |
virtual void | enableMusic (int enable) |
int | musicEnabled () const |
void | enableSFX (bool enable) |
bool | sfxEnabled () const |
bool | isVoicePresent (const char *file) const |
virtual int32 | voicePlay (const char *file, Audio::SoundHandle *handle=0, uint8 volume=255, uint8 priority=255, bool isSfx=false) |
Audio::SeekableAudioStream * | getVoiceStream (const char *file) const |
bool | playVoiceStream (Audio::AudioStream *stream, Audio::SoundHandle *handle=0, uint8 volume=255, uint8 priority=255, bool isSfx=false) |
bool | voiceIsPlaying (const Audio::SoundHandle *handle=0) const |
bool | allVoiceChannelsPlaying () const |
uint32 | voicePlayedTime (const Audio::SoundHandle &handle) const |
void | voiceStop (const Audio::SoundHandle *handle=0) |
virtual int | checkTrigger () |
virtual void | resetTrigger () |
Protected Types | |
enum | { kNumChannelHandles = 4 } |
Protected Attributes | |
SoundChannel | _soundChannels [kNumChannelHandles] |
int | _musicEnabled |
bool | _sfxEnabled |
KyraEngine_v1 * | _vm |
Audio::Mixer * | _mixer |
Analog audio output device API for Kyrandia games. It contains functionality to play music tracks, sound effects and voices.
|
pure virtual |
Initializes the output device.
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
inlinevirtual |
Updates the device, this is needed for some devices.
Reimplemented in Kyra::MixedSoundDriver, Kyra::SoundTownsPC98_v2, Kyra::SoundTowns_LoK, and Kyra::SoundPC_v1.
|
inlinevirtual |
Updates internal volume settings according to ConfigManager.
Reimplemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Assigns static resource data with information on how to load audio resources to
set | value defined in AudioResourceSet enum info various types of resource info data (file list, file name pattern, struct, etc. - depending on the inheriting driver type) |
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Select audio resource set.
set | value defined in AudioResourceSet enum |
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Checks if a given sound file is present.
track | track number |
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Load a specifc sound file for use of playing music and sound effects.
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Load a sound file for playing music (and sometimes sound effects) from.
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
inlinevirtual |
Unload a specifc sound file that has been loaded before.
|
inlinevirtual |
Load a sound file for playing sound effects from.
Reimplemented in Kyra::MixedSoundDriver, and Kyra::SoundMidiPC.
|
pure virtual |
Plays the specified track.
track | track number |
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Stop playback of the current track.
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Plays the specified sound effect.
track | sound effect id |
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
inlinevirtual |
Stop playback of all sfx tracks.
Reimplemented in Kyra::MixedSoundDriver, Kyra::SoundTowns_LoK, and Kyra::SoundMidiPC.
|
virtual |
Checks if the sound driver plays any sound.
Reimplemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
pure virtual |
Starts fading out the volume.
This keeps fading out the output until it is silenced, but does not change the volume set by setVolume! It will automatically reset the volume when playing a new track or sound effect.
Implemented in Kyra::SoundMac, Kyra::MixedSoundDriver, Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, Kyra::SoundPC98_LoK, Kyra::SoundTowns_LoK, Kyra::SoundMidiPC, and Kyra::SoundPC_v1.
|
inlinevirtual |
Stops all audio playback when paused. Continues after end of pause.
Reimplemented in Kyra::MixedSoundDriver, and Kyra::SoundMidiPC.
bool Kyra::Sound::isVoicePresent | ( | const char * | file | ) | const |
Checks whether a voice file with the given name is present
file | file name |
|
virtual |
Plays the specified voice file.
Also before starting to play the specified voice file, it stops the current voice.
file | file to be played |
volume | volume of the voice file |
isSfx | marks file as sfx instead of voice |
handle | store a copy of the sound handle |
Reimplemented in Kyra::SoundAmiga_LoK, Kyra::SoundTownsPC98_v2, and Kyra::SoundPC98_LoK.
bool Kyra::Sound::voiceIsPlaying | ( | const Audio::SoundHandle * | handle = 0 | ) | const |
Checks if a voice is being played.
bool Kyra::Sound::allVoiceChannelsPlaying | ( | ) | const |
Checks if all voice handles are used.
|
inline |
Checks how long a voice has been playing
void Kyra::Sound::voiceStop | ( | const Audio::SoundHandle * | handle = 0 | ) |
Stops playback of the current voice.
|
inlinevirtual |
Receive notifications from a song at certain points.
Reimplemented in Kyra::SoundPC_v1.
|
inlinevirtual |
Reset sound trigger.
Reimplemented in Kyra::SoundPC_v1.