[Scummvm-git-logs] scummvm master -> 64e29224d38dc98fd493cadaec340f241a1b0570

dreammaster dreammaster at scummvm.org
Sat May 5 16:49:14 CEST 2018


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

Summary:
f5238c66d5 XEEN: Add an optional param to CD playback to specify sound type
64e29224d3 Merge pull request #1177 from dreammaster/cdvoice


Commit: f5238c66d5279bbc9de3272868b08c62adf3bbbd
    https://github.com/scummvm/scummvm/commit/f5238c66d5279bbc9de3272868b08c62adf3bbbd
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-05-05T10:46:20-04:00

Commit Message:
XEEN: Add an optional param to CD playback to specify sound type

Changed paths:
    README
    backends/audiocd/audiocd.h
    backends/audiocd/default/default-audiocd.cpp
    backends/audiocd/default/default-audiocd.h
    backends/audiocd/win32/win32-audiocd.cpp
    engines/xeen/scripts.cpp


diff --git a/README b/README
index edf8b2b..3ee554d 100644
--- a/README
+++ b/README
@@ -929,17 +929,18 @@ is simpler and more straightforward than moving around using the menu.
 --------------------------------------
 To properly plan the World of Xeen CD Talkie using original discs,
 use LAME or some other MP3 encoder to rip the cd audio tracks to files.
-Name the files track1.mp3 track2.mp3 etc. ScummVM must be compiled with
+Name the files track2.mp3 track3.mp3 etc. ScummVM must be compiled with
 MAD support to use this option. You will need to rip the file from the
 CD as a WAV file, then encode the MP3 files in constant bit rate. This
-can be done with the following LAME command line:
+can be done for each track with a LAME command line like:
 
-  lame -t -q 0 -b 96 track1.wav track1.mp3
+  lame -t -q 0 -b 96 track2.wav track2.mp3
 
 For the GOG Might and Magic 4-5 installation, install the game to your
 computer, and do the following steps:
-* The game1.gog file from the game folder is a CD ISO. Use software like
-Virtual CloneDrive to mount it as a drive.
+* The game1.inst (CUE) and game1.gog (BIN) file from the game folder is a 
+CD image. Use software like Virtual CloneDrive to mount it as a drive.
+Linux and MacOS users can use bchunk to convert it to an ISO.
 * Copy all the .cc files from the subfolder in the mounted drive to a new
 empty game folder that you create for the game.
 * Copy all the music/*.ogg files from the GOG installation to your game
diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h
index b3674f2..1a31cd7 100644
--- a/backends/audiocd/audiocd.h
+++ b/backends/audiocd/audiocd.h
@@ -23,6 +23,7 @@
 #ifndef BACKENDS_AUDIOCD_ABSTRACT_H
 #define BACKENDS_AUDIOCD_ABSTRACT_H
 
+#include "audio/mixer.h"
 #include "common/scummsys.h"
 #include "common/noncopyable.h"
 
@@ -65,10 +66,12 @@ public:
 	 * @param startFrame     the frame at which playback should start (75 frames = 1 second).
 	 * @param duration       the number of frames to play.
 	 * @param onlyEmulate    determines if the track should be emulated only
+	 * @param soundType      What sound type to play as. By default, it's as music
 	 * @note The @c onlyEmulate parameter is deprecated.
 	 * @return @c true if the track started playing, @c false otherwise
 	 */
-	virtual bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false) = 0;
+	virtual bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false,
+		Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType) = 0;
 
 	/**
 	 * Get if audio is being played.
diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp
index c2ce7ce..003060c 100644
--- a/backends/audiocd/default/default-audiocd.cpp
+++ b/backends/audiocd/default/default-audiocd.cpp
@@ -54,7 +54,8 @@ void DefaultAudioCDManager::close() {
 	stop();
 }
 
-bool DefaultAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) {
+bool DefaultAudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate,
+		Audio::Mixer::SoundType soundType) {
 	stop();
 
 	if (numLoops != 0 || startFrame != 0) {
@@ -84,7 +85,7 @@ bool DefaultAudioCDManager::play(int track, int numLoops, int startFrame, int du
 			repetitions. Finally, -1 means infinitely many
 			*/
 			_emulating = true;
-			_mixer->playStream(Audio::Mixer::kMusicSoundType, &_handle,
+			_mixer->playStream(soundType, &_handle,
 			                        Audio::makeLoopingAudioStream(stream, start, end, (numLoops < 1) ? numLoops + 1 : numLoops), -1, _cd.volume, _cd.balance);
 			return true;
 		}
diff --git a/backends/audiocd/default/default-audiocd.h b/backends/audiocd/default/default-audiocd.h
index e3fbb4b..3c12560 100644
--- a/backends/audiocd/default/default-audiocd.h
+++ b/backends/audiocd/default/default-audiocd.h
@@ -40,7 +40,8 @@ public:
 
 	virtual bool open();
 	virtual void close();
-	virtual bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false);
+	virtual bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false,
+		Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType);
 	virtual void stop();
 	virtual bool isPlaying() const;
 	virtual void setVolume(byte volume);
diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp
index b3cde30..6eff1ef 100644
--- a/backends/audiocd/win32/win32-audiocd.cpp
+++ b/backends/audiocd/win32/win32-audiocd.cpp
@@ -149,13 +149,14 @@ public:
 	Win32AudioCDManager();
 	~Win32AudioCDManager();
 
-	bool open();
-	void close();
-	bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false);
+	virtual bool open();
+	virtual void close();
+	virtual bool play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate = false,
+		Audio::Mixer::SoundType soundType = Audio::Mixer::kMusicSoundType);
 
 protected:
-	bool openCD(int drive);
-	bool openCD(const Common::String &drive);
+	virtual bool openCD(int drive);
+	virtual bool openCD(const Common::String &drive);
 
 private:
 	bool loadTOC();
@@ -254,9 +255,10 @@ void Win32AudioCDManager::close() {
 	_tocEntries.clear();
 }
 
-bool Win32AudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate) {
+bool Win32AudioCDManager::play(int track, int numLoops, int startFrame, int duration, bool onlyEmulate,
+		Audio::Mixer::SoundType soundType) {
 	// Prefer emulation
-	if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate))
+	if (DefaultAudioCDManager::play(track, numLoops, startFrame, duration, onlyEmulate, soundType))
 		return true;
 
 	// If we're set to only emulate, or have no CD drive, return here
@@ -289,7 +291,7 @@ bool Win32AudioCDManager::play(int track, int numLoops, int startFrame, int dura
 	_emulating = true;
 
 	_mixer->playStream(
-	    Audio::Mixer::kMusicSoundType,
+	    soundType,
 	    &_handle,
 	    Audio::makeLoopingAudioStream(audioStream, start, end, (numLoops < 1) ? numLoops + 1 : numLoops),
 	    -1,
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 05450c2..4854f4e 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1472,7 +1472,7 @@ bool Scripts::cmdPlayCD(ParamsIterator &params) {
 	int start = params.readUint16LE() * 60 / 75;
 	int finish = params.readUint16LE() * 60 / 75;
 
-	g_system->getAudioCDManager()->play(trackNum, 1, start, finish - start);
+	g_system->getAudioCDManager()->play(trackNum, 1, start, finish - start, false, Audio::Mixer::kSpeechSoundType);
 	return true;
 }
 


Commit: 64e29224d38dc98fd493cadaec340f241a1b0570
    https://github.com/scummvm/scummvm/commit/64e29224d38dc98fd493cadaec340f241a1b0570
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-05-05T10:49:11-04:00

Commit Message:
Merge pull request #1177 from dreammaster/cdvoice

XEEN: Add an optional param to CD playback to specify sound type

Changed paths:
    README
    backends/audiocd/audiocd.h
    backends/audiocd/default/default-audiocd.cpp
    backends/audiocd/default/default-audiocd.h
    backends/audiocd/win32/win32-audiocd.cpp
    engines/xeen/scripts.cpp







More information about the Scummvm-git-logs mailing list