ScummVM API documentation
base_game_music.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 /*
23  * This file is based on WME Lite.
24  * http://dead-code.org/redir.php?target=wmelite
25  * Copyright (c) 2011 Jan Nedoma
26  */
27 
28 #ifndef WINTERMUTE_BASE_GAME_MUSIC_H
29 #define WINTERMUTE_BASE_GAME_MUSIC_H
30 
31 #include "common/scummsys.h"
32 
33 
34 namespace Wintermute {
35 
36 #define NUM_MUSIC_CHANNELS 5
37 class BasePersistenceManager;
38 class BaseSound;
39 class ScStack;
40 class ScScript;
41 class BaseGame;
43 public:
44  BaseGameMusic(BaseGame *gameRef);
45  void cleanup();
46 
47  bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
48 
49  bool resumeMusic(int channel);
50  bool setMusicStartTime(int channel, uint32 time);
51  bool pauseMusic(int channel);
52  bool stopMusic(int channel);
53  bool playMusic(int channel, const char *filename, bool looping = true, uint32 loopStart = 0);
54  bool updateMusicCrossfade();
55 
56  bool persistChannels(BasePersistenceManager *persistMgr);
57  bool persistCrossfadeSettings(BasePersistenceManager *persistMgr);
58 private:
59  BaseGame *_gameRef;
60  BaseSound *_music[NUM_MUSIC_CHANNELS];
61  uint32 _musicStartTime[NUM_MUSIC_CHANNELS];
62  bool _musicCrossfadeRunning;
63  bool _musicCrossfadeSwap;
64  uint32 _musicCrossfadeStartTime;
65  uint32 _musicCrossfadeLength;
66  int32 _musicCrossfadeChannel1;
67  int32 _musicCrossfadeChannel2;
68  int32 _musicCrossfadeVolume1;
69  int32 _musicCrossfadeVolume2;
70 };
71 
72 } // End of namespace Wintermute
73 
74 #endif
Definition: script.h:44
Definition: base_game.h:76
Definition: base_persistence_manager.h:56
Definition: script_stack.h:41
Definition: base_sound.h:39
Definition: base_game_music.h:42
Definition: achievements_tables.h:27