ScummVM API documentation
Scumm::MusicEngine Class Referenceabstract

#include <music.h>

Inheritance diagram for Scumm::MusicEngine:
Common::Serializable Scumm::IMuse Scumm::Player_AD Scumm::Player_AppleII Scumm::Player_HE Scumm::Player_NES Scumm::Player_SID Scumm::Player_Towns Scumm::Player_V2A Scumm::Player_V2Base Scumm::Player_V3A Scumm::Player_V4A

Public Member Functions

virtual void setMusicVolume (int vol)=0
 
virtual void setSfxVolume (int vol)
 
virtual void startSound (int sound)=0
 
virtual void startSoundWithTrackID (int sound, int track)
 
virtual void stopSound (int sound)=0
 
virtual void stopAllSounds ()=0
 
virtual int getSoundStatus (int sound) const =0
 
virtual int getMusicTimer ()
 
virtual void setQuality (int qual)
 
void saveLoadWithSerializer (Common::Serializer &ser) override
 
virtual void restoreAfterLoad ()
 

Detailed Description

Pure virtual base class for the various music/sound engines used in Scumm games. In particular, the iMuse code provides a subclass of this. There are several other subclasses providing music and sound capabilities for several Scumm games. Having this base class for all music engines allows uniform access to the core music/sound functionality, thus simplifying the client code.

Instantiated by class Scumm.

Member Function Documentation

◆ setMusicVolume()

virtual void Scumm::MusicEngine::setMusicVolume ( int  vol)
pure virtual

Set the output volume for music. Also used, if the inheriting class doesn't distinguish between music and sfx.

Parameters
volthe new output volume

Implemented in Scumm::IMuseInternal, Scumm::Player_AppleII, Scumm::Player_Towns_v2, Scumm::Player_Towns_v1, Scumm::Player_SID, Scumm::Player_NES, Scumm::Player_AD, Scumm::Player_V3A, Scumm::Player_V4A, Scumm::Player_V2A, Scumm::Player_V2, Scumm::Player_V2CMS, and Scumm::Player_HE.

◆ setSfxVolume()

virtual void Scumm::MusicEngine::setSfxVolume ( int  vol)
inlinevirtual

Set the output volume for sound effects. No need to implement this in the inheriting class if it doesn't distinguish between music and sfx.

Parameters
volthe new output volume

Reimplemented in Scumm::Player_Towns.

◆ startSound()

virtual void Scumm::MusicEngine::startSound ( int  sound)
pure virtual

◆ startSoundWithTrackID()

virtual void Scumm::MusicEngine::startSoundWithTrackID ( int  sound,
int  track 
)
inlinevirtual

Start playing the sound with the given id and track id.

Parameters
soundthe sound to start
trackthe track to start

Reimplemented in Scumm::Player_HE.

◆ stopSound()

virtual void Scumm::MusicEngine::stopSound ( int  sound)
pure virtual

◆ stopAllSounds()

◆ getSoundStatus()

virtual int Scumm::MusicEngine::getSoundStatus ( int  sound) const
pure virtual

Query the status of the sound with the given id. Usually this is just a boolean telling us whether the sound is playing or not.

Parameters
soundthe sound to for which we want the status
Returns
the status of the specified sound

Implemented in Scumm::IMuseInternal, Scumm::Player_AppleII, Scumm::Player_Towns_v2, Scumm::Player_Towns_v1, Scumm::Player_SID, Scumm::Player_NES, Scumm::Player_AD, Scumm::Player_V3A, Scumm::Player_V4A, Scumm::Player_V2A, Scumm::Player_V2, Scumm::Player_V2CMS, Scumm::Player_HE, and Scumm::Player_Towns.

◆ getMusicTimer()

virtual int Scumm::MusicEngine::getMusicTimer ( )
inlinevirtual

Get the value of the music timer. Used for synchronising scripts with the music/sound.

Returns
the music timer

Reimplemented in Scumm::IMuseInternal, Scumm::Player_AppleII, Scumm::Player_V2Base, Scumm::Player_SID, Scumm::Player_AD, Scumm::Player_V3A, Scumm::Player_V4A, Scumm::Player_V2A, Scumm::Player_V2CMS, Scumm::Player_HE, and Scumm::Player_V1.

◆ setQuality()

virtual void Scumm::MusicEngine::setQuality ( int  qual)
inlinevirtual

Set sound quality if applicable (used for Macintosh sound)

Parameters
qualquality setting (range and meaning are specific to the respective player)

◆ saveLoadWithSerializer()

void Scumm::MusicEngine::saveLoadWithSerializer ( Common::Serializer ser)
inlineoverridevirtual

◆ restoreAfterLoad()

virtual void Scumm::MusicEngine::restoreAfterLoad ( )
inlinevirtual

Performs necessary post-load operations on the sound engine, like restarting of music tracks or looping pcm sounds. Some targets get this done via scripts but others don't. Currently, this is used for FM-Towns and Mac.

Reimplemented in Scumm::Player_Towns_v1, Scumm::Player_V4A, and Scumm::Player_Towns.


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