From e991cd8c53ad21af037df1e0a16816aeea2d0fe2 Mon Sep 17 00:00:00 2001 From: Alejandro Marzini Date: Wed, 9 Jun 2010 20:09:57 +0000 Subject: - Revised abstract AudioCDManager. - Removed AudioCDManager Singleton, and changed code for using AudioCDManager in OSystem. - Added initialization code for new AudioCDManager in BaseBackend and OSystem_SDL. svn-id: r49548 --- engines/sci/sound/audio.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'engines/sci/sound/audio.cpp') diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp index 7748c0505b..4803d6d756 100644 --- a/engines/sci/sound/audio.cpp +++ b/engines/sci/sound/audio.cpp @@ -33,7 +33,6 @@ #include "common/file.h" #include "sound/audiostream.h" -#include "sound/audiocd.h" #include "sound/decoders/raw.h" #include "sound/decoders/wave.h" #include "sound/decoders/flac.h" @@ -375,7 +374,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) { // Subtract one from track. KQ6 starts at track 1, while ScummVM // ignores the data track and considers track 2 to be track 1. - AudioCD.play(track - 1, 1, start, duration); + g_system->getAudioCD()->play(track - 1, 1, start, duration); return 1; } else { // Jones in the Fast Lane CD Audio format @@ -398,7 +397,7 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) { // Jones uses the track as the resource value in the map if (res == track) { - AudioCD.play(1, 1, startFrame, length); + g_system->getAudioCD()->play(1, 1, startFrame, length); _audioCdStart = g_system->getMillis(); break; } @@ -412,16 +411,16 @@ int AudioPlayer::audioCdPlay(int track, int start, int duration) { void AudioPlayer::audioCdStop() { _audioCdStart = 0; - AudioCD.stop(); + g_system->getAudioCD()->stop(); } void AudioPlayer::audioCdUpdate() { - AudioCD.updateCD(); + g_system->getAudioCD()->update(); } int AudioPlayer::audioCdPosition() { // Return -1 if the sample is done playing. Converting to frames to compare. - if (((g_system->getMillis() - _audioCdStart) * 75 / 1000) >= (uint32)AudioCD.getStatus().duration) + if (((g_system->getMillis() - _audioCdStart) * 75 / 1000) >= (uint32)g_system->getAudioCD()->getStatus().duration) return -1; // Return the position otherwise (in ticks). -- cgit v1.2.3