[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11010] branches/soc-2007-hcube/intern/ tinySND/sdl: Added isEnabled method.

Csaba Hruska csaba.hruska at gmail.com
Fri Jun 22 18:58:57 CEST 2007


Revision: 11010
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11010
Author:   hcube
Date:     2007-06-22 18:58:56 +0200 (Fri, 22 Jun 2007)

Log Message:
-----------
Added isEnabled method.

Modified Paths:
--------------
    branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp
    branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.h

Modified: branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp	2007-06-22 16:58:13 UTC (rev 11009)
+++ branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.cpp	2007-06-22 16:58:56 UTC (rev 11010)
@@ -48,7 +48,7 @@
        return false;
     }
     
-    SDL_PauseAudio(1);
+	disable();
     return true;
 }
 
@@ -66,13 +66,20 @@
     return true;
 }
 
+bool SDLDevice::isEnabled(void)
+{
+	return mIsEnabled;
+}
+
 void SDLDevice::enable(void)
 {
+	mIsEnabled = true;
     SDL_PauseAudio(0);
 }
 
 void SDLDevice::disable(void)
 {
+	mIsEnabled = false;
     SDL_PauseAudio(1);
 }
 
@@ -109,7 +116,7 @@
 		{
 		    if( buffer[j] != 0 )
 		    {
-				stream[0] = (Sint16)buffer[j][0];
+				stream[0] = (Sint16)(buffer[j][0]*32767.0);
 				buffer[j]++;
 		    }
 			else

Modified: branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.h
===================================================================
--- branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.h	2007-06-22 16:58:13 UTC (rev 11009)
+++ branches/soc-2007-hcube/intern/tinySND/sdl/SDLDevice.h	2007-06-22 16:58:56 UTC (rev 11010)
@@ -11,6 +11,7 @@
     bool    initialize();
     bool    finalize();
 
+	bool	isEnabled();
 	void	enable();
 	void	disable();
 
@@ -28,6 +29,7 @@
 private:
     SDL_AudioSpec   	mAudioSpec;
     SND_SoundInterface *mSounds[6];
+	bool				mIsEnabled;
     
     
 };





More information about the Bf-blender-cvs mailing list