rlm@1: // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
rlm@1: // Copyright (C) 2008 VBA-M development team
rlm@1: 
rlm@1: // This program is free software; you can redistribute it and/or modify
rlm@1: // it under the terms of the GNU General Public License as published by
rlm@1: // the Free Software Foundation; either version 2, or(at your option)
rlm@1: // any later version.
rlm@1: //
rlm@1: // This program is distributed in the hope that it will be useful,
rlm@1: // but WITHOUT ANY WARRANTY; without even the implied warranty of
rlm@1: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rlm@1: // GNU General Public License for more details.
rlm@1: //
rlm@1: // You should have received a copy of the GNU General Public License
rlm@1: // along with this program; if not, write to the Free Software Foundation,
rlm@1: // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
rlm@1: 
rlm@1: #ifndef __VBA_SOUND_DRIVER_H__
rlm@1: #define __VBA_SOUND_DRIVER_H__
rlm@1: 
rlm@1: #include "Types.h"
rlm@1: 
rlm@1: /**
rlm@1:  * Sound driver abstract interface for the core to use to output sound.
rlm@1:  * Subclass this to implement a new sound driver.
rlm@1:  */
rlm@1: class SoundDriver
rlm@1: {
rlm@1: public:
rlm@1: 
rlm@1: 	/**
rlm@1: 	 * Destructor. Free the resources allocated by the sound driver.
rlm@1: 	 */
rlm@1: 	virtual ~SoundDriver() { };
rlm@1: 
rlm@1: 	/**
rlm@1: 	 * Initialize the sound driver.
rlm@1: 	 * @param sampleRate In Hertz
rlm@1: 	 */
rlm@1: 	virtual bool init() = 0;
rlm@1: 
rlm@1: 	/**
rlm@1: 	 * Tell the driver that the sound stream has paused
rlm@1: 	 */
rlm@1: 	virtual void pause() = 0;
rlm@1: 
rlm@1: 	/**
rlm@1: 	 * Reset the sound driver
rlm@1: 	 */
rlm@1: 	virtual void reset() = 0;
rlm@1: 
rlm@1: 	/**
rlm@1: 	 * Tell the driver that the sound stream has resumed
rlm@1: 	 */
rlm@1: 	virtual void resume() = 0;
rlm@1: 
rlm@1: 	/**
rlm@1: 	 * Write length bytes of data from the finalWave buffer to the driver output buffer.
rlm@1: 	 */
rlm@1: 	virtual void write(u16 * finalWave, int length) = 0;
rlm@1: 
rlm@1: 	virtual bool setThrottle(unsigned short throttle) = 0;
rlm@1: };
rlm@1: 
rlm@1: #endif // __VBA_SOUND_DRIVER_H__