git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@821 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
bgk 2008-12-26 13:22:45 +00:00
parent 22072e30a6
commit aeed854c2a
1 changed files with 40 additions and 8 deletions

View File

@ -18,17 +18,49 @@
#ifndef __VBA_SOUND_DRIVER_H__ #ifndef __VBA_SOUND_DRIVER_H__
#define __VBA_SOUND_DRIVER_H__ #define __VBA_SOUND_DRIVER_H__
/**
* Sound driver abstract interface for the core to use to output sound.
* Subclass this to implement a new sound driver.
*/
class SoundDriver class SoundDriver
{ {
public: public:
virtual ~SoundDriver() {};
virtual bool init(int quality) = 0; /**
virtual void pause() = 0; * Destructor. Free the resources allocated by the sound driver.
virtual void reset() = 0; */
virtual void resume() = 0; virtual ~SoundDriver() { };
virtual void write(const u16 * finalWave, int length) = 0;
virtual int getBufferLength() = 0; /**
* Initialize the sound driver.
* @param quality Sound frequency : 1 => 44100 Hz, 2 => 22050 Hz, 4 => 11025 Hz
*/
virtual bool init(int quality) = 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(const u16 * finalWave, int length) = 0;
/**
* Return the size in bytes of the core sound buffer.
*/
virtual int getBufferLength() = 0;
}; };
#endif // __VBA_SOUND_DRIVER_H__ #endif // __VBA_SOUND_DRIVER_H__