Mercurial > vba-clojure
diff 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 |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/sdl/SoundDriver.h Sat Mar 03 10:31:27 2012 -0600 1.3 @@ -0,0 +1,65 @@ 1.4 +// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 1.5 +// Copyright (C) 2008 VBA-M development team 1.6 + 1.7 +// This program is free software; you can redistribute it and/or modify 1.8 +// it under the terms of the GNU General Public License as published by 1.9 +// the Free Software Foundation; either version 2, or(at your option) 1.10 +// any later version. 1.11 +// 1.12 +// This program is distributed in the hope that it will be useful, 1.13 +// but WITHOUT ANY WARRANTY; without even the implied warranty of 1.14 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.15 +// GNU General Public License for more details. 1.16 +// 1.17 +// You should have received a copy of the GNU General Public License 1.18 +// along with this program; if not, write to the Free Software Foundation, 1.19 +// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1.20 + 1.21 +#ifndef __VBA_SOUND_DRIVER_H__ 1.22 +#define __VBA_SOUND_DRIVER_H__ 1.23 + 1.24 +#include "Types.h" 1.25 + 1.26 +/** 1.27 + * Sound driver abstract interface for the core to use to output sound. 1.28 + * Subclass this to implement a new sound driver. 1.29 + */ 1.30 +class SoundDriver 1.31 +{ 1.32 +public: 1.33 + 1.34 + /** 1.35 + * Destructor. Free the resources allocated by the sound driver. 1.36 + */ 1.37 + virtual ~SoundDriver() { }; 1.38 + 1.39 + /** 1.40 + * Initialize the sound driver. 1.41 + * @param sampleRate In Hertz 1.42 + */ 1.43 + virtual bool init() = 0; 1.44 + 1.45 + /** 1.46 + * Tell the driver that the sound stream has paused 1.47 + */ 1.48 + virtual void pause() = 0; 1.49 + 1.50 + /** 1.51 + * Reset the sound driver 1.52 + */ 1.53 + virtual void reset() = 0; 1.54 + 1.55 + /** 1.56 + * Tell the driver that the sound stream has resumed 1.57 + */ 1.58 + virtual void resume() = 0; 1.59 + 1.60 + /** 1.61 + * Write length bytes of data from the finalWave buffer to the driver output buffer. 1.62 + */ 1.63 + virtual void write(u16 * finalWave, int length) = 0; 1.64 + 1.65 + virtual bool setThrottle(unsigned short throttle) = 0; 1.66 +}; 1.67 + 1.68 +#endif // __VBA_SOUND_DRIVER_H__