aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-06 15:23:33 +0000
committerJohannes Schickel2010-01-06 15:23:33 +0000
commit84f30344060ef382efa7d86fa8f7e55859e82421 (patch)
tree2b24a5cab8703c8bd6d3a52414ebd324712c5144
parent027fe079c946d2fc367bebe15244520b035e8990 (diff)
downloadscummvm-rg350-84f30344060ef382efa7d86fa8f7e55859e82421.tar.gz
scummvm-rg350-84f30344060ef382efa7d86fa8f7e55859e82421.tar.bz2
scummvm-rg350-84f30344060ef382efa7d86fa8f7e55859e82421.zip
- Move openStreamFile from AudioStream to SeekableAudioStream.
- Fix documentation of openStreamFile. svn-id: r47080
-rw-r--r--engines/agos/animation.cpp2
-rw-r--r--engines/saga/music.cpp2
-rw-r--r--engines/sword1/animation.cpp2
-rw-r--r--engines/sword2/animation.cpp2
-rw-r--r--sound/audiocd.cpp2
-rw-r--r--sound/audiostream.cpp2
-rw-r--r--sound/audiostream.h25
7 files changed, 16 insertions, 21 deletions
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index e2511f335f..258f9b670c 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -308,7 +308,7 @@ void MoviePlayerDXA::startSound() {
_bgSoundStream = Audio::makeWAVStream(_fileStream->readStream(size), true);
}
} else {
- _bgSoundStream = Audio::AudioStream::openStreamFile(baseName);
+ _bgSoundStream = Audio::SeekableAudioStream::openStreamFile(baseName);
}
if (_bgSoundStream != NULL) {
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index aa7d81d35a..de29747db5 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -277,7 +277,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
sprintf(trackName[1], "track%02d", realTrackNumber);
Audio::SeekableAudioStream *stream = 0;
for (int i = 0; i < 2; ++i) {
- stream = Audio::AudioStream::openStreamFile(trackName[i]);
+ stream = Audio::SeekableAudioStream::openStreamFile(trackName[i]);
if (stream) {
_mixer->playInputStreamLooping(Audio::Mixer::kMusicSoundType, &_musicHandle, stream, (flags == MUSIC_LOOP) ? 0 : 1);
_digitalMusic = true;
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index 80e8573c44..706bee4b92 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -87,7 +87,7 @@ bool MoviePlayer::load(uint32 id) {
char filename[20];
if (_decoderType == kVideoDecoderDXA) {
- _bgSoundStream = Audio::AudioStream::openStreamFile(sequenceList[id]);
+ _bgSoundStream = Audio::SeekableAudioStream::openStreamFile(sequenceList[id]);
} else {
_bgSoundStream = NULL;
}
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index 629fc3d8bc..2c4b9e0d98 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -63,7 +63,7 @@ MoviePlayer:: ~MoviePlayer() {
*/
bool MoviePlayer::load(const char *name) {
if (_decoderType == kVideoDecoderDXA) {
- _bgSoundStream = Audio::AudioStream::openStreamFile(name);
+ _bgSoundStream = Audio::SeekableAudioStream::openStreamFile(name);
} else {
_bgSoundStream = NULL;
}
diff --git a/sound/audiocd.cpp b/sound/audiocd.cpp
index d60ae2fab2..d2b205ab6c 100644
--- a/sound/audiocd.cpp
+++ b/sound/audiocd.cpp
@@ -69,7 +69,7 @@ void AudioCDManager::play(int track, int numLoops, int startFrame, int duration,
repetitions. Finally, -1 means infinitely many
*/
// We multiply by 40 / 3 = 1000 / 75 to convert frames to milliseconds
- stream = AudioStream::openStreamFile(trackName[i]);
+ stream = SeekableAudioStream::openStreamFile(trackName[i]);
}
// Stop any currently playing emulated track
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 08b1c29491..acd5398bfd 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -74,7 +74,7 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = {
{ NULL, NULL, NULL } // Terminator
};
-SeekableAudioStream *AudioStream::openStreamFile(const Common::String &basename) {
+SeekableAudioStream *SeekableAudioStream::openStreamFile(const Common::String &basename) {
SeekableAudioStream *stream = NULL;
Common::File *fileHandle = new Common::File();
diff --git a/sound/audiostream.h b/sound/audiostream.h
index b75b8776cc..8fc485bdb3 100644
--- a/sound/audiostream.h
+++ b/sound/audiostream.h
@@ -84,21 +84,6 @@ public:
*/
virtual bool endOfStream() const { return endOfData(); }
- /**
- * Tries to load a file by trying all available formats.
- * In case of an error, the file handle will be closed, but deleting
- * it is still the responsibilty of the caller.
- * @param basename a filename without an extension
- * @param startTime the (optional) time offset in milliseconds from which
- * to start playback
- * @param duration the (optional) time in milliseconds specifying how long
- to play
- * @param numLoops how often the data shall be looped (0 = infinite)
- * @return an Audiostream ready to use in case of success;
- * NULL in case of an error (e.g. invalid/nonexisting file)
- */
- static SeekableAudioStream *openStreamFile(const Common::String &basename);
-
/**
* Sets number of times the stream is supposed to get looped
* This also resets the number of loops played counter, which
@@ -124,6 +109,16 @@ public:
class SeekableAudioStream : public AudioStream {
public:
/**
+ * Tries to load a file by trying all available formats.
+ * In case of an error, the file handle will be closed, but deleting
+ * it is still the responsibilty of the caller.
+ * @param basename a filename without an extension
+ * @return an SeekableAudioStream ready to use in case of success;
+ * NULL in case of an error (e.g. invalid/nonexisting file)
+ */
+ static SeekableAudioStream *openStreamFile(const Common::String &basename);
+
+ /**
* Seeks to a given offset in the stream.
*
* @param where offset in milliseconds