[Scummvm-cvs-logs] SF.net SVN: scummvm: [30550] scummvm/trunk/engines/scumm/imuse_digi

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Jan 18 18:08:53 CET 2008


Revision: 30550
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30550&view=rev
Author:   fingolfin
Date:     2008-01-18 09:08:53 -0800 (Fri, 18 Jan 2008)

Log Message:
-----------
iMuse Digital: Moved track & table definition from dimuse.h into separate header files

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.cpp
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp

Added Paths:
-----------
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.h
    scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.h

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2008-01-18 16:38:11 UTC (rev 30549)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2008-01-18 17:08:53 UTC (rev 30550)
@@ -32,16 +32,13 @@
 #include "scumm/sound.h"
 #include "scumm/imuse_digi/dimuse.h"
 #include "scumm/imuse_digi/dimuse_bndmgr.h"
+#include "scumm/imuse_digi/dimuse_track.h"
 
 #include "sound/audiostream.h"
 #include "sound/mixer.h"
 
 namespace Scumm {
 
-IMuseDigital::Track::Track()
-	: soundId(-1), used(false), stream(NULL) {
-}
-
 void IMuseDigital::timer_handler(void *refCon) {
 	IMuseDigital *imuseDigital = (IMuseDigital *)refCon;
 	imuseDigital->callback();

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.h	2008-01-18 16:38:11 UTC (rev 30549)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.h	2008-01-18 17:08:53 UTC (rev 30550)
@@ -48,77 +48,13 @@
 struct imuseComiTable;
 class Serializer;
 class ScummEngine_v7;
+struct Track;
 
-// These flag bits correspond exactly to the sound mixer flags of March 2007.
-// We don't want to use the mixer flags directly, because then our saved games
-// will break in interesting ways if the mixer flags are ever assigned new
-// values. Now they should keep working, as long as these flags don't change.
-
-enum {
-	kFlagUnsigned = 1 << 0,
-	kFlag16Bits = 1 << 1,
-	kFlagLittleEndian = 1 << 2,
-	kFlagStereo = 1 << 3,
-	kFlagReverseStereo = 1 << 4
-
-	// Not used by Digital iMUSE
-	// kFlagAutoFree = 1 << 5,
-	// kFlagLoop = 1 << 6
-};
-
 class IMuseDigital : public MusicEngine {
 private:
 
 	int _callbackFps;		// value how many times callback needs to be called per second
 
-	struct Track {
-		int trackId;		// used to identify track by value (0-15)
-
-		int8 pan;			// panning value of sound
-		int32 vol;			// volume level (values 0-127 * 1000)
-		int32 volFadeDest;	// volume level which fading target (values 0-127 * 1000)
-		int32 volFadeStep;	// delta of step while changing volume at each imuse callback
-		int32 volFadeDelay;	// time in ms how long fading volume must be
-		bool volFadeUsed;	// flag if fading is in progress
-
-		int32 soundId;		// sound id used by scumm script
-		char soundName[15]; // sound name but also filename of sound in bundle data
-		bool used;			// flag mean that track is used
-		bool toBeRemoved;   // flag mean that track need to be free
-		bool mixerStreamRunning;	// flag mean sound mixer's stream is running OBSOLETE
-		bool souStreamUsed;	// flag mean that track use stream from sou file
-		bool sndDataExtComp;// flag mean that sound data is compressed by scummvm tools
-		int32 soundPriority;// priority level of played sound (0-127)
-		int32 regionOffset; // offset to sound data relative to begining of current region
-		int32 dataOffset;	// offset to sound data relative to begining of 'DATA' chunk
-		int32 curRegion;	// id of current used region
-		int32 curHookId;	// id of current used hook id
-		int32 volGroupId;	// id of volume group (IMUSE_VOLGRP_VOICE, IMUSE_VOLGRP_SFX, IMUSE_VOLGRP_MUSIC)
-		int32 soundType;	// type of sound data (kSpeechSoundType, kSFXSoundType, kMusicSoundType)
-		int32 feedSize;		// size of sound data needed to be filled at each callback iteration
-		int32 dataMod12Bit;	// value used between all callback to align 12 bit source of data
-		int32 mixerFlags;	// flags for sound mixer's channel (kFlagStereo, kFlag16Bits, kFlagReverseStereo, kFlagUnsigned, kFlagLittleEndian)
-
-		ImuseDigiSndMgr::SoundDesc *soundDesc;	// sound handle used by iMuse sound manager
-		Audio::SoundHandle mixChanHandle;					// sound mixer's channel handle
-		Audio::AppendableAudioStream *stream;		// sound mixer's audio stream handle for *.la1 and *.bun
-
-		Track();
-		
-		int getPan() const { return (pan != 64) ? 2 * pan - 127 : 0; }
-		int getVol() const { return vol / 1000; }
-		Audio::Mixer::SoundType getType() const {
-			Audio::Mixer::SoundType type = Audio::Mixer::kPlainSoundType;
-			if (volGroupId == 1)
-				type = Audio::Mixer::kSpeechSoundType;
-			else if (volGroupId == 2)
-				type = Audio::Mixer::kSFXSoundType;
-			else if (volGroupId == 3)
-				type = Audio::Mixer::kMusicSoundType;
-			return type;
-		}
-	};
-
 	struct TriggerParams {
 		char marker[10];
 		int fadeOutDelay;
@@ -126,7 +62,9 @@
 		int soundId;
 		int hookId;
 		int volume;
-	} _triggerParams;
+	};
+
+	TriggerParams _triggerParams;
 	bool _triggerUsed;
 
 	Track *_track[MAX_DIGITAL_TRACKS + MAX_DIGITAL_FADETRACKS];
@@ -221,61 +159,6 @@
 	int32 getCurMusicLipSyncHeight(int syncId);
 };
 
-struct imuseRoomMap {
-	int8 roomId;
-	byte stateIndex1;
-	byte offset;
-	byte stateIndex2;
-	byte attribPos;
-	byte stateIndex3;
-};
-
-struct imuseDigTable {
-	byte transitionType;
-	int16 soundId;
-	char name[20];
-	byte attribPos;
-	byte hookId;
-	char filename[13];
-};
-
-struct imuseComiTable {
-	byte transitionType;
-	int16 soundId;
-	char name[20];
-	byte attribPos;
-	byte hookId;
-	int16 fadeOutDelay;
-	char filename[13];
-};
-
-
-struct imuseFtNames {
-	char name[20];
-};
-
-struct imuseFtStateTable {
-	char audioName[9];
-	byte transitionType;
-	byte volume;
-	char name[21];
-};
-
-struct imuseFtSeqTable {
-	char audioName[9];
-	byte transitionType;
-	byte volume;
-};
-
-extern const imuseRoomMap _digStateMusicMap[];
-extern const imuseDigTable _digStateMusicTable[];
-extern const imuseDigTable _digSeqMusicTable[];
-extern const imuseComiTable _comiStateMusicTable[];
-extern const imuseComiTable _comiSeqMusicTable[];
-extern const imuseFtStateTable _ftStateMusicTable[];
-extern const imuseFtSeqTable _ftSeqMusicTable[];
-extern const imuseFtNames _ftSeqNames[];
-
 } // End of namespace Scumm
 
 #endif

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp	2008-01-18 16:38:11 UTC (rev 30549)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_music.cpp	2008-01-18 17:08:53 UTC (rev 30550)
@@ -26,6 +26,7 @@
 #include "common/scummsys.h"
 #include "scumm/scumm.h"
 #include "scumm/imuse_digi/dimuse.h"
+#include "scumm/imuse_digi/dimuse_tables.h"
 
 namespace Scumm {
 

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp	2008-01-18 16:38:11 UTC (rev 30549)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_script.cpp	2008-01-18 17:08:53 UTC (rev 30550)
@@ -31,6 +31,7 @@
 #include "scumm/sound.h"
 #include "scumm/imuse_digi/dimuse.h"
 #include "scumm/imuse_digi/dimuse_bndmgr.h"
+#include "scumm/imuse_digi/dimuse_track.h"
 
 #include "sound/audiostream.h"
 #include "sound/mixer.h"

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.cpp	2008-01-18 16:38:11 UTC (rev 30549)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.cpp	2008-01-18 17:08:53 UTC (rev 30550)
@@ -23,7 +23,8 @@
  */
 
 
-#include "scumm/imuse_digi/dimuse.h"
+//#include "scumm/imuse_digi/dimuse.h"
+#include "scumm/imuse_digi/dimuse_tables.h"
 
 namespace Scumm {
 

Added: scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.h	                        (rev 0)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.h	2008-01-18 17:08:53 UTC (rev 30550)
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#if !defined(SCUMM_IMUSE_DIGI_TABLES_H) && !defined(DISABLE_SCUMM_7_8)
+#define SCUMM_IMUSE_DIGI_TABLES_H
+
+#include "common/scummsys.h"
+
+namespace Scumm {
+
+struct imuseRoomMap {
+	int8 roomId;
+	byte stateIndex1;
+	byte offset;
+	byte stateIndex2;
+	byte attribPos;
+	byte stateIndex3;
+};
+
+struct imuseDigTable {
+	byte transitionType;
+	int16 soundId;
+	char name[20];
+	byte attribPos;
+	byte hookId;
+	char filename[13];
+};
+
+struct imuseComiTable {
+	byte transitionType;
+	int16 soundId;
+	char name[20];
+	byte attribPos;
+	byte hookId;
+	int16 fadeOutDelay;
+	char filename[13];
+};
+
+
+struct imuseFtNames {
+	char name[20];
+};
+
+struct imuseFtStateTable {
+	char audioName[9];
+	byte transitionType;
+	byte volume;
+	char name[21];
+};
+
+struct imuseFtSeqTable {
+	char audioName[9];
+	byte transitionType;
+	byte volume;
+};
+
+extern const imuseRoomMap _digStateMusicMap[];
+extern const imuseDigTable _digStateMusicTable[];
+extern const imuseDigTable _digSeqMusicTable[];
+extern const imuseComiTable _comiStateMusicTable[];
+extern const imuseComiTable _comiSeqMusicTable[];
+extern const imuseFtStateTable _ftStateMusicTable[];
+extern const imuseFtSeqTable _ftSeqMusicTable[];
+extern const imuseFtNames _ftSeqNames[];
+
+} // End of namespace Scumm
+
+#endif


Property changes on: scummvm/trunk/engines/scumm/imuse_digi/dimuse_tables.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp	2008-01-18 16:38:11 UTC (rev 30549)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.cpp	2008-01-18 17:08:53 UTC (rev 30550)
@@ -30,6 +30,7 @@
 #include "scumm/sound.h"
 #include "scumm/imuse_digi/dimuse.h"
 #include "scumm/imuse_digi/dimuse_bndmgr.h"
+#include "scumm/imuse_digi/dimuse_track.h"
 
 #include "sound/audiostream.h"
 #include "sound/mixer.h"
@@ -330,7 +331,7 @@
 	_triggerUsed = true;
 }
 
-IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) {
+Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) {
 	assert(track);
 	Track *fadeTrack;
 

Added: scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.h
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.h	                        (rev 0)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.h	2008-01-18 17:08:53 UTC (rev 30550)
@@ -0,0 +1,101 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#if !defined(SCUMM_IMUSE_DIGI_TRACK_H) && !defined(DISABLE_SCUMM_7_8)
+#define SCUMM_IMUSE_DIGI_TRACK_H
+
+#include "common/scummsys.h"
+
+namespace Scumm {
+
+
+// These flag bits correspond exactly to the sound mixer flags of March 2007.
+// We don't want to use the mixer flags directly, because then our saved games
+// will break in interesting ways if the mixer flags are ever assigned new
+// values. Now they should keep working, as long as these flags don't change.
+
+enum {
+	kFlagUnsigned = 1 << 0,
+	kFlag16Bits = 1 << 1,
+	kFlagLittleEndian = 1 << 2,
+	kFlagStereo = 1 << 3,
+	kFlagReverseStereo = 1 << 4
+
+	// Not used by Digital iMUSE
+	// kFlagAutoFree = 1 << 5,
+	// kFlagLoop = 1 << 6
+};
+
+struct Track {
+	int trackId;		// used to identify track by value (0-15)
+
+	int8 pan;			// panning value of sound
+	int32 vol;			// volume level (values 0-127 * 1000)
+	int32 volFadeDest;	// volume level which fading target (values 0-127 * 1000)
+	int32 volFadeStep;	// delta of step while changing volume at each imuse callback
+	int32 volFadeDelay;	// time in ms how long fading volume must be
+	bool volFadeUsed;	// flag if fading is in progress
+
+	int32 soundId;		// sound id used by scumm script
+	char soundName[15]; // sound name but also filename of sound in bundle data
+	bool used;			// flag mean that track is used
+	bool toBeRemoved;   // flag mean that track need to be free
+	bool mixerStreamRunning;	// flag mean sound mixer's stream is running OBSOLETE
+	bool souStreamUsed;	// flag mean that track use stream from sou file
+	bool sndDataExtComp;// flag mean that sound data is compressed by scummvm tools
+	int32 soundPriority;// priority level of played sound (0-127)
+	int32 regionOffset; // offset to sound data relative to begining of current region
+	int32 dataOffset;	// offset to sound data relative to begining of 'DATA' chunk
+	int32 curRegion;	// id of current used region
+	int32 curHookId;	// id of current used hook id
+	int32 volGroupId;	// id of volume group (IMUSE_VOLGRP_VOICE, IMUSE_VOLGRP_SFX, IMUSE_VOLGRP_MUSIC)
+	int32 soundType;	// type of sound data (kSpeechSoundType, kSFXSoundType, kMusicSoundType)
+	int32 feedSize;		// size of sound data needed to be filled at each callback iteration
+	int32 dataMod12Bit;	// value used between all callback to align 12 bit source of data
+	int32 mixerFlags;	// flags for sound mixer's channel (kFlagStereo, kFlag16Bits, kFlagReverseStereo, kFlagUnsigned, kFlagLittleEndian)
+
+	ImuseDigiSndMgr::SoundDesc *soundDesc;	// sound handle used by iMuse sound manager
+	Audio::SoundHandle mixChanHandle;					// sound mixer's channel handle
+	Audio::AppendableAudioStream *stream;		// sound mixer's audio stream handle for *.la1 and *.bun
+
+	Track() : soundId(-1), used(false), stream(NULL) {
+	}
+	
+	int getPan() const { return (pan != 64) ? 2 * pan - 127 : 0; }
+	int getVol() const { return vol / 1000; }
+	Audio::Mixer::SoundType getType() const {
+		Audio::Mixer::SoundType type = Audio::Mixer::kPlainSoundType;
+		if (volGroupId == 1)
+			type = Audio::Mixer::kSpeechSoundType;
+		else if (volGroupId == 2)
+			type = Audio::Mixer::kSFXSoundType;
+		else if (volGroupId == 3)
+			type = Audio::Mixer::kMusicSoundType;
+		return type;
+	}
+};
+
+} // End of namespace Scumm
+
+#endif


Property changes on: scummvm/trunk/engines/scumm/imuse_digi/dimuse_track.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Date Rev Author URL Id
Name: svn:eol-style
   + native


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