shithub: choc

Download patch

ref: 96495a0ac6e1663ef0a6b137a24f73d46a039e52
parent: d5794db799a0aa47c227bf4e12b4ddaf2b4415ec
author: Simon Howard <fraggle@gmail.com>
date: Sun Jan 8 12:51:53 EST 2006

Add S_MusicPlaying function to query if music is still playing.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 271

--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_sound.c 257 2006-01-07 16:26:50Z fraggle $
+// $Id: i_sound.c 271 2006-01-08 17:51:53Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.24  2006/01/08 17:51:53  fraggle
+// Add S_MusicPlaying function to query if music is still playing.
+//
 // Revision 1.23  2006/01/07 16:26:50  fraggle
 // Fix the behavior when expanding sound effects (again).  Doom actually
 // does play sounds of any sample rate, but the sound effects in
@@ -116,7 +119,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_sound.c 257 2006-01-07 16:26:50Z fraggle $";
+rcsid[] = "$Id: i_sound.c 271 2006-01-08 17:51:53Z fraggle $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -728,7 +731,7 @@
 }
 
 // Is the song playing?
-int I_QrySongPlaying(void *handle)
+boolean I_QrySongPlaying(void *handle)
 {
     if (!music_initialised)
         return false;
--- a/src/i_sound.h
+++ b/src/i_sound.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_sound.h 75 2005-09-05 22:50:56Z fraggle $
+// $Id: i_sound.h 271 2006-01-08 17:51:53Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -123,6 +123,7 @@
 
 void I_UnRegisterSong(void *handle);
 
+boolean I_QrySongPlaying(void *handle);
 
 
 #endif
@@ -129,6 +130,9 @@
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.6  2006/01/08 17:51:53  fraggle
+// Add S_MusicPlaying function to query if music is still playing.
+//
 // Revision 1.5  2005/09/05 22:50:56  fraggle
 // Add mmus2mid code from prboom.  Use 'void *' for music handles.  Pass
 // length of data when registering music.
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: s_sound.c 203 2005-10-16 16:16:03Z fraggle $
+// $Id: s_sound.c 271 2006-01-08 17:51:53Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.10  2006/01/08 17:51:53  fraggle
+// Add S_MusicPlaying function to query if music is still playing.
+//
 // Revision 1.9  2005/10/16 16:16:03  fraggle
 // Set the default number of channels to a more sensible 8
 //
@@ -61,7 +64,7 @@
 
 
 static const char
-rcsid[] = "$Id: s_sound.c 203 2005-10-16 16:16:03Z fraggle $";
+rcsid[] = "$Id: s_sound.c 271 2006-01-08 17:51:53Z fraggle $";
 
 
 
@@ -709,7 +712,12 @@
     mus_playing = music;
 }
 
+boolean S_MusicPlaying(void)
+{
+    return I_QrySongPlaying(NULL);
+}
 
+
 void S_StopMusic(void)
 {
     if (mus_playing)
@@ -725,9 +733,6 @@
 	mus_playing = 0;
     }
 }
-
-
-
 
 void S_StopChannel(int cnum)
 {
--- a/src/s_sound.h
+++ b/src/s_sound.h
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: s_sound.h 18 2005-07-23 18:56:07Z fraggle $
+// $Id: s_sound.h 271 2006-01-08 17:51:53Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -88,6 +88,9 @@
 ( int		music_id,
   int		looping );
 
+// query if music is playing
+boolean S_MusicPlaying(void);
+
 // Stops the music fer sure.
 void S_StopMusic(void);
 
@@ -109,6 +112,9 @@
 //-----------------------------------------------------------------------------
 //
 // $Log$
+// Revision 1.4  2006/01/08 17:51:53  fraggle
+// Add S_MusicPlaying function to query if music is still playing.
+//
 // Revision 1.3  2005/07/23 18:56:07  fraggle
 // Remove unneccessary pragmas
 //