-
Notifications
You must be signed in to change notification settings - Fork 2
/
sound.h
57 lines (42 loc) · 1.04 KB
/
sound.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __VBA_SOUND_DRIVER_H__
#define __VBA_SOUND_DRIVER_H__
#include "types.h"
/**
* Sound driver abstract interface for the core to use to output sound.
* Subclass this to implement a new sound driver.
*/
class SoundDriver
{
public:
/**
* Destructor. Free the resources allocated by the sound driver.
*/
virtual ~SoundDriver() { };
/**
* Initialize the sound driver.
* @param sampleRate In Hertz
*/
virtual bool init(long sampleRate) = 0;
/**
* Tell the driver that the sound stream has paused
*/
virtual void pause() = 0;
/**
* Reset the sound driver
*/
virtual void reset() = 0;
/**
* Tell the driver that the sound stream has resumed
*/
virtual void resume() = 0;
/**
* Write length bytes of data from the finalWave buffer to the driver output buffer.
*/
virtual void write(u16 * finalWave, int length) = 0;
virtual void setThrottle(unsigned short throttle) { };
bool userMute;
virtual void mute() = 0;
virtual void unMute() = 0;
virtual void doUserMute() = 0;
};
#endif // __VBA_SOUND_DRIVER_H__