diff options
author | Marcus Comstedt | 2008-06-29 11:51:47 +0000 |
---|---|---|
committer | Marcus Comstedt | 2008-06-29 11:51:47 +0000 |
commit | 3f22509321873455cde9723f74fe23ba37f2f675 (patch) | |
tree | f09c06855b17d4c6ddd3196e2f2313abbd83548d /backends | |
parent | 86706eb7d7c4a208925beebe5da59c02b8a6f34d (diff) | |
download | scummvm-rg350-3f22509321873455cde9723f74fe23ba37f2f675.tar.gz scummvm-rg350-3f22509321873455cde9723f74fe23ba37f2f675.tar.bz2 scummvm-rg350-3f22509321873455cde9723f74fe23ba37f2f675.zip |
New Mixer API.
svn-id: r32836
Diffstat (limited to 'backends')
-rw-r--r-- | backends/platform/dc/audio.cpp | 13 | ||||
-rw-r--r-- | backends/platform/dc/dc.h | 5 | ||||
-rw-r--r-- | backends/platform/dc/dcmain.cpp | 7 |
3 files changed, 12 insertions, 13 deletions
diff --git a/backends/platform/dc/audio.cpp b/backends/platform/dc/audio.cpp index 5f95a836e8..b5667e74b0 100644 --- a/backends/platform/dc/audio.cpp +++ b/backends/platform/dc/audio.cpp @@ -25,17 +25,18 @@ #include <common/scummsys.h> #include "engines/engine.h" -#include "sound/mixer.h" +#include "sound/mixer_intern.h" #include "dc.h" EXTERN_C void *memcpy4s(void *s1, const void *s2, unsigned int n); -void initSound() +uint OSystem_Dreamcast::initSound() { stop_sound(); do_sound_command(CMD_SET_FREQ_EXP(FREQ_22050_EXP)); do_sound_command(CMD_SET_STEREO(1)); do_sound_command(CMD_SET_BUFFER(SOUND_BUFFER_SHIFT)); + return read_sound_int(&SOUNDSTATUS->freq); } void OSystem_Dreamcast::checkSound() @@ -61,8 +62,8 @@ void OSystem_Dreamcast::checkSound() if (n<100) return; - Audio::Mixer::mixCallback(_mixer, (byte*)temp_sound_buffer, - 2*SAMPLES_TO_BYTES(n)); + _mixer->mixCallback((byte*)temp_sound_buffer, + 2*SAMPLES_TO_BYTES(n)); if (fillpos+n > curr_ring_buffer_samples) { int r = curr_ring_buffer_samples - fillpos; @@ -77,8 +78,4 @@ void OSystem_Dreamcast::checkSound() fillpos = 0; } -int OSystem_Dreamcast::getOutputSampleRate() const -{ - return read_sound_int(&SOUNDSTATUS->freq); -} diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index b7494a77bc..9dfd4c331e 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -28,6 +28,7 @@ #include <ronin/soundcommon.h> #include "backends/timer/default/default-timer.h" #include "backends/fs/fs-factory.h" +#include "sound/mixer_intern.h" #define NUM_BUFFERS 4 #define SOUND_BUFFER_SHIFT 3 @@ -195,7 +196,7 @@ class OSystem_Dreamcast : public OSystem, public FilesystemFactory { private: Common::SaveFileManager *_savefile; - Audio::Mixer *_mixer; + Audio::MixerImpl *_mixer; DefaultTimerManager *_timer; SoftKeyboard _softkbd; @@ -223,6 +224,7 @@ class OSystem_Dreamcast : public OSystem, public FilesystemFactory { int temp_sound_buffer[RING_BUFFER_SAMPLES>>SOUND_BUFFER_SHIFT]; + uint initSound(); void checkSound(); void drawMouse(int xdraw, int ydraw, int w, int h, @@ -237,6 +239,5 @@ class OSystem_Dreamcast : public OSystem, public FilesystemFactory { extern int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y, byte &shiftFlags, Interactive *inter = NULL); -extern void initSound(); extern bool selectGame(char *&, char *&, class Icon &); diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index 913bc9948e..0b114bee10 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -33,7 +33,7 @@ #include <common/config-manager.h> #include "backends/plugins/dc/dc-provider.h" -#include "sound/mixer.h" +#include "sound/mixer_intern.h" Icon icon; @@ -54,8 +54,10 @@ OSystem_Dreamcast::OSystem_Dreamcast() void OSystem_Dreamcast::initBackend() { _savefile = createSavefileManager(); - _mixer = new Audio::Mixer(); + _mixer = new Audio::MixerImpl(this); _timer = new DefaultTimerManager(); + _mixer->setOutputRate(initSound()); + _mixer->setReady(true); } @@ -216,7 +218,6 @@ int main() static int argc = 1; dc_init_hardware(); - initSound(); g_system = new OSystem_Dreamcast(); assert(g_system); |