[Scummvm-cvs-logs] SF.net SVN: scummvm:[36184] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Feb 1 21:35:51 CET 2009


Revision: 36184
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36184&view=rev
Author:   lordhoto
Date:     2009-02-01 20:35:51 +0000 (Sun, 01 Feb 2009)

Log Message:
-----------
Implemented per voice volume control. (Used for example in LoL intro)

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/script_tim.cpp
    scummvm/trunk/engines/kyra/sound.cpp
    scummvm/trunk/engines/kyra/sound.h
    scummvm/trunk/engines/kyra/sound_towns.cpp

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2009-02-01 20:21:01 UTC (rev 36183)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2009-02-01 20:35:51 UTC (rev 36184)
@@ -1530,7 +1530,7 @@
 
 	int16 vocIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2]);
 	if (vocIndex != -1) {
-		_sound->voicePlay(_ingameSoundList[vocIndex], true);
+		_sound->voicePlay(_ingameSoundList[vocIndex], 255, true);
 	} else if (_flags.platform == Common::kPlatformPC) {
 		if (_sound->getSfxType() == Sound::kMidiMT32)
 			track = track < _mt32SfxMapSize ? _mt32SfxMap[track] - 1 : -1;

Modified: scummvm/trunk/engines/kyra/script_tim.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_tim.cpp	2009-02-01 20:21:01 UTC (rev 36183)
+++ scummvm/trunk/engines/kyra/script_tim.cpp	2009-02-01 20:35:51 UTC (rev 36184)
@@ -683,7 +683,7 @@
 	const int volume = (param[1] * 255) / 100;
 
 	if (index < ARRAYSIZE(_vocFiles) && !_vocFiles[index].empty())
-		_vm->sound()->voicePlay(_vocFiles[index].c_str()/*, volume*/, true);
+		_vm->sound()->voicePlay(_vocFiles[index].c_str(), volume, true);
 	else
 		_vm->snd_playSoundEffect(index, volume);
 

Modified: scummvm/trunk/engines/kyra/sound.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound.cpp	2009-02-01 20:21:01 UTC (rev 36183)
+++ scummvm/trunk/engines/kyra/sound.cpp	2009-02-01 20:35:51 UTC (rev 36184)
@@ -66,7 +66,7 @@
 	return false;
 }
 
-int32 Sound::voicePlay(const char *file, bool isSfx) {
+int32 Sound::voicePlay(const char *file, uint8 volume, bool isSfx) {
 	char filenamebuffer[25];
 
 	int h = 0;
@@ -110,7 +110,7 @@
 	}
 
 	_soundChannels[h].file = file;
-	_mixer->playInputStream(isSfx ? Audio::Mixer::kSFXSoundType : Audio::Mixer::kSpeechSoundType, &_soundChannels[h].channelHandle, audioStream);
+	_mixer->playInputStream(isSfx ? Audio::Mixer::kSFXSoundType : Audio::Mixer::kSpeechSoundType, &_soundChannels[h].channelHandle, audioStream, -1, volume);
 
 	return audioStream->getTotalPlayTime();
 }

Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h	2009-02-01 20:21:01 UTC (rev 36183)
+++ scummvm/trunk/engines/kyra/sound.h	2009-02-01 20:35:51 UTC (rev 36184)
@@ -190,11 +190,12 @@
 	 * TODO: add support for queueing voice
 	 * files
 	 *
-	 * @param file	file to be played
-	 * @param isSfx marks file as sfx instead of voice
+	 * @param file		file to be played
+	 * @param volume	volume of the voice file
+	 * @param isSfx		marks file as sfx instead of voice
 	 * @return playtime of the voice file (-1 marks unknown playtime)
 	 */
-	virtual int32 voicePlay(const char *file, bool isSfx = false);
+	virtual int32 voicePlay(const char *file, uint8 volume = 255, bool isSfx = false);
 
 	/**
 	 * Queues the specified voice files in an AppendableAudioStream
@@ -455,7 +456,7 @@
 	void haltTrack();
 	void beginFadeOut();
 
-	int32 voicePlay(const char *file, bool isSfx = false) { return -1; }
+	int32 voicePlay(const char *file, uint8 volume = 255, bool isSfx = false) { return -1; }
 	void playSoundEffect(uint8);
 
 protected:
@@ -482,7 +483,7 @@
 	void haltTrack();
 	void beginFadeOut();
 
-	int32 voicePlay(const char *file, bool isSfx = false);
+	int32 voicePlay(const char *file, uint8 volume = 255, bool isSfx = false);
 	void playSoundEffect(uint8 track);
 
 protected:

Modified: scummvm/trunk/engines/kyra/sound_towns.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_towns.cpp	2009-02-01 20:21:01 UTC (rev 36183)
+++ scummvm/trunk/engines/kyra/sound_towns.cpp	2009-02-01 20:35:51 UTC (rev 36184)
@@ -4206,7 +4206,7 @@
 	haltTrack();
 }
 
-int32 SoundTownsPC98_v2::voicePlay(const char *file, bool) {
+int32 SoundTownsPC98_v2::voicePlay(const char *file, uint8, bool) {
 	static const uint16 rates[] =	{ 0x10E1, 0x0CA9, 0x0870, 0x0654, 0x0438, 0x032A, 0x021C, 0x0194 };
 
 	int h = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list