From 95ca13246eed820a3513ab91a517283a1263cc46 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sun, 6 Jul 2008 12:04:19 +0000 Subject: adjustments to the recent mixer api changes svn-id: r32924 --- backends/platform/wii/osystem.cpp | 2 +- backends/platform/wii/osystem.h | 5 ++--- backends/platform/wii/osystem_sfx.cpp | 16 ++++------------ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp index 2667ecb69d..9e708345c5 100644 --- a/backends/platform/wii/osystem.cpp +++ b/backends/platform/wii/osystem.cpp @@ -91,7 +91,7 @@ void OSystem_Wii::initBackend() { _startup_time = gettime(); _savefile = new DefaultSaveFileManager(); - _mixer = new Audio::Mixer(); + _mixer = new Audio::MixerImpl(this); _timer = new DefaultTimerManager(); initGfx(); diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h index 2a168fd0b7..7fbc560b1a 100644 --- a/backends/platform/wii/osystem.h +++ b/backends/platform/wii/osystem.h @@ -31,7 +31,7 @@ #include "backends/saves/default/default-saves.h" #include "backends/timer/default/default-timer.h" #include "graphics/surface.h" -#include "sound/mixer.h" +#include "sound/mixer_intern.h" #include #include @@ -96,7 +96,7 @@ private: protected: Common::SaveFileManager *_savefile; - Audio::Mixer *_mixer; + Audio::MixerImpl *_mixer; DefaultTimerManager *_timer; public: @@ -159,7 +159,6 @@ public: virtual void deleteMutex(MutexRef mutex); typedef void (*SoundProc)(void *param, byte *buf, int len); - virtual int getOutputSampleRate() const; virtual void quit(); diff --git a/backends/platform/wii/osystem_sfx.cpp b/backends/platform/wii/osystem_sfx.cpp index 16b2f3b055..0a225e80c7 100644 --- a/backends/platform/wii/osystem_sfx.cpp +++ b/backends/platform/wii/osystem_sfx.cpp @@ -36,9 +36,6 @@ static bool sfx_thread_quit = false; static u8 sb = 0; static u8 *sound_buffer[2]; -static OSystem_Wii::SoundProc sound_proc = NULL; -static void *proc_param = NULL; - static void audio_switch_buffers() { AUDIO_StopDMA(); AUDIO_InitDMA((u32) sound_buffer[sb], SFX_THREAD_FRAG_SIZE); @@ -48,6 +45,7 @@ static void audio_switch_buffers() { } static void * sfx_thread_func(void *arg) { + Audio::MixerImpl *mixer = (Audio::MixerImpl *) arg; u8 next_sb; while (true) { @@ -57,7 +55,7 @@ static void * sfx_thread_func(void *arg) { break; next_sb = sb ^ 1; - sound_proc(proc_param, sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE); + mixer->mixCallback(sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE); DCFlushRange(sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE); sb = next_sb; @@ -75,7 +73,7 @@ void OSystem_Wii::initSfx() { LWP_InitQueue(&sfx_queue); - s32 res = LWP_CreateThread(&sfx_thread, sfx_thread_func, NULL, sfx_stack, + s32 res = LWP_CreateThread(&sfx_thread, sfx_thread_func, _mixer, sfx_stack, SFX_THREAD_STACKSIZE, SFX_THREAD_PRIO); if (res) { @@ -95,9 +93,7 @@ void OSystem_Wii::initSfx() { DCFlushRange(sound_buffer[0], SFX_THREAD_FRAG_SIZE); DCFlushRange(sound_buffer[1], SFX_THREAD_FRAG_SIZE); - sound_proc = Audio::Mixer::mixCallback; - proc_param = _mixer; - + _mixer->setOutputRate(48000); _mixer->setReady(true); AUDIO_SetDSPSampleRate(AI_SAMPLERATE_48KHZ); @@ -127,7 +123,3 @@ void OSystem_Wii::deinitSfx() { } } -int OSystem_Wii::getOutputSampleRate() const { - return 48000; -} - -- cgit v1.2.3