aboutsummaryrefslogtreecommitdiff
path: root/backends/audiocd
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-02 06:44:42 +0000
committerAlejandro Marzini2010-07-02 06:44:42 +0000
commitf9c3a4547cbf1b1942402d618fa403a7fb1cb656 (patch)
tree63bb999ef23998b17aea9f5bc9712bc2a8f9bfbf /backends/audiocd
parent055fc3282f73bd9aa64cec2661258d3baf5ec66e (diff)
downloadscummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.tar.gz
scummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.tar.bz2
scummvm-rg350-f9c3a4547cbf1b1942402d618fa403a7fb1cb656.zip
Cleanup and documentation.
svn-id: r50589
Diffstat (limited to 'backends/audiocd')
-rw-r--r--backends/audiocd/audiocd.h7
-rw-r--r--backends/audiocd/default/default-audiocd.cpp1
-rw-r--r--backends/audiocd/default/default-audiocd.h3
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.cpp3
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.h15
5 files changed, 19 insertions, 10 deletions
diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h
index 41634b38fb..70eabf650b 100644
--- a/backends/audiocd/audiocd.h
+++ b/backends/audiocd/audiocd.h
@@ -29,14 +29,16 @@
#include "common/noncopyable.h"
/**
-* Abstract Audio CD manager class. Private subclasses implement the actual
+* Abstract Audio CD manager class. Subclasses implement the actual
* functionality.
*/
class AudioCDManager : Common::NonCopyable {
public:
virtual ~AudioCDManager() {}
-
+ /**
+ * A structure containing the current playback information
+ */
struct Status {
bool playing;
int track;
@@ -97,6 +99,7 @@ public:
/**
* Initialise the specified CD drive for audio playback.
+ * @param drive the drive id
* @return true if the CD drive was inited succesfully
*/
virtual bool openCD(int drive) = 0;
diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp
index ebe5553611..0e7dc66ba1 100644
--- a/backends/audiocd/default/default-audiocd.cpp
+++ b/backends/audiocd/default/default-audiocd.cpp
@@ -25,7 +25,6 @@
#include "backends/audiocd/default/default-audiocd.h"
#include "sound/audiostream.h"
-#include "common/util.h"
#include "common/system.h"
DefaultAudioCDManager::DefaultAudioCDManager() {
diff --git a/backends/audiocd/default/default-audiocd.h b/backends/audiocd/default/default-audiocd.h
index 5b946a0793..474264ef07 100644
--- a/backends/audiocd/default/default-audiocd.h
+++ b/backends/audiocd/default/default-audiocd.h
@@ -29,6 +29,9 @@
#include "backends/audiocd/audiocd.h"
#include "sound/mixer.h"
+/**
+* The default audio cd manager. Implements emulation of audio cd playback.
+*/
class DefaultAudioCDManager : public AudioCDManager {
public:
DefaultAudioCDManager();
diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp
index 7668bb80f5..d032df7eac 100644
--- a/backends/audiocd/sdl/sdl-audiocd.cpp
+++ b/backends/audiocd/sdl/sdl-audiocd.cpp
@@ -64,7 +64,8 @@ bool SdlAudioCDManager::openCD(int drive) {
return (_cdrom != NULL);
}
-void SdlAudioCDManager::stopCD() { /* Stop CD Audio in 1/10th of a second */
+void SdlAudioCDManager::stopCD() {
+ // Stop CD Audio in 1/10th of a second
_cdStopTime = SDL_GetTicks() + 100;
_cdNumLoops = 0;
}
diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h
index ed3d777c57..cb88d31a56 100644
--- a/backends/audiocd/sdl/sdl-audiocd.h
+++ b/backends/audiocd/sdl/sdl-audiocd.h
@@ -34,17 +34,20 @@
#include <SDL.h>
#endif
+/**
+* The SDL audio cd manager. Implements real audio cd playback.
+*/
class SdlAudioCDManager : public DefaultAudioCDManager {
public:
SdlAudioCDManager();
- ~SdlAudioCDManager();
+ virtual ~SdlAudioCDManager();
protected:
- bool openCD(int drive);
- void updateCD();
- bool pollCD() const;
- void playCD(int track, int num_loops, int start_frame, int duration);
- void stopCD();
+ virtual bool openCD(int drive);
+ virtual void updateCD();
+ virtual bool pollCD() const;
+ virtual void playCD(int track, int num_loops, int start_frame, int duration);
+ virtual void stopCD();
SDL_CD *_cdrom;
int _cdTrack, _cdNumLoops, _cdStartFrame, _cdDuration;