[Scummvm-git-logs] scummvm master -> a332688ae6ec28599ca48ff19fd517d5b7d92657

sev- sev at scummvm.org
Thu May 13 13:36:15 UTC 2021


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2b29bcd1af AUDIO: Make ModPlayer rewindable
cfaa0fd4be SLUDGE: Loop MOD playback
a332688ae6 AUDIO: Fix Mod sound looping


Commit: 2b29bcd1afc66fe91752e5d25f44a115b2279378
    https://github.com/scummvm/scummvm/commit/2b29bcd1afc66fe91752e5d25f44a115b2279378
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-05-13T02:09:48+02:00

Commit Message:
AUDIO: Make ModPlayer rewindable

Changed paths:
    audio/mods/mod_xm_s3m.cpp
    audio/mods/mod_xm_s3m.h


diff --git a/audio/mods/mod_xm_s3m.cpp b/audio/mods/mod_xm_s3m.cpp
index 3c9ee31b1a..02a3e68e3e 100644
--- a/audio/mods/mod_xm_s3m.cpp
+++ b/audio/mods/mod_xm_s3m.cpp
@@ -71,7 +71,7 @@
 
 namespace Modules {
 
-class ModXmS3mStream : public Audio::AudioStream {
+class ModXmS3mStream : public Audio::RewindableAudioStream {
 private:
 	struct Channel {
 		Instrument *instrument;
@@ -121,6 +121,7 @@ private:
 	int tick();
 	void updateRow();
 	int seek(int samplePos);
+	bool rewind() override { setSequencePos(0); return true; }
 
 	// Sample
 	void downsample(int *buf, int count);
@@ -1368,7 +1369,7 @@ void ModXmS3mStream::setSequencePos(int pos) {
 
 namespace Audio {
 
-AudioStream *makeModXmS3mStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, int rate, int interpolation) {
+RewindableAudioStream *makeModXmS3mStream(Common::SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse, int rate, int interpolation) {
 	Modules::ModXmS3mStream *soundStream = new Modules::ModXmS3mStream(stream, rate, interpolation);
 
 	if (disposeAfterUse == DisposeAfterUse::YES)
diff --git a/audio/mods/mod_xm_s3m.h b/audio/mods/mod_xm_s3m.h
index 7b93594040..c778d24ed5 100644
--- a/audio/mods/mod_xm_s3m.h
+++ b/audio/mods/mod_xm_s3m.h
@@ -85,7 +85,7 @@ class AudioStream;
  * @param rate				sample rate
  * @param interpolation		interpolation effect level
  */
-AudioStream *makeModXmS3mStream(Common::SeekableReadStream *stream,
+RewindableAudioStream *makeModXmS3mStream(Common::SeekableReadStream *stream,
 		DisposeAfterUse::Flag disposeAfterUse,
 		int rate = 48000, int interpolation = 0);
 


Commit: cfaa0fd4be11ddfcde8bef81daacbf5042f9ed6b
    https://github.com/scummvm/scummvm/commit/cfaa0fd4be11ddfcde8bef81daacbf5042f9ed6b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-05-13T02:10:18+02:00

Commit Message:
SLUDGE: Loop MOD playback

Changed paths:
    engines/sludge/sound.cpp


diff --git a/engines/sludge/sound.cpp b/engines/sludge/sound.cpp
index 7654f7c3e0..4b3411692e 100644
--- a/engines/sludge/sound.cpp
+++ b/engines/sludge/sound.cpp
@@ -224,7 +224,7 @@ bool SoundManager::playMOD(int f, int a, int fromTrack) {
 	if (memImage->size() != (int)length || readStream->err()) {
 		return fatal("Sound reading failed");
 	}
-	Audio::AudioStream *stream = Audio::makeModXmS3mStream(memImage, DisposeAfterUse::NO);
+	Audio::LoopingAudioStream *stream = new Audio::LoopingAudioStream(Audio::makeModXmS3mStream(memImage, DisposeAfterUse::NO), 0, DisposeAfterUse::YES);
 
 	if (stream) {
 		// play sound


Commit: a332688ae6ec28599ca48ff19fd517d5b7d92657
    https://github.com/scummvm/scummvm/commit/a332688ae6ec28599ca48ff19fd517d5b7d92657
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-05-13T15:35:40+02:00

Commit Message:
AUDIO: Fix Mod sound looping

Changed paths:
    audio/mods/mod_xm_s3m.cpp


diff --git a/audio/mods/mod_xm_s3m.cpp b/audio/mods/mod_xm_s3m.cpp
index 02a3e68e3e..170c9306f6 100644
--- a/audio/mods/mod_xm_s3m.cpp
+++ b/audio/mods/mod_xm_s3m.cpp
@@ -121,7 +121,7 @@ private:
 	int tick();
 	void updateRow();
 	int seek(int samplePos);
-	bool rewind() override { setSequencePos(0); return true; }
+	bool rewind() override { setSequencePos(0); _dataLeft = _initialDataLength; return true; }
 
 	// Sample
 	void downsample(int *buf, int count);




More information about the Scummvm-git-logs mailing list