Mercurial > vba-clojure
comparison src/sdl/SoundDriver.h @ 1:f9f4f1b99eed
importing src directory
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 03 Mar 2012 10:31:27 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:8ced16adf2e1 | 1:f9f4f1b99eed |
---|---|
1 // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. | |
2 // Copyright (C) 2008 VBA-M development team | |
3 | |
4 // This program is free software; you can redistribute it and/or modify | |
5 // it under the terms of the GNU General Public License as published by | |
6 // the Free Software Foundation; either version 2, or(at your option) | |
7 // any later version. | |
8 // | |
9 // This program is distributed in the hope that it will be useful, | |
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 // GNU General Public License for more details. | |
13 // | |
14 // You should have received a copy of the GNU General Public License | |
15 // along with this program; if not, write to the Free Software Foundation, | |
16 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
17 | |
18 #ifndef __VBA_SOUND_DRIVER_H__ | |
19 #define __VBA_SOUND_DRIVER_H__ | |
20 | |
21 #include "Types.h" | |
22 | |
23 /** | |
24 * Sound driver abstract interface for the core to use to output sound. | |
25 * Subclass this to implement a new sound driver. | |
26 */ | |
27 class SoundDriver | |
28 { | |
29 public: | |
30 | |
31 /** | |
32 * Destructor. Free the resources allocated by the sound driver. | |
33 */ | |
34 virtual ~SoundDriver() { }; | |
35 | |
36 /** | |
37 * Initialize the sound driver. | |
38 * @param sampleRate In Hertz | |
39 */ | |
40 virtual bool init() = 0; | |
41 | |
42 /** | |
43 * Tell the driver that the sound stream has paused | |
44 */ | |
45 virtual void pause() = 0; | |
46 | |
47 /** | |
48 * Reset the sound driver | |
49 */ | |
50 virtual void reset() = 0; | |
51 | |
52 /** | |
53 * Tell the driver that the sound stream has resumed | |
54 */ | |
55 virtual void resume() = 0; | |
56 | |
57 /** | |
58 * Write length bytes of data from the finalWave buffer to the driver output buffer. | |
59 */ | |
60 virtual void write(u16 * finalWave, int length) = 0; | |
61 | |
62 virtual bool setThrottle(unsigned short throttle) = 0; | |
63 }; | |
64 | |
65 #endif // __VBA_SOUND_DRIVER_H__ |