[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.11,1.12 mixer.h,1.5,1.6
James Brown
ender at users.sourceforge.net
Wed Oct 2 03:13:38 CEST 2002
Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv16220/sound
Modified Files:
mixer.cpp mixer.h
Log Message:
Fix 'isSoundRunning' for Creative samples (eg, Full Throttle)
Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- mixer.cpp 1 Oct 2002 18:11:30 -0000 1.11
+++ mixer.cpp 2 Oct 2002 10:12:19 -0000 1.12
@@ -84,11 +84,21 @@
return index;
}
-int SoundMixer::playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate,
- byte flags) {
+int SoundMixer::playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags) {
for (int i = 0; i != NUM_CHANNELS; i++) {
if (_channels[i] == NULL) {
- return insertAt(handle, i, new ChannelRaw(this, sound, size, rate, flags));
+ return insertAt(handle, i, new ChannelRaw(this, sound, size, rate, flags, -1));
+ }
+ }
+
+ warning("SoundMixer::out of mixer slots");
+ return -1;
+}
+
+int SoundMixer::playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags, int id) {
+ for (int i = 0; i != NUM_CHANNELS; i++) {
+ if (_channels[i] == NULL) {
+ return insertAt(handle, i, new ChannelRaw(this, sound, size, rate, flags, id));
}
}
@@ -239,8 +249,8 @@
}
/* RAW mixer */
-SoundMixer::ChannelRaw::ChannelRaw(SoundMixer * mixer, void * sound, uint32 size, uint rate,
- byte flags) {
+SoundMixer::ChannelRaw::ChannelRaw(SoundMixer * mixer, void * sound, uint32 size, uint rate, byte flags, int id) {
+ _id = id;
_mixer = mixer;
_flags = flags;
_ptr = sound;
Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- mixer.h 14 Sep 2002 12:12:25 -0000 1.5
+++ mixer.h 2 Oct 2002 10:12:19 -0000 1.6
@@ -41,6 +41,7 @@
class Channel {
public:
bool _toBeDestroyed;
+ int _id;
virtual void mix(int16 *data, uint len) = 0;
void destroy() {
_toBeDestroyed = true;
@@ -63,7 +64,7 @@
byte _flags;
public:
- ChannelRaw(SoundMixer * mixer, void * sound, uint32 size, uint rate, byte flags);
+ ChannelRaw(SoundMixer * mixer, void * sound, uint32 size, uint rate, byte flags, int id);
void mix(int16 * data, uint len);
void realDestroy();
@@ -178,6 +179,7 @@
FLAG_FILE = 16, /* sound is a FILE * that's read from */
};
int playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags);
+ int playRaw(PlayingSoundHandle * handle, void * sound, uint32 size, uint rate, byte flags, int id);
int playStream(PlayingSoundHandle * handle, int index, void * sound, uint32 size, uint rate,
byte flags);
#ifdef COMPRESSED_SOUND_FILE
More information about the Scummvm-git-logs
mailing list