ScummVM API documentation
Scumm::IMuseInternal Class Reference

#include <imuse_internal.h>

Inheritance diagram for Scumm::IMuseInternal:
Scumm::IMuse Scumm::MusicEngine Common::Serializable

Classes

struct  RhyState
 

Public Member Functions

void pause (bool paused) override
 
void saveLoadIMuse (Common::Serializer &ser, ScummEngine *scumm, bool fixAfterLoad=true) override
 
bool get_sound_active (int sound) const override
 
int32 doCommand (int numargs, int args[]) override
 
uint32 property (int prop, uint32 value) override
 
void addSysexHandler (byte mfgID, sysexfunc handler) override
 
void startSoundWithNoteOffset (int sound, int offset) override
 
void setMusicVolume (int vol) override
 
void setSfxVolume (int vol) override
 
void startSound (int sound) override
 
void stopSound (int sound) override
 
void stopAllSounds () override
 
int getSoundStatus (int sound) const override
 
int getMusicTimer () override
 
- Public Member Functions inherited from Scumm::IMuse
void setQuality (int qual) override
 
- Public Member Functions inherited from Scumm::MusicEngine
virtual void startSoundWithTrackID (int sound, int track)
 
virtual void toggleMusic (bool enable)
 
virtual void toggleSoundEffects (bool enable)
 
void saveLoadWithSerializer (Common::Serializer &ser) override
 
virtual void restoreAfterLoad ()
 

Static Public Member Functions

static IMuseInternalcreate (ScummEngine *vm, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver, MidiDriverFlags sndType, bool nativeMT32)
 
- Static Public Member Functions inherited from Scumm::IMuse
static IMusecreate (ScummEngine *vm, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver, MidiDriverFlags sndType, bool nativeMT32)
 

Protected Types

enum  ChunkType { kMThd = 1, kFORM = 2, kMDhd = 4, kMDpg = 8 }
 

Protected Member Functions

 IMuseInternal (ScummEngine *vm, MidiDriverFlags sndType, bool nativeMT32)
 
int initialize (OSystem *syst, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver)
 
void on_timer (MidiDriver *midi) override
 
byte * findStartOfSound (int sound, int ct=(kMThd|kFORM))
 
bool isMT32 (int sound)
 
bool isMIDI (int sound)
 
bool supportsPercussion (int sound)
 
int get_queue_sound_status (int sound) const
 
void handle_marker (uint id, byte data)
 
int get_channel_volume (uint a)
 
void initMidiDriver (TimerCallbackInfo *info)
 
void init_players ()
 
void init_parts ()
 
void init_queue ()
 
void sequencer_timers (MidiDriver *midi)
 
MidiDrivergetBestMidiDriver (int sound)
 
Playerallocate_player (byte priority)
 
Partallocate_part (byte pri, MidiDriver *midi)
 
int32 ImSetTrigger (int sound, int id, int a, int b, int c, int d, int e, int f, int g, int h)
 
int32 ImClearTrigger (int sound, int id)
 
int32 ImFireAllTriggers (int sound)
 
void addDeferredCommand (int time, int a, int b, int c, int d, int e, int f)
 
void handleDeferredCommands (MidiDriver *midi)
 
int enqueue_command (int a, int b, int c, int d, int e, int f, int g)
 
int enqueue_trigger (int sound, int marker)
 
int clear_queue () override
 
int query_queue (int param)
 
PlayerfindActivePlayer (int id)
 
int get_volchan_entry (uint a)
 
int set_volchan_entry (uint a, uint b)
 
int set_channel_volume (uint chan, uint vol)
 
void update_volumes ()
 
void musicVolumeReduction (MidiDriver *midi)
 
int set_volchan (int sound, int volchan)
 
void fix_parts_after_load ()
 
void fix_players_after_load (ScummEngine *scumm)
 
int setImuseMasterVolume (uint vol)
 
MidiChannelallocateChannel (MidiDriver *midi, byte prio)
 
bool reassignChannelAndResumePart (MidiChannel *mc)
 
void suspendPart (Part *part)
 
void removeSuspendedPart (Part *part)
 
void reallocateMidiChannels (MidiDriver *midi)
 
void setGlobalInstrument (byte slot, byte *data)
 
void copyGlobalInstrument (byte slot, Instrument *dest)
 
bool isNativeMT32 ()
 
bool startSound_internal (int sound, int offset=0)
 
int stopSound_internal (int sound)
 
int stopAllSounds_internal ()
 
int getSoundStatus_internal (int sound, bool ignoreFadeouts) const
 
int32 doCommand_internal (int a, int b, int c, int d, int e, int f, int g, int h)
 
int32 doCommand_internal (int numargs, int args[])
 

Static Protected Member Functions

static void midiTimerCallback (void *data)
 

Protected Attributes

ScummEngine_vm
 
const bool _native_mt32
 
const bool _newSystem
 
const bool _dynamicChanAllocation
 
const MidiDriverFlags _soundType
 
MidiDriver_midi_adlib
 
MidiDriver_midi_native
 
TimerCallbackInfo _timer_info_adlib
 
TimerCallbackInfo _timer_info_native
 
const uint32 _game_id
 
sysexfunc _sysex
 
Common::Mutex_mutex
 
Common::Mutex _dummyMutex
 
bool _paused
 
bool _initialized
 
int _tempoFactor
 
int _player_limit
 
bool _recycle_players
 
int _musicVolumeReductionTimer = 0
 
uint _queue_end
 
uint _queue_pos
 
uint _queue_sound
 
byte _queue_adding
 
byte _queue_marker
 
byte _queue_cleared
 
byte _master_volume
 
byte _music_volume
 
byte _music_volume_eff
 
uint16 _trigger_count
 
ImTrigger _snm_triggers [16]
 
uint16 _snm_trigger_index
 
uint16 _channel_volume [8]
 
uint16 _channel_volume_eff [8]
 
uint16 _volchan_table [8]
 
Player _players [8]
 
Part _parts [32]
 
Instrument _global_instruments [32]
 
CommandQueue _cmd_queue [64]
 
DeferredCommand _deferredCommands [4]
 
struct Scumm::IMuseInternal::RhyState _rhyState
 
Common::Array< Part * > _waitingPartsQueue
 
const bool _lowLevelVolumeControl
 

Additional Inherited Members

- Public Types inherited from Scumm::IMuse
enum  {
  PROP_TEMPO_BASE, PROP_LIMIT_PLAYERS, PROP_RECYCLE_PLAYERS, PROP_QUALITY,
  PROP_MUSICVOLUME, PROP_SFXVOLUME
}
 

Detailed Description

SCUMM implementation of IMuse. This class implements the IMuse mixin interface for the SCUMM environment.

Member Function Documentation

◆ setMusicVolume()

void Scumm::IMuseInternal::setMusicVolume ( int  vol)
overridevirtual

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

Parameters
volthe new output volume

Implements Scumm::MusicEngine.

◆ setSfxVolume()

void Scumm::IMuseInternal::setSfxVolume ( int  vol)
overridevirtual

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 from Scumm::MusicEngine.

◆ startSound()

void Scumm::IMuseInternal::startSound ( int  sound)
overridevirtual

Start playing the sound with the given id.

Parameters
soundthe sound to start

Implements Scumm::MusicEngine.

◆ stopSound()

void Scumm::IMuseInternal::stopSound ( int  sound)
overridevirtual

Stop playing the sound with the given id.

Parameters
soundthe sound to stop

Implements Scumm::MusicEngine.

◆ stopAllSounds()

void Scumm::IMuseInternal::stopAllSounds ( )
overridevirtual

Start playing all currently playing sounds.

Implements Scumm::MusicEngine.

◆ getSoundStatus()

int Scumm::IMuseInternal::getSoundStatus ( int  sound) const
overridevirtual

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

Implements Scumm::MusicEngine.

◆ getMusicTimer()

int Scumm::IMuseInternal::getMusicTimer ( )
overridevirtual

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

Returns
the music timer

Reimplemented from Scumm::MusicEngine.


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