diff ALmixer.h @ 44:56855942fdc6

Split off background thread (threads only) termination and creation into separate functions from Interruption handling to make it easier to avoid race condition bug with Apple rdar://10081775 w.r.t. setting the OpenAL context. New APIs to suspend and resume update threads. Interruption handling calls these automatically. Also partially regressed simplification with regards to getting the current playing state in the main update loop.
author Eric Wing <ewing@anscamobile.com>
date Tue, 13 Sep 2011 18:03:21 -0700
parents 05e5dc4817a4
children e2687188aea5
line wrap: on
line diff
--- a/ALmixer.h	Tue Aug 30 19:42:31 2011 -0700
+++ b/ALmixer.h	Tue Sep 13 18:03:21 2011 -0700
@@ -372,14 +372,14 @@
 /**
  * (EXPERIMENTAL) Call to notify ALmixer that your device needs to handle an interruption.
  * (EXPERIMENTAL) For devices like iOS that need special handling for interruption events like phone calls and alarms,
- * this function will do the correct platform correct thing to handle the interruption w.r.t. OpenAL.
+ * this function will do the correct platform correct thing to handle the interruption w.r.t. OpenAL. This calls ALmixer_SuspendUpdates().
  */
 extern ALMIXER_DECLSPEC void ALMIXER_CALL ALmixer_BeginInterruption(void);
 
 /**
  * (EXPERIMENTAL) Call to notify ALmixer that your device needs to resume from an interruption.
  * (EXPERIMENTAL) For devices like iOS that need special handling for interruption events like phone calls and alarms,
- * this function will do the correct platform correct thing to resume from the interruption w.r.t. OpenAL.
+ * this function will do the correct platform correct thing to resume from the interruption w.r.t. OpenAL. This calls ALmixer_ResumeUpdates().
  */
 extern ALMIXER_DECLSPEC void ALMIXER_CALL ALmixer_EndInterruption(void);
 
@@ -390,6 +390,24 @@
  */	
 extern ALMIXER_DECLSPEC ALboolean ALmixer_IsInInterruption(void);
 
+
+/**
+ * (EXPERIMENTAL) Destroys the background update thread (ENABLE_ALMIXER_THREADS only). 
+ * (EXPERIMENTAL) Destroys the background update thread (ENABLE_ALMIXER_THREADS only). BeginInterruption used to do this internally, but this was split off due to an iOS OpenAL race condition bug (10081775). Being able to manipulate the thread without manipulating the context was useful for suspend/resume backgrounding when not dealing with a full-blown interruption event.
+ */
+extern ALMIXER_DECLSPEC void ALMIXER_CALL ALmixer_SuspendUpdates(void);
+
+/**
+ * (EXPERIMENTAL) Recreates the background update thread (ENABLE_ALMIXER_THREADS only). 
+ * (EXPERIMENTAL) Recreates the background update thread (ENABLE_ALMIXER_THREADS only). EndInterruption used to do this internally, but this was split off due to an iOS OpenAL race condition bug (10081775). Being able to manipulate the thread without manipulating the context was useful for suspend/resume backgrounding when not dealing with a full-blown interruption event.
+ */
+extern ALMIXER_DECLSPEC void ALMIXER_CALL ALmixer_ResumeUpdates(void);
+
+/**
+ * (EXPERIMENTAL) Call to determine if in ALmixer_SuspendUpdates(). (ENABLE_ALMIXER_THREADS only.)
+ */
+extern ALMIXER_DECLSPEC ALboolean ALmixer_AreUpdatesSuspended(void);
+
 	
 /**
  * This shuts down ALmixer. Please remember to free your ALmixer_Data* instances