[Scummvm-cvs-logs] SF.net SVN: scummvm: [32924] scummvm/trunk/backends/platform/wii

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Sun Jul 6 14:04:19 CEST 2008


Revision: 32924
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32924&view=rev
Author:   dhewg
Date:     2008-07-06 05:04:19 -0700 (Sun, 06 Jul 2008)

Log Message:
-----------
adjustments to the recent mixer api changes

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wii/osystem.cpp
    scummvm/trunk/backends/platform/wii/osystem.h
    scummvm/trunk/backends/platform/wii/osystem_sfx.cpp

Modified: scummvm/trunk/backends/platform/wii/osystem.cpp
===================================================================
--- scummvm/trunk/backends/platform/wii/osystem.cpp	2008-07-05 22:53:17 UTC (rev 32923)
+++ scummvm/trunk/backends/platform/wii/osystem.cpp	2008-07-06 12:04:19 UTC (rev 32924)
@@ -91,7 +91,7 @@
 	_startup_time = gettime();
 
 	_savefile = new DefaultSaveFileManager();
-	_mixer = new Audio::Mixer();
+	_mixer = new Audio::MixerImpl(this);
 	_timer = new DefaultTimerManager();
 
 	initGfx();

Modified: scummvm/trunk/backends/platform/wii/osystem.h
===================================================================
--- scummvm/trunk/backends/platform/wii/osystem.h	2008-07-05 22:53:17 UTC (rev 32923)
+++ scummvm/trunk/backends/platform/wii/osystem.h	2008-07-06 12:04:19 UTC (rev 32924)
@@ -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 <gctypes.h>
 #include <gccore.h>
@@ -96,7 +96,7 @@
 
 protected:
 	Common::SaveFileManager *_savefile;
-	Audio::Mixer *_mixer;
+	Audio::MixerImpl *_mixer;
 	DefaultTimerManager *_timer;
 
 public:
@@ -159,7 +159,6 @@
 	virtual void deleteMutex(MutexRef mutex);
 
 	typedef void (*SoundProc)(void *param, byte *buf, int len);
-	virtual int getOutputSampleRate() const;
 
 	virtual void quit();
 

Modified: scummvm/trunk/backends/platform/wii/osystem_sfx.cpp
===================================================================
--- scummvm/trunk/backends/platform/wii/osystem_sfx.cpp	2008-07-05 22:53:17 UTC (rev 32923)
+++ scummvm/trunk/backends/platform/wii/osystem_sfx.cpp	2008-07-06 12:04:19 UTC (rev 32924)
@@ -36,9 +36,6 @@
 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 * sfx_thread_func(void *arg) {
+	Audio::MixerImpl *mixer = (Audio::MixerImpl *) arg;
 	u8 next_sb;
 
 	while (true) {
@@ -57,7 +55,7 @@
 			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 @@
 
 	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 @@
 	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 @@
 	}
 }
 
-int OSystem_Wii::getOutputSampleRate() const {
-	return 48000;
-}
-


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list