[Tux4kids-commits] r1528 - branches/commonification/tux4kids-common/trunk/t4kcommon

Matthew Trey treymd-guest at alioth.debian.org
Sat Sep 12 00:03:09 UTC 2009


Author: treymd-guest
Date: 2009-09-12 00:03:04 +0000 (Sat, 12 Sep 2009)
New Revision: 1528

Modified:
   branches/commonification/tux4kids-common/trunk/t4kcommon/t4k-audio.c
   branches/commonification/tux4kids-common/trunk/t4kcommon/tux4kids-common.h
Log:
Added PlaySoundLoop() and AudioHaltChannel() to t4k-audio for future compatibility

Modified: branches/commonification/tux4kids-common/trunk/t4kcommon/t4k-audio.c
===================================================================
--- branches/commonification/tux4kids-common/trunk/t4kcommon/t4k-audio.c	2009-09-11 21:00:06 UTC (rev 1527)
+++ branches/commonification/tux4kids-common/trunk/t4kcommon/t4k-audio.c	2009-09-12 00:03:04 UTC (rev 1528)
@@ -26,12 +26,24 @@
 
 static Mix_Music *default_music = NULL;
 
+// play sound once and exit
 void PlaySound(Mix_Chunk* sound)
 {
-  if(sound)
-    Mix_PlayChannel(-1, sound, 0);
+   PlaySoundLoop(sound, 0);
 }
 
+// play sound "loops" times, -1 for infinite
+void PlaySoundLoop(Mix_Chunk* sound, int loops)
+{
+   if(sound)
+    Mix_PlayChannel(-1, sound, loops);
+}
+
+void audioHaltChannel( int channel )
+{
+      Mix_HaltChannel(channel);
+}
+
 /* audioMusicLoad attempts to load and play the music file
  * Note: loops == -1 means forever
  */

Modified: branches/commonification/tux4kids-common/trunk/t4kcommon/tux4kids-common.h
===================================================================
--- branches/commonification/tux4kids-common/trunk/t4kcommon/tux4kids-common.h	2009-09-11 21:00:06 UTC (rev 1527)
+++ branches/commonification/tux4kids-common/trunk/t4kcommon/tux4kids-common.h	2009-09-12 00:03:04 UTC (rev 1528)
@@ -160,6 +160,8 @@
 /* from tk4-loaders.c */
 
 void            PlaySound(Mix_Chunk* sound);
+void            PlaySoundLoop(Mix_Chunk* sound, int loops);
+void            AudioHaltChannel( int channel );
 void            AudioMusicLoad(char* music_path, int loops);
 void            AudioMusicUnload();
 bool            IsPlayingMusic();




More information about the Tux4kids-commits mailing list