[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,NONE,1.1 actor.cpp,1.2,1.3 costume.cpp,1.2,1.3 imuse.cpp,1.7,1.8 resource.cpp,1.3,1.4 saveload.cpp,1.6,1.7 script_v1.cpp,1.4,1.5 script_v2.cpp,1.4,1.5 scumm.h,1.7,1.8 scummvm.cpp,1.6,1.7 sound.h,1.1.1.1,1.2 string.cpp,1.1.1.1,1.2

Max Horn fingolfin at users.sourceforge.net
Thu Aug 29 16:46:03 CEST 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv18651/scumm

Modified Files:
	actor.cpp costume.cpp imuse.cpp resource.cpp saveload.cpp 
	script_v1.cpp script_v2.cpp scumm.h scummvm.cpp sound.h 
	string.cpp 
Added Files:
	sound.cpp 
Log Message:
sound system cleanup

--- NEW FILE: sound.cpp ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001  Ludvig Strigeus
 * Copyright (C) 2001/2002 The ScummVM project
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Header: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v 1.1 2002/08/29 23:45:15 fingolfin Exp $
[...1166 lines suppressed...]
int Sound::pollMP3CD() {
	if (_mp3_cd_playing == true)
		return 1;
	return 0;
}

int Sound::updateMP3CD() {
	if (_mp3_cd_playing == false)
		return -1;

	if (_scumm->_mixer->_channels[_mp3_index] == NULL) {
		warning("Error in MP3 decoding");
		return -1;
	}

	if (_scumm->_mixer->_channels[_mp3_index]->soundFinished())
		stopMP3CD();
	return 0;
}
#endif

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- actor.cpp	23 Aug 2002 22:46:09 -0000	1.2
+++ actor.cpp	29 Aug 2002 23:45:15 -0000	1.3
@@ -26,6 +26,7 @@
 #include "akos.h"
 #include "costume.h"
 #include "resource.h"
+#include "scumm/sound.h"
 
 #include <math.h>
 

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- costume.cpp	24 Aug 2002 13:06:44 -0000	1.2
+++ costume.cpp	29 Aug 2002 23:45:15 -0000	1.3
@@ -24,6 +24,7 @@
 #include "scumm.h"
 #include "actor.h"
 #include "costume.h"
+#include "scumm/sound.h"
 
 const byte revBitMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
 

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- imuse.cpp	25 Aug 2002 15:06:53 -0000	1.7
+++ imuse.cpp	29 Aug 2002 23:45:15 -0000	1.8
@@ -25,6 +25,7 @@
 #include "sound/mididrv.h"
 #include "scumm/imuse.h"
 #include "scumm/saveload.h"
+#include "scumm/sound.h"
 
 /*
  * Some constants

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- resource.cpp	29 Aug 2002 20:01:25 -0000	1.3
+++ resource.cpp	29 Aug 2002 23:45:15 -0000	1.4
@@ -23,6 +23,7 @@
 #include "stdafx.h"
 #include "scumm.h"
 #include "resource.h"
+#include "scumm/sound.h"
 
 #include <stdio.h>
 

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- saveload.cpp	29 Aug 2002 20:01:26 -0000	1.6
+++ saveload.cpp	29 Aug 2002 23:45:15 -0000	1.7
@@ -23,6 +23,7 @@
 #include "stdafx.h"
 #include "scumm.h"
 #include "sound/mididrv.h"
+#include "scumm/sound.h"
 #include "scumm/imuse.h"
 #include "actor.h"
 #include "config-file.h"

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v1.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- script_v1.cpp	29 Aug 2002 20:01:26 -0000	1.4
+++ script_v1.cpp	29 Aug 2002 23:45:15 -0000	1.5
@@ -23,6 +23,7 @@
 #include "stdafx.h"
 #include "scumm.h"
 #include "actor.h"
+#include "scumm/sound.h"
 
 void Scumm::setupOpcodes()
 {
@@ -2717,15 +2718,9 @@
 				if (_gameId == GID_LOOM256) {
 					_vars[VAR_MI1_TIMER] = 0;
 					if (offset == 0 && delay == 0) {
-#ifdef COMPRESSED_SOUND_FILE
-						if (_sound->stopMP3CD() == -1)
-#endif
-							_system->stop_cdrom();
+						_sound->stopCD();
 					} else {
-#ifdef COMPRESSED_SOUND_FILE
-						if (_sound->playMP3CDTrack(1, 0, offset, delay) == -1)
-#endif
-							_system->play_cdrom(1, 0, offset, delay);
+						_sound->playCDTrack(1, 0, offset, delay);
 					}
 				} else {
 					warning("parseString: 8");

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- script_v2.cpp	29 Aug 2002 20:01:26 -0000	1.4
+++ script_v2.cpp	29 Aug 2002 23:45:15 -0000	1.5
@@ -28,6 +28,7 @@
 #include "smush/scumm_renderer.h"
 
 #include "sound/mididrv.h"
+#include "scumm/sound.h"
 #include "scumm/imuse.h"
 
 void Scumm::setupOpcodes2()

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- scumm.h	29 Aug 2002 20:01:26 -0000	1.7
+++ scumm.h	29 Aug 2002 23:45:15 -0000	1.8
@@ -26,7 +26,6 @@
 #include "engine.h"
 #include "bundle.h"
 #include "timer.h"
-#include "sound.h"
 
 #define SCUMMVM_VERSION "0.2.2 CVS"
 #define SCUMMVM_CVS "2002-08-21"
@@ -40,6 +39,7 @@
 class Scumm;
 class IMuse;
 class Actor;
+class Sound;
 struct ScummDebugger;
 struct Serializer;
 struct FindObjectInRoom;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- scummvm.cpp	29 Aug 2002 20:01:27 -0000	1.6
+++ scummvm.cpp	29 Aug 2002 23:45:15 -0000	1.7
@@ -24,6 +24,7 @@
 #include "scumm.h"
 #include "sound/mixer.h"
 #include "sound/mididrv.h"
+#include "scumm/sound.h"
 #include "scumm/imuse.h"
 #include "actor.h"
 #include "debug.h"
@@ -1383,10 +1384,7 @@
 				break;
 			}
 		}
-#ifdef COMPRESSED_SOUND_FILE
-		if (_sound->updateMP3CD() == -1)
-#endif
-			_system->update_cdrom(); /* Loop CD Audio if needed */
+		_sound->updateCD(); // Loop CD Audio if needed
 		if (_system->get_msecs() >= start_time + msec_delay)
 			break;
 		_system->delay_msecs(10);

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- sound.h	21 Aug 2002 16:07:35 -0000	1.1.1.1
+++ sound.h	29 Aug 2002 23:45:15 -0000	1.2
@@ -122,6 +122,12 @@
 	int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned);
 	int playSfxSound_MP3(void *sound, uint32 size);
 
+	void playCDTrack(int track, int num_loops, int start, int delay);
+	void stopCD();
+	int pollCD();
+	void updateCD();
+
+protected:
 #ifdef COMPRESSED_SOUND_FILE
 	int getCachedTrack(int track);
 	int playMP3CDTrack(int track, int num_loops, int start, int delay);
@@ -129,7 +135,6 @@
 	int pollMP3CD();
 	int updateMP3CD();
 #endif
-
 };
 
 #endif

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- string.cpp	21 Aug 2002 16:07:36 -0000	1.1.1.1
+++ string.cpp	29 Aug 2002 23:45:15 -0000	1.2
@@ -23,6 +23,7 @@
 #include "stdafx.h"
 #include "scumm.h"
 #include "actor.h"
+#include "scumm/sound.h"
 
 int CharsetRenderer::getStringWidth(int arg, byte *text, int pos)
 {





More information about the Scummvm-git-logs mailing list