mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
Added volume control for OpenAL, also improved its performance a bit, but don't expect too much.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4712 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -35,19 +35,24 @@
|
||||
#endif // WIN32
|
||||
// public use
|
||||
#define SFX_MAX_SOURCE 1
|
||||
#define OAL_NUM_BUFFERS 2
|
||||
#define OAL_BUFFER_SIZE (1024 * 8)
|
||||
#define OAL_NUM_BUFFERS 8
|
||||
#define OAL_BUFFER_SIZE (512 * 4)
|
||||
#endif
|
||||
|
||||
class OpenALStream: public SoundStream
|
||||
{
|
||||
#if defined HAVE_OPENAL && HAVE_OPENAL
|
||||
public:
|
||||
OpenALStream(CMixer *mixer, void *hWnd = NULL): SoundStream(mixer) {};
|
||||
OpenALStream(CMixer *mixer, void *hWnd = NULL)
|
||||
: SoundStream(mixer)
|
||||
, uiSource(0)
|
||||
{};
|
||||
|
||||
virtual ~OpenALStream() {};
|
||||
|
||||
virtual bool Start();
|
||||
virtual void SoundLoop();
|
||||
virtual void SetVolume(int volume);
|
||||
virtual void Stop();
|
||||
virtual void Clear(bool mute);
|
||||
static bool isValid() { return true; }
|
||||
@ -64,6 +69,7 @@ private:
|
||||
short realtimeBuffer[OAL_BUFFER_SIZE/sizeof(short)];
|
||||
ALuint uiBuffers[OAL_NUM_BUFFERS];
|
||||
ALuint uiSource;
|
||||
ALfloat fVolume;
|
||||
#else
|
||||
public:
|
||||
OpenALStream(CMixer *mixer, void *hWnd = NULL): SoundStream(mixer) {}
|
||||
|
Reference in New Issue
Block a user