ScummVM API documentation
musicdriver.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_MUSICDRIVER_H
23#define GOT_MUSICDRIVER_H
24
25#include "common/timer.h"
26
27namespace Got {
28
30public:
31 MusicDriver_Got(uint8 timerFrequency);
32 virtual ~MusicDriver_Got() { };
33
34 virtual int open() = 0;
35 bool isOpen() const;
36 virtual void close() = 0;
37
38 virtual void syncSoundSettings() = 0;
39
40 virtual void send(uint16 b) = 0;
41 virtual void stopAllNotes() = 0;
42
43 virtual void setTimerFrequency(uint8 timerFrequency);
44 void onTimer();
45 void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc);
46
47protected:
48 // True if the driver has been successfully opened.
49 bool _isOpen;
50 // The number of timer callbacks per second.
51 int _timerFrequency;
52
53 // External timer callback
54 void *_timer_param;
56};
57
59public:
60 MusicDriver_Got_NULL(uint8 timerFrequency) : MusicDriver_Got(timerFrequency) { };
62
63 int open() override;
64 void close() override;
65
66 void syncSoundSettings() override { };
67 void send(uint16 b) override { };
68 void stopAllNotes() override { };
69
70 void setTimerFrequency(uint8 timerFrequency) override;
71
72 static void timerCallback(void *data);
73};
74
75} // namespace Got
76
77#endif
void(* TimerProc)(void *refCon)
Definition: timer.h:42
Definition: musicdriver.h:58
Definition: musicdriver.h:29