ScummVM API documentation
Kyra::SoundPC_v1 Class Reference

#include <sound_pc_v1.h>

Inheritance diagram for Kyra::SoundPC_v1:
Kyra::Sound

Public Member Functions

 SoundPC_v1 (KyraEngine_v1 *vm, Audio::Mixer *mixer, kType type)
 
kType getMusicType () const override
 
bool init () override
 
void process () override
 
void updateVolumeSettings () override
 
void initAudioResourceInfo (int set, void *info) override
 
void selectAudioResourceSet (int set) override
 
bool hasSoundFile (uint file) const override
 
void loadSoundFile (uint file) override
 
void loadSoundFile (const Common::Path &file) override
 
void playTrack (uint8 track) override
 
void haltTrack () override
 
bool isPlaying () const override
 
void playSoundEffect (uint16 track, uint8 volume=0xFF) override
 
void beginFadeOut () override
 
int checkTrigger () override
 
void resetTrigger () override
 
- Public Member Functions inherited from Kyra::Sound
 Sound (KyraEngine_v1 *vm, Audio::Mixer *mixer)
 
virtual kType getSfxType () const
 
virtual bool useDigitalSfx () const
 
virtual void unloadSoundFile (const Common::String &file)
 
virtual void loadSfxFile (const Common::Path &file)
 
virtual void stopAllSoundEffects ()
 
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::SeekableAudioStreamgetVoiceStream (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)
 

Additional Inherited Members

- Public Types inherited from Kyra::Sound
enum  kType {
  kAdLib, kMidiMT32, kMidiGM, kTowns,
  kPC98, kPCSpkr, kPCjr, kAmiga,
  kSegaCD, kMac
}
 
- Protected Types inherited from Kyra::Sound
enum  { kNumChannelHandles = 4 }
 
- Protected Attributes inherited from Kyra::Sound
SoundChannel _soundChannels [kNumChannelHandles]
 
int _musicEnabled
 
bool _sfxEnabled
 
KyraEngine_v1_vm
 
Audio::Mixer_mixer
 

Detailed Description

AdLib/PC Speaker (early version) implementation of the sound output device.

It uses a special sound file format special to EoB I, II, Dune II, Kyrandia 1 and 2 and LoL. EoB I has a slightly different (oldest) file format, EoB II, Dune II and Kyrandia 1 have the exact same format, Kyrandia 2 and LoL have a slightly different format.

For PC Speaker this is a little different. Only the EoB games use the old driver with this data file format. The newer games use a MIDI-like driver (see pcspeaker_v2.cpp).

See AdLibDriver / PCSpeakerDriver for more information.

See also
AdLibDriver

Member Function Documentation

◆ init()

bool Kyra::SoundPC_v1::init ( )
overridevirtual

Initializes the output device.

Returns
true on success, else false

Implements Kyra::Sound.

◆ process()

void Kyra::SoundPC_v1::process ( )
overridevirtual

Updates the device, this is needed for some devices.

Reimplemented from Kyra::Sound.

◆ updateVolumeSettings()

void Kyra::SoundPC_v1::updateVolumeSettings ( )
overridevirtual

Updates internal volume settings according to ConfigManager.

Reimplemented from Kyra::Sound.

◆ initAudioResourceInfo()

void Kyra::SoundPC_v1::initAudioResourceInfo ( int  set,
void *  info 
)
overridevirtual

Assigns static resource data with information on how to load audio resources to

Parameters
setvalue defined in AudioResourceSet enum info various types of resource info data (file list, file name pattern, struct, etc. - depending on the inheriting driver type)

Implements Kyra::Sound.

◆ selectAudioResourceSet()

void Kyra::SoundPC_v1::selectAudioResourceSet ( int  set)
overridevirtual

Select audio resource set.

Parameters
setvalue defined in AudioResourceSet enum

Implements Kyra::Sound.

◆ hasSoundFile()

bool Kyra::SoundPC_v1::hasSoundFile ( uint  file) const
overridevirtual

Checks if a given sound file is present.

Parameters
tracktrack number
Returns
true if available, false otherwise

Implements Kyra::Sound.

◆ loadSoundFile() [1/2]

void Kyra::SoundPC_v1::loadSoundFile ( uint  file)
overridevirtual

Load a specifc sound file for use of playing music and sound effects.

Implements Kyra::Sound.

◆ loadSoundFile() [2/2]

void Kyra::SoundPC_v1::loadSoundFile ( const Common::Path file)
overridevirtual

Load a sound file for playing music (and sometimes sound effects) from.

Implements Kyra::Sound.

◆ playTrack()

void Kyra::SoundPC_v1::playTrack ( uint8  track)
overridevirtual

Plays the specified track.

Parameters
tracktrack number

Implements Kyra::Sound.

◆ haltTrack()

void Kyra::SoundPC_v1::haltTrack ( )
overridevirtual

Stop playback of the current track.

Implements Kyra::Sound.

◆ isPlaying()

bool Kyra::SoundPC_v1::isPlaying ( ) const
overridevirtual

Checks if the sound driver plays any sound.

Returns
true if playing, false otherwise

Reimplemented from Kyra::Sound.

◆ playSoundEffect()

void Kyra::SoundPC_v1::playSoundEffect ( uint16  track,
uint8  volume = 0xFF 
)
overridevirtual

Plays the specified sound effect.

Parameters
tracksound effect id

Implements Kyra::Sound.

◆ beginFadeOut()

void Kyra::SoundPC_v1::beginFadeOut ( )
overridevirtual

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.

Implements Kyra::Sound.

◆ checkTrigger()

int Kyra::SoundPC_v1::checkTrigger ( )
overridevirtual

Receive notifications from a song at certain points.

Reimplemented from Kyra::Sound.

◆ resetTrigger()

void Kyra::SoundPC_v1::resetTrigger ( )
overridevirtual

Reset sound trigger.

Reimplemented from Kyra::Sound.


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