ScummVM API documentation
music_process.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA8_AUDIO_MUSICPROCESS_H
23 #define ULTIMA8_AUDIO_MUSICPROCESS_H
24 
25 #include "ultima/ultima8/kernel/process.h"
26 #include "ultima/ultima8/usecode/intrinsics.h"
27 #include "ultima/ultima8/misc/classtype.h"
28 
29 namespace Ultima {
30 namespace Ultima8 {
31 
32 class Debugger;
33 class MidiPlayer;
34 
35 class MusicProcess : public Process {
36  friend class Debugger;
37 
38 protected:
41  virtual void playMusic_internal(int track) = 0;
42 
43  static MusicProcess *_theMusicProcess;
44 
45 public:
46  MusicProcess();
47  ~MusicProcess() override;
48 
49  ENABLE_RUNTIME_CLASSTYPE()
50 
51 
53  return _theMusicProcess;
54  }
55 
57  virtual void playMusic(int track) = 0;
59  virtual void playCombatMusic(int track) = 0;
61  virtual void queueMusic(int track) = 0;
63  virtual void unqueueMusic() = 0;
65  virtual void restoreMusic() = 0;
66 
68  virtual void fadeMusic(uint16 length) = 0;
70  virtual bool isFading() = 0;
71 
73  virtual void saveTrackState() = 0;
75  virtual void restoreTrackState() = 0;
76 
78  virtual bool isPlaying() = 0;
79 
81  virtual void pauseMusic() = 0;
83  virtual void unpauseMusic() = 0;
84 
85  INTRINSIC(I_playMusic);
86  INTRINSIC(I_stopMusic);
87  INTRINSIC(I_pauseMusic);
88  INTRINSIC(I_unpauseMusic);
89 
90 };
91 
92 } // End of namespace Ultima8
93 } // End of namespace Ultima
94 
95 #endif
Definition: process.h:38
virtual void unpauseMusic()=0
Resume the current track after pausing.
Definition: detection.h:27
virtual void playMusic(int track)=0
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.
virtual void saveTrackState()=0
Save the current track state - used when the menu is opened.
virtual void queueMusic(int track)=0
Queue a track to start once the current one finishes.
virtual void fadeMusic(uint16 length)=0
Fades out the music over the specified time (in milliseconds)
virtual bool isFading()=0
Returns true if the music is currently fading.
virtual void unqueueMusic()=0
Clear any queued track (does not affect currently playing track)
static MusicProcess * get_instance()
Get the current instance of the Music Processes.
Definition: music_process.h:52
virtual bool isPlaying()=0
Is a track currently playing?
Definition: music_process.h:35
virtual void pauseMusic()=0
Pause the currently playing track.
virtual void restoreTrackState()=0
Bring back the track state from before it was put on hold.
Definition: debugger.h:33
virtual void restoreMusic()=0
Restore the last requested non-combat track (eg, at the end of combat)
virtual void playMusic_internal(int track)=0
virtual void playCombatMusic(int track)=0
Play some combat music - the last played track will be remembered.