ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A sound resource. More...

#include <sound.h>

Inheritance diagram for Stark::Resources::Sound:
Collaboration diagram for Stark::Resources::Sound:

List of all members.

Public Types

enum  SubType { kSoundSub3 = 3, kSoundStock = 5 }
enum  SoundType { kSoundTypeVoice = 0, kSoundTypeEffect = 1, kSoundTypeMusic = 2 }

Public Member Functions

 Sound (Object *parent, byte subType, uint16 index, const Common::String &name)
virtual ~Sound ()
void readData (Formats::XRCReadStream *stream) override
 Deserialize the resource static data and initial state.
void onPreDestroy () override
 Called before a resource sub-tree is unloaded.
void onGameLoop () override
 Called once per game loop.
void saveLoadCurrent (ResourceSerializer *serializer) override
 Persist / restore the resource state.
void onEnginePause (bool pause) override
 Called when ResidualVM pauses or resumes the engine.
void play ()
 Start playing the sound.
bool isPlaying ()
 Is the sound playing.
void stop ()
 Stop the sound.
uint32 getStockSoundType () const
 Get the type for stock sounds.
void changeVolumePan (int32 volume, int32 pan, int32 duration)
 Fade the sound's current volume and pan to the specified target over duration milliseconds.
void setLooping (bool looping)
 Set whether to loop or not.
void setStopOnDestroy (bool stopOnDestroy)
 In the menus, we don't want sounds to be cut when changing screens.

Static Public Attributes

static const Type::ResourceType TYPE = Type::kSoundItem

Protected Member Functions

void printData () override
Audio::RewindableAudioStreammakeAudioStream ()
Audio::Mixer::SoundType getMixerSoundType ()

Protected Attributes

Common::String _filename
Common::String _archiveName
uint32 _enabled
bool _looping
uint32 _field_64
bool _loopIndefinitely
uint32 _maxDuration
bool _loadFromFile
uint32 _stockSoundType
Common::String _soundName
uint32 _field_6C
uint32 _soundType
float _pan
float _volume
bool _shouldStopOnDestroy
int32 _fadeDurationRemaining
float _fadeTargetVolume
float _fadeTargetPan
Audio::SoundHandle _handle

Detailed Description

A sound resource.

Definition at line 47 of file stark/resources/sound.h.


Member Enumeration Documentation

Enumerator:
kSoundTypeVoice 
kSoundTypeEffect 
kSoundTypeMusic 

Definition at line 56 of file stark/resources/sound.h.

Enumerator:
kSoundSub3 
kSoundStock 

Definition at line 51 of file stark/resources/sound.h.


Constructor & Destructor Documentation

Stark::Resources::Sound::Sound ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
)

Definition at line 42 of file stark/resources/sound.cpp.

Stark::Resources::Sound::~Sound (  )  [virtual]

Definition at line 39 of file stark/resources/sound.cpp.


Member Function Documentation

void Stark::Resources::Sound::changeVolumePan ( int32  volume,
int32  pan,
int32  duration 
)

Fade the sound's current volume and pan to the specified target over duration milliseconds.

Definition at line 216 of file stark/resources/sound.cpp.

Audio::Mixer::SoundType Stark::Resources::Sound::getMixerSoundType (  )  [protected]

Definition at line 102 of file stark/resources/sound.cpp.

uint32 Stark::Resources::Sound::getStockSoundType (  )  const

Get the type for stock sounds.

Definition at line 212 of file stark/resources/sound.cpp.

bool Stark::Resources::Sound::isPlaying (  ) 

Is the sound playing.

Definition at line 133 of file stark/resources/sound.cpp.

Audio::RewindableAudioStream * Stark::Resources::Sound::makeAudioStream (  )  [protected]

Definition at line 62 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::onEnginePause ( bool  pause  )  [override, virtual]

Called when ResidualVM pauses or resumes the engine.

Reimplemented from Stark::Resources::Object.

Definition at line 258 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::onGameLoop (  )  [override, virtual]

Called once per game loop.

Reimplemented from Stark::Resources::Object.

Definition at line 183 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::onPreDestroy (  )  [override, virtual]

Called before a resource sub-tree is unloaded.

Reimplemented from Stark::Resources::Object.

Definition at line 142 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::play (  ) 

Start playing the sound.

Definition at line 115 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::printData (  )  [override, protected, virtual]

Reimplemented from Stark::Resources::Object.

Definition at line 167 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::readData ( Formats::XRCReadStream stream  )  [override, virtual]

Deserialize the resource static data and initial state.

Reimplemented from Stark::Resources::Object.

Definition at line 150 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::saveLoadCurrent ( ResourceSerializer serializer  )  [override, virtual]

Persist / restore the resource state.

Called only for active locations

Reimplemented from Stark::Resources::Object.

Definition at line 238 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::setLooping ( bool  looping  )  [inline]

Set whether to loop or not.

Definition at line 88 of file stark/resources/sound.h.

void Stark::Resources::Sound::setStopOnDestroy ( bool  stopOnDestroy  ) 

In the menus, we don't want sounds to be cut when changing screens.

The actual sounds need to outlive the entity. This flag allows to do so.

Definition at line 262 of file stark/resources/sound.cpp.

void Stark::Resources::Sound::stop (  ) 

Stop the sound.

Definition at line 137 of file stark/resources/sound.cpp.


Member Data Documentation

Definition at line 104 of file stark/resources/sound.h.

Definition at line 120 of file stark/resources/sound.h.

Definition at line 119 of file stark/resources/sound.h.

Definition at line 106 of file stark/resources/sound.h.

Definition at line 112 of file stark/resources/sound.h.

Definition at line 109 of file stark/resources/sound.h.

Definition at line 107 of file stark/resources/sound.h.

Definition at line 105 of file stark/resources/sound.h.

float Stark::Resources::Sound::_pan [protected]

Definition at line 114 of file stark/resources/sound.h.

Definition at line 116 of file stark/resources/sound.h.

Definition at line 113 of file stark/resources/sound.h.

Definition at line 115 of file stark/resources/sound.h.

const Type::ResourceType Stark::Resources::Sound::TYPE = Type::kSoundItem [static]

Definition at line 49 of file stark/resources/sound.h.


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


Generated on Sat Jan 19 2019 05:07:58 for ResidualVM by doxygen 1.7.1
curved edge   curved edge