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 DARKSEED_MUSIC_H
23 #define DARKSEED_MUSIC_H
24 
25 #include "darkseed/adlib_worx.h"
26 
27 #include "audio/mididrv_ms.h"
28 #include "audio/midiparser.h"
29 #include "common/mutex.h"
30 
31 namespace Darkseed {
32 
33 class DarkseedEngine;
34 
35 class MusicPlayer {
36 protected:
37  DarkseedEngine *_vm;
38 
39  Common::Mutex _mutex;
40  MidiDriver_Multisource *_driver;
41 
42  MidiParser *_parser;
43  byte *_musicData;
44 
45  bool _paused;
46 
47  static void onTimer(void *data);
48 
49 public:
51  ~MusicPlayer();
52 
53  int open();
54 
55  void load(Common::SeekableReadStream *in, int32 size = -1);
56 
57  void play(bool loop = false);
58  void setLoop(bool loop);
59  bool isPlaying();
60  void stop();
61  void pause(bool pause);
62 
63  void syncSoundSettings();
64 
65 private:
66  // The type of the music device selected for playback.
67  MusicType _deviceType;
68 };
69 
70 } // namespace Darkseed
71 
72 #endif // DARKSEED_MUSIC_H
Definition: music.h:35
Definition: mididrv_ms.h:86
MusicType
Definition: mididrv.h:44
Definition: stream.h:745
Definition: darkseed.h:69
Definition: mutex.h:67
Definition: adlib_worx.h:27
Definition: midiparser.h:289