aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2016-03-13 19:17:28 +0100
committerJohannes Schickel2016-03-13 20:44:04 +0100
commitb9b3d4557c68ebda57a5ac66fcb2ea6a5ed3d92d (patch)
tree301f80d17c1423f2c2e74b5c1aeb5cd642e80580 /backends
parent5e0b136992c45cbc68d2c8b1e0c61a9e7cce34cb (diff)
downloadscummvm-rg350-b9b3d4557c68ebda57a5ac66fcb2ea6a5ed3d92d.tar.gz
scummvm-rg350-b9b3d4557c68ebda57a5ac66fcb2ea6a5ed3d92d.tar.bz2
scummvm-rg350-b9b3d4557c68ebda57a5ac66fcb2ea6a5ed3d92d.zip
WIN32: Fix AudioCD compilation.
Diffstat (limited to 'backends')
-rw-r--r--backends/audiocd/win32/win32-audiocd.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp
index 97c45a4946..dc9465e185 100644
--- a/backends/audiocd/win32/win32-audiocd.cpp
+++ b/backends/audiocd/win32/win32-audiocd.cpp
@@ -65,20 +65,6 @@
#include <ddk/ntddcdrm.h>
#endif
-enum {
- // The CD-ROM pre-gap is 2s
- kPreGapFrames = kFramesPerSecond * 2
-};
-
-static int getFrameCount(const TRACK_DATA &data) {
- int time = data.Address[1];
- time *= kSecondsPerMinute;
- time += data.Address[2];
- time *= kFramesPerSecond;
- time += data.Address[3];
- return time;
-}
-
class Win32AudioCDStream : public AudioCDStream {
public:
Win32AudioCDStream(HANDLE handle, const TRACK_DATA &startEntry, const TRACK_DATA &endEntry);
@@ -92,10 +78,24 @@ protected:
private:
HANDLE _driveHandle;
const TRACK_DATA &_startEntry, &_endEntry;
+
+ enum {
+ // The CD-ROM pre-gap is 2s
+ kPreGapFrames = kFramesPerSecond * 2
+ };
+
+ static int getFrameCount(const TRACK_DATA &data) {
+ int time = data.Address[1];
+ time *= kSecondsPerMinute;
+ time += data.Address[2];
+ time *= kFramesPerSecond;
+ time += data.Address[3];
+ return time;
+ }
};
Win32AudioCDStream::Win32AudioCDStream(HANDLE handle, const TRACK_DATA &startEntry, const TRACK_DATA &endEntry) :
- _driveHandle(handle), _startEntry(startEntry), _endEntry(endEntry), _buffer(), _frame(0), _bufferPos(kSamplesPerFrame), _bufferFrame(0) {
+ _driveHandle(handle), _startEntry(startEntry), _endEntry(endEntry) {
// We fill the buffer here already to prevent any out of sync issues due
// to the CD not yet having spun up.
startTimer(true);
@@ -110,7 +110,7 @@ uint Win32AudioCDStream::getStartFrame() const {
}
uint Win32AudioCDStream::getEndFrame() const {
- return getFrameCount(_endFrame);
+ return getFrameCount(_endEntry);
}
bool Win32AudioCDStream::readFrame(int frame, int16 *buffer) {
@@ -141,7 +141,7 @@ public:
bool open();
void close();
- 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);
protected:
bool openCD(int drive);