[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src include/sound.h sound/music.c sou...
From: |
Jimmy Salmon |
Subject: |
[Stratagus-CVS] stratagus/src include/sound.h sound/music.c sou... |
Date: |
Fri, 31 Oct 2003 16:56:30 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Jimmy Salmon <address@hidden> 03/10/31 16:56:30
Modified files:
src/include : sound.h
src/sound : music.c sound_server.c
Log message:
PlayMusic returns 1 if music is playing, 0 if not
Patches:
Index: stratagus/src/include/sound.h
diff -u stratagus/src/include/sound.h:1.46 stratagus/src/include/sound.h:1.47
--- stratagus/src/include/sound.h:1.46 Fri Oct 31 01:18:56 2003
+++ stratagus/src/include/sound.h Fri Oct 31 16:56:28 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: sound.h,v 1.46 2003/10/31 06:18:56 jsalmon3 Exp $
+// $Id: sound.h,v 1.47 2003/10/31 21:56:28 jsalmon3 Exp $
#ifndef __SOUND_H__
#define __SOUND_H__
@@ -151,7 +151,7 @@
/// Play a sample file
extern void PlayFile(char* name);
/// Play a music file
-extern void PlayMusic(const char* name);
+extern int PlayMusic(const char* name);
/// Stop music playing
extern void StopMusic(void);
@@ -179,7 +179,7 @@
#define InitSoundClient() /// Dummy macro for without sound
#define PlayFile(v) /// Dummy macro for without sound
-#define PlayMusic(v) /// Dummy macro for without sound
+#define PlayMusic(v) 0 /// Dummy macro for without sound
#define StopMusic() /// Dummy macro for without sound
#define CallbackMusicOn() /// Dummy macro for without sound
#define CallbackMusicOff() /// Dummy macro for without sound
Index: stratagus/src/sound/music.c
diff -u stratagus/src/sound/music.c:1.82 stratagus/src/sound/music.c:1.83
--- stratagus/src/sound/music.c:1.82 Wed Oct 1 17:01:00 2003
+++ stratagus/src/sound/music.c Fri Oct 31 16:56:29 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: music.c,v 1.82 2003/10/01 21:01:00 jsalmon3 Exp $
+// $Id: music.c,v 1.83 2003/10/31 21:56:29 jsalmon3 Exp $
//@{
@@ -326,8 +326,10 @@
**
** @param name Name of sound file, format is automatic detected.
** Names starting with ':' control the cdrom.
+**
+** @return 1 if music is playing, 0 if not.
*/
-global void PlayMusic(const char* name)
+global int PlayMusic(const char* name)
{
char buffer[PATH_MAX];
#if defined(USE_OGG) || defined(USE_FLAC) || defined(USE_MAD) ||
defined(USE_LIBMODPLUG)
@@ -335,7 +337,7 @@
#endif
if (MusicOff) {
- return;
+ return 0;
}
if (CurrentMusicFile) {
@@ -349,7 +351,7 @@
StopMusic();
MusicSample = sample;
PlayingMusic = 1;
- return;
+ return 1;
}
#ifdef USE_OGG
@@ -358,12 +360,12 @@
sample->SampleSize != 16) {
DebugLevel0Fn("Not supported music format\n");
SoundFree(sample);
- return;
+ return 0;
}
StopMusic();
MusicSample = sample;
PlayingMusic = 1;
- return;
+ return 1;
}
#endif
#ifdef USE_MAD
@@ -377,7 +379,7 @@
StopMusic();
MusicSample = sample;
PlayingMusic = 1;
- return;
+ return 1;
}
#endif
#ifdef USE_FLAC
@@ -393,16 +395,17 @@
StopMusic();
MusicSample = sample;
PlayingMusic = 1;
- return;
+ return 1;
}
#endif
#ifdef USE_LIBMODPLUG
if ((sample = LoadMod(name, PlayAudioStream))) {
MusicSample = sample;
PlayingMusic = 1;
- return;
+ return 1;
}
#endif
+ return 0;
}
/**
Index: stratagus/src/sound/sound_server.c
diff -u stratagus/src/sound/sound_server.c:1.123
stratagus/src/sound/sound_server.c:1.124
--- stratagus/src/sound/sound_server.c:1.123 Fri Oct 31 15:39:40 2003
+++ stratagus/src/sound/sound_server.c Fri Oct 31 16:56:29 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: sound_server.c,v 1.123 2003/10/31 20:39:40 jsalmon3 Exp $
+// $Id: sound_server.c,v 1.124 2003/10/31 21:56:29 jsalmon3 Exp $
//@{
@@ -205,8 +205,9 @@
#else
/// Dummy functions if no music support is enabled
-global void PlayMusic(const char* name __attribute__((unused)))
+global int PlayMusic(const char* name __attribute__((unused)))
{
+ return 0;
}
/// Dummy functions if no music support is enabled
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src include/sound.h sound/music.c sou...,
Jimmy Salmon <=