22 #ifndef ULTIMA8_AUDIO_U8MUSICPROCESS_H 23 #define ULTIMA8_AUDIO_U8MUSICPROCESS_H 25 #include "ultima/ultima8/audio/music_process.h" 26 #include "ultima/ultima8/misc/classtype.h" 27 #include "audio/mididrv.h" 40 PLAYBACK_TRANSITION = 2,
41 PLAYBACK_PLAY_WANTED = 3
54 TrackState() : _wanted(0), _lastRequest(0), _queued(0) { }
55 TrackState(
int wanted,
int lastRequest,
int queued) :
62 void playMusic_internal(
int track)
override;
65 PlaybackStates _state;
67 int _songBranches[128];
77 bool _combatMusicActive;
84 ENABLE_RUNTIME_CLASSTYPE()
88 return _theMusicProcess;
void playCombatMusic(int track) override
Play some combat music - the last played track will be remembered.
void fadeMusic(uint16 length) override
Fades out the music over the specified time (in milliseconds)
int _queued
Track queued to start after current.
Definition: u8_music_process.h:52
static MusicProcess * get_instance()
Get the current instance of the Music Processes.
Definition: u8_music_process.h:87
The saveable part of track state.
Definition: u8_music_process.h:46
void restoreTrackState() override
Bring back the track state from before it was put on hold.
void restoreMusic() override
Restore the last requested non-combat track (eg, at the end of combat)
void pauseMusic() override
Pause the currently playing track.
Definition: detection.h:27
void playMusic(int track) override
Play some background music. Does not change the current track if combat music is active. If another track is currently queued, just queues this track for play.
void getTrackState(TrackState &trackState) const
Get the state of tracks (wanted, requested, queued)
void queueMusic(int track) override
Queue a track to start once the current one finishes.
Definition: midi_player.h:32
Definition: u8_music_process.h:35
int _wanted
Track we want to play.
Definition: u8_music_process.h:48
int _lastRequest
Last requested track that was not a temporary (ie, combat) track.
Definition: u8_music_process.h:50
void unpauseMusic() override
Resume the current track after pausing.
void saveTrackState() override
Save the current track state - used when the menu is opened.
void unqueueMusic() override
Clear any queued track (does not affect currently playing track)
Definition: music_process.h:36
bool isFading() override
Returns true if the music is currently fading.
bool isPlaying() override
Is a track currently playing?
Definition: debugger.h:37
void saveData(Common::WriteStream *ws) override
save Process data