ScummVM API documentation
midimusicplayer.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 #ifndef DRAGONS_MIDIMUSICPLAYER_H
22 #define DRAGONS_MIDIMUSICPLAYER_H
23 
24 #include "audio/midiplayer.h"
25 #include "vabsound.h"
26 #include "bigfile.h"
27 
28 namespace Dragons {
29 
31 private:
32  uint32 _midiDataSize;
33 public:
34  MidiMusicPlayer(BigfileArchive *bigFileArchive);
35  ~MidiMusicPlayer();
36 
37  void setVolume(int volume) override;
38 
39  void playSong(Common::SeekableReadStream *seqData);
40 
41  // The original sets the "sequence timing" to 109 Hz, whatever that
42  // means. The default is 120.
43  uint32 getBaseTempo() { return _driver ? (109 * _driver->getBaseTempo()) / 120 : 0; }
44 
45  void sendToChannel(byte channel, uint32 b) override;
46 private:
47  byte *resizeMidiBuffer(uint32 desiredSize);
48  Common::SeekableReadStream *loadSoundFont(BigfileArchive *bigFileArchive);
49 };
50 
51 } // End of namespace Dragons
52 
53 #endif //DRAGONS_MIDIMUSICPLAYER_H
Definition: midiplayer.h:63
Definition: bigfile.h:42
virtual uint32 getBaseTempo()=0
Definition: midimusicplayer.h:30
Definition: stream.h:745
Definition: actor.h:26
void sendToChannel(byte channel, uint32 b) override
void setVolume(int volume) override