Browse Source

Added some EM ifdefs.

Mark Sibly 9 years ago
parent
commit
edf6ee4a0f
2 changed files with 15 additions and 5 deletions
  1. 5 1
      bananas/audiotest/audiotest.monkey2
  2. 10 4
      modules/mojo/audio/audio.monkey2

+ 5 - 1
bananas/audiotest/audiotest.monkey2

@@ -21,10 +21,13 @@ Class MyWindow Extends Window
 		sound=Sound.Load( "asset::fine_morning.ogg" )
 		sound=Sound.Load( "asset::fine_morning.ogg" )
 		channel=New Channel
 		channel=New Channel
 		
 		
+#if __TARGET__<>"emscripten"	
 		'SineWave()
 		'SineWave()
+#endif
 		
 		
 	End
 	End
-	
+
+#if __TARGET__<>"emscripten"	
 	Method SineWave()
 	Method SineWave()
 	
 	
 		New Fiber( Lambda()
 		New Fiber( Lambda()
@@ -54,6 +57,7 @@ Class MyWindow Extends Window
 			
 			
 		End )
 		End )
 	End
 	End
+#endif
 	
 	
 	Method OnRender( canvas:Canvas ) Override
 	Method OnRender( canvas:Canvas ) Override
 	
 	

+ 10 - 4
modules/mojo/audio/audio.monkey2

@@ -248,11 +248,11 @@ Class Channel
 		
 		
 		alSourcePlay( _alSource )
 		alSourcePlay( _alSource )
 	End
 	End
-	
+
+	#if __TARGET__<>"emscripten"
+
 	#rem monkeydoc @hidden - Highly experimental!!!!!
 	#rem monkeydoc @hidden - Highly experimental!!!!!
-	
 	#end
 	#end
-	
 	Method WaitQueued( queued:Int )
 	Method WaitQueued( queued:Int )
 	
 	
 		While _queued>queued
 		While _queued>queued
@@ -270,7 +270,6 @@ Class Channel
 	End
 	End
 	
 	
 	#rem monkeydoc @hidden - Highly experimental!!!!!
 	#rem monkeydoc @hidden - Highly experimental!!!!!
-	
 	#end
 	#end
 	Method Queue( data:AudioData )
 	Method Queue( data:AudioData )
 	
 	
@@ -309,6 +308,8 @@ Class Channel
 	
 	
 	End
 	End
 	
 	
+	#endif
+	
 	#rem monkeydoc Stops channel.
 	#rem monkeydoc Stops channel.
 	#end
 	#end
 	Method Stop()
 	Method Stop()
@@ -325,6 +326,9 @@ Class Channel
 	
 	
 	Field _tmpBuffers:Stack<ALuint>
 	Field _tmpBuffers:Stack<ALuint>
 	Field _freeBuffers:Stack<ALuint>
 	Field _freeBuffers:Stack<ALuint>
+	
+	#if __TARGET__<>"emscripten"
+	
 	Field _future:Future<Int>
 	Field _future:Future<Int>
 	Field _waiting:Bool
 	Field _waiting:Bool
 	Field _queued:Int
 	Field _queued:Int
@@ -358,6 +362,8 @@ Class Channel
 
 
 	End
 	End
 	
 	
+	#endif
+	
 	Method ALState:ALenum()
 	Method ALState:ALenum()
 		Local state:ALenum
 		Local state:ALenum
 		alGetSourcei( _alSource,AL_SOURCE_STATE,Varptr state )
 		alGetSourcei( _alSource,AL_SOURCE_STATE,Varptr state )