From aeed854c2a0a2f5bc755cbac1d9896e6e23e8d83 Mon Sep 17 00:00:00 2001 From: bgk Date: Fri, 26 Dec 2008 13:22:45 +0000 Subject: [PATCH] Comments git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@821 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/common/SoundDriver.h | 48 +++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/src/common/SoundDriver.h b/src/common/SoundDriver.h index c6175dd5..552e87f5 100644 --- a/src/common/SoundDriver.h +++ b/src/common/SoundDriver.h @@ -18,17 +18,49 @@ #ifndef __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 { - public: - virtual ~SoundDriver() {}; +public: - virtual bool init(int quality) = 0; - virtual void pause() = 0; - virtual void reset() = 0; - virtual void resume() = 0; - virtual void write(const u16 * finalWave, int length) = 0; - virtual int getBufferLength() = 0; + /** + * Destructor. Free the resources allocated by the sound driver. + */ + virtual ~SoundDriver() { }; + + /** + * 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__