From 1cbab62211b24e265da0eff4c8e16c83b3e3953f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 6 Apr 2016 23:35:41 +0200 Subject: DC: Fix compilation errors due to AudioCD changes. --- backends/platform/dc/dc.h | 2 +- backends/platform/dc/dcmain.cpp | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'backends') diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h index b567142b8f..6cd938ec9c 100644 --- a/backends/platform/dc/dc.h +++ b/backends/platform/dc/dc.h @@ -63,7 +63,7 @@ public: bool isPlaying() const; // Play cdrom audio track - void play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false); + bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false); // Stop cdrom audio track void stop(); diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp index bd66b81b35..c84aef9c47 100644 --- a/backends/platform/dc/dcmain.cpp +++ b/backends/platform/dc/dcmain.cpp @@ -90,12 +90,18 @@ static bool find_track(int track, int &first_sec, int &last_sec) return false; } -void DCCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) { +bool DCCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) { DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate); - // If we're playing now, are set to only emulate, return here - if (isPlaying() || onlyEmulate) - return; + // If we're playing now return here + if (isPlaying()) { + return true; + } + + // If we should only play emulated tracks stop here. + if (onlyEmulate) { + return false; + } int firstSec, lastSec; #if 1 @@ -106,16 +112,18 @@ void DCCDManager::play(int track, int numLoops, int startFrame, int duration, bo if (numLoops > 14) numLoops = 14; else if (numLoops < 0) - num_loops = 15; // infinity + numLoops = 15; // infinity if (!find_track(track, firstSec, lastSec)) - return; + return false; if (duration) lastSec = firstSec + startFrame + duration; - firstSec += startFrame; + firstSec += startFrame; play_cdda_sectors(firstSec, lastSec, numLoops); + + return true; } void DCCDManager::stop() { -- cgit v1.2.3