aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx
diff options
context:
space:
mode:
authorFilippos Karapetis2009-11-04 09:49:28 +0000
committerFilippos Karapetis2009-11-04 09:49:28 +0000
commit611f5dd95f30012a8c98c4285837a1ce32bdc19a (patch)
treeb3b42dd6359efbed16dd5c8146ff1988cc583ad0 /engines/sci/sfx
parent597524b255a75bb61830c8c518d990a38a4923b5 (diff)
downloadscummvm-rg350-611f5dd95f30012a8c98c4285837a1ce32bdc19a.tar.gz
scummvm-rg350-611f5dd95f30012a8c98c4285837a1ce32bdc19a.tar.bz2
scummvm-rg350-611f5dd95f30012a8c98c4285837a1ce32bdc19a.zip
Moved sound sync related variables inside the AudioPlayer class and fixed compilation
svn-id: r45654
Diffstat (limited to 'engines/sci/sfx')
-rw-r--r--engines/sci/sfx/audio.cpp11
-rw-r--r--engines/sci/sfx/audio.h7
-rw-r--r--engines/sci/sfx/core.cpp5
-rw-r--r--engines/sci/sfx/core.h2
4 files changed, 16 insertions, 9 deletions
diff --git a/engines/sci/sfx/audio.cpp b/engines/sci/sfx/audio.cpp
index 7a02677f63..1afda91a45 100644
--- a/engines/sci/sfx/audio.cpp
+++ b/engines/sci/sfx/audio.cpp
@@ -33,6 +33,17 @@
namespace Sci {
+AudioPlayer::AudioPlayer(ResourceManager *resMan) : _resMan(resMan), _audioRate(11025),
+ _syncResource(NULL), _syncOffset(0) {
+}
+
+AudioPlayer::~AudioPlayer() {
+ stopAudio();
+
+ if (_syncResource)
+ _resMan->unlockResource(_syncResource);
+}
+
int AudioPlayer::startAudio(uint16 module, uint32 number) {
int sampleLen;
Audio::AudioStream *audioStream = getAudioStream(number, module, &sampleLen);
diff --git a/engines/sci/sfx/audio.h b/engines/sci/sfx/audio.h
index b54b67567c..d3b9358ecb 100644
--- a/engines/sci/sfx/audio.h
+++ b/engines/sci/sfx/audio.h
@@ -33,8 +33,8 @@ class ResourceManager;
class AudioPlayer {
public:
- AudioPlayer(ResourceManager *resMan) : _resMan(resMan), _audioRate(11025) { }
- AudioPlayer::~AudioPlayer() { stopAudio(); }
+ AudioPlayer(ResourceManager *resMan);
+ ~AudioPlayer();
void setAudioRate(uint16 rate) { _audioRate = rate; }
Audio::SoundHandle* getAudioHandle() { return &_audioHandle; }
@@ -44,6 +44,9 @@ public:
void pauseAudio() { g_system->getMixer()->pauseHandle(_audioHandle, true); }
void resumeAudio() { g_system->getMixer()->pauseHandle(_audioHandle, false); }
+ Resource *_syncResource; /**< Used by kDoSync for speech syncing in CD talkie games */
+ uint _syncOffset;
+
private:
ResourceManager *_resMan;
uint16 _audioRate;
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index 90aa024dcd..b121d1d877 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -357,12 +357,9 @@ SfxState::SfxState() {
_flags = 0;
_song = NULL;
_suspended = 0;
- _syncResource = NULL;
}
SfxState::~SfxState() {
- if (_syncResource)
- _resMan->unlockResource(_syncResource);
}
@@ -653,8 +650,6 @@ void SfxState::sfx_init(ResourceManager *resMan, int flags) {
_songlib._lib = 0;
_song = NULL;
_flags = flags;
- _syncResource = NULL;
- _syncOffset = 0;
_player = NULL;
diff --git a/engines/sci/sfx/core.h b/engines/sci/sfx/core.h
index 92ea788636..60696583b7 100644
--- a/engines/sci/sfx/core.h
+++ b/engines/sci/sfx/core.h
@@ -54,8 +54,6 @@ public: // FIXME, make private
SongLibrary _songlib; /**< Song library */
Song *_song; /**< Active song, or start of active song chain */
bool _suspended; /**< Whether we are suspended */
- Resource *_syncResource; /**< Used by kDoSync for speech syncing in CD talkie games */
- uint _syncOffset;
ResourceManager *_resMan;
public: