ScummVM API documentation
musicparser.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 GOT_MUSICPARSER_H
23#define GOT_MUSICPARSER_H
24
25#include "got/musicdriver_adlib.h"
26
27#include "common/scummsys.h"
28
29namespace Got {
30
32public:
35
36 bool startPlaying();
37 void pausePlaying();
38 void resumePlaying();
39 void stopPlaying();
40 bool isPlaying();
41
42 void setMusicDriver(MusicDriver_Got *driver);
43
44 bool loadMusic(byte *data, uint32 size);
45 void unloadMusic();
46
47 void onTimer();
48 static void timerCallback(void *data);
49
50protected:
51 void allNotesOff();
52 void sendToDriver(uint16 b);
53 void sendToDriver(byte reg, byte value);
54 void resetTracking();
55
56 bool _pause;
57 bool _abortParse;
58 // Number of ticks to the next event to process.
59 uint16 _currentDelta;
60
61 MusicDriver_Got *_driver;
62
63 // Points to start of current track data, or nullptr if no track is loaded.
64 byte *_track;
65 // The length of the track data.
66 uint32 _trackLength;
67 // The current play position in the track data, or nullptr if the parser is
68 // not playing.
69 byte *_playPos;
70 // The offset from the start of _track where playback should restart if the
71 // track has reached the end. -1 if there is no (valid) loop point defined.
72 int32 _loopStart;
73};
74
75} // namespace Got
76
77#endif
Definition: musicdriver.h:29
Definition: musicparser.h:31