foxygit / doom Log in
commit 96495a0ac6e1663ef0a6b137a24f73d46a039e52
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Jan 8 17:51:53 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sun Jan 8 17:51:53 2006 +0000

    Add S_MusicPlaying function to query if music is still playing.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 271
---
 src/i_sound.c |  9 ++++++---
 src/i_sound.h |  6 +++++-
 src/s_sound.c | 15 ++++++++++-----
 src/s_sound.h |  8 +++++++-
 4 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/src/i_sound.c b/src/i_sound.c
index 0c0322b5..127720d1 100644
--- 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 @@ void *I_RegisterSong(void *data, int len)
 }

 // Is the song playing?
-int I_QrySongPlaying(void *handle)
+boolean I_QrySongPlaying(void *handle)
 {
     if (!music_initialised)
         return false;
diff --git a/src/i_sound.h b/src/i_sound.h
index 53d3ef66..3204fd76 100644
--- 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,12 +123,16 @@ void I_StopSong(void *handle);

 void I_UnRegisterSong(void *handle);

+boolean I_QrySongPlaying(void *handle);


 #endif
 //-----------------------------------------------------------------------------
 //
 // $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.
diff --git a/src/s_sound.c b/src/s_sound.c
index d6e6dfdf..7e95cb44 100644
--- 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,6 +712,11 @@ S_ChangeMusic
     mus_playing = music;
 }

+boolean S_MusicPlaying(void)
+{
+    return I_QrySongPlaying(NULL);
+}
+

 void S_StopMusic(void)
 {
@@ -726,9 +734,6 @@ void S_StopMusic(void)
     }
 }

-
-
-
 void S_StopChannel(int cnum)
 {

diff --git a/src/s_sound.h b/src/s_sound.h
index 1b919b59..08b3ca69 100644
--- 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 @@ S_ChangeMusic
 ( 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 @@ void S_SetSfxVolume(int volume);
 //-----------------------------------------------------------------------------
 //
 // $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
 //