OSDN Git Service

Add API call to play a sound with looping, and support in dsound and openal backends
[cinnamon-audio/cinnamon.git] / src / cinnamon.h
index 1a268a6..fe451b9 100755 (executable)
@@ -102,8 +102,29 @@ enum Cin_SoundError {
  */
 CIN_EXPORT(unsigned) Cin_StructSoundSize();
 
+/**
+ * @brief Causes a sound to play.
+ *
+ * This will trigger the sound to play without looping.
+ *
+ * Calling play on a sound that is already playing will do nothing. To restart
+ * a sound, use Cin_SoundStop first.
+ */
 CIN_EXPORT(enum Cin_SoundError) Cin_SoundPlay(struct Cin_Sound *snd);
 
+/**
+ * @brief Causes a sound to play with optional looping.
+ *
+ * The sound will loop if the loop param is non-zero.
+ *
+ * Calling play on a sound that is already playing will do nothing. To restart
+ * a sound, use Cin_SoundStop first.
+ *
+ * @sa Cin_SoundPlay
+ */
+CIN_EXPORT(enum Cin_SoundError) Cin_SoundPlayLoop(struct Cin_Sound *snd,
+    int loop);
+
 CIN_EXPORT(enum Cin_SoundError) Cin_SoundStop(struct Cin_Sound *snd);
 
 CIN_EXPORT(void) Cin_DestroySound(struct Cin_Sound *snd);