ScummVM API documentation
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 #ifndef EEM_MUSIC_H
23 #define EEM_MUSIC_H
24 
25 #include "audio/mac/halestorm.h"
26 #include "audio/midiplayer.h"
27 
28 #include "common/array.h"
29 #include "common/path.h"
30 #include "common/scummsys.h"
31 
32 namespace Common {
33 class MacResManager;
34 }
35 
36 namespace EEM {
37 
58 public:
59  explicit MusicPlayer(bool isFloppy = false, bool isMacintosh = false,
60  bool isLondon = false, bool isMacCD = false);
61  ~MusicPlayer() override;
62 
64  void playFile(const Common::Path &xmiPath, bool loop = false);
65 
68  void playMus(uint num, bool loop = false);
69 
70  void stop() override;
71  bool isPlaying() const;
72  void fadeOut();
73  bool isFading() const;
74  void setVolume(int volume) override;
75 
76  // WORKAROUND: Miles drivers handle source-channel routing themselves;
77  // bypass Audio::MidiPlayer::sendToChannel. Same as Toltecs / SAGA.
78  void send(uint32 b) override;
79 
80 private:
81  void openMacMusicResources();
82  Common::SeekableReadStream *getMacMusicResource(uint file, uint16 id, uint32 type);
83  void playMacSongResource(uint16 resourceId, bool loop);
84  void startLoadedMusic(const Common::String &name, bool loop);
85  Common::SeekableReadStream *getResource(uint16 id, uint32 type) override;
86 
87  bool _milesAudioMode = false;
88  const bool _isFloppy;
89  const bool _isMacintosh;
90  const bool _isLondon;
91  const bool _isMacCD;
92  Common::Array<byte> _xmiData;
93  Common::Array<Common::Path> _macResourcePaths;
94  Common::MacResManager *_macResources = nullptr;
95  Audio::HalestormDriver *_macDriver = nullptr;
96 };
97 
98 } // End of namespace EEM
99 
100 #endif
Definition: halestorm.h:44
Definition: midiplayer.h:63
Definition: macresman.h:126
Definition: str.h:59
Definition: path.h:52
Definition: stream.h:745
Definition: animation.h:30
Definition: algorithm.h:29
Definition: halestorm.h:37
Definition: music.h:57