[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22860] branches/blender2.5/blender/source /blender/editors: 2.5: Added some sound actuator UI to reveal its real power, check it out! :)

Joerg Mueller nexyon at gmail.com
Sat Aug 29 16:53:01 CEST 2009


Revision: 22860
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22860
Author:   nexyon
Date:     2009-08-29 16:53:00 +0200 (Sat, 29 Aug 2009)

Log Message:
-----------
2.5: Added some sound actuator UI to reveal its real power, check it out! :)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/sound/sound_ops.c
    branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c

Modified: branches/blender2.5/blender/source/blender/editors/sound/sound_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sound/sound_ops.c	2009-08-29 11:48:38 UTC (rev 22859)
+++ branches/blender2.5/blender/source/blender/editors/sound/sound_ops.c	2009-08-29 14:53:00 UTC (rev 22860)
@@ -43,6 +43,7 @@
 #include "BKE_report.h"
 #include "BKE_packedFile.h"
 #include "BKE_sound.h"
+#include "BKE_utildefines.h"
 
 #include "BLI_blenlib.h"
 
@@ -86,6 +87,10 @@
 		return OPERATOR_CANCELLED;
 	}
 
+	if (RNA_boolean_get(op->ptr, "cache")) {
+		sound_cache(sound, 0);
+	}
+
 	return OPERATOR_FINISHED;
 }
 
@@ -110,6 +115,7 @@
 
 	/* properties */
 	WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE);
+	RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory.");
 }
 
 /* ******************************************************* */

Modified: branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c	2009-08-29 11:48:38 UTC (rev 22859)
+++ branches/blender2.5/blender/source/blender/editors/space_logic/logic_window.c	2009-08-29 14:53:00 UTC (rev 22860)
@@ -1990,7 +1990,7 @@
 			sa->sndnr = 0;
 			
 			if(sa->flag & ACT_SND_3D_SOUND)
-				ysize = 114;
+				ysize = 180;
 			else
 				ysize = 92;
 
@@ -2003,24 +2003,31 @@
 				/* reset this value, it is for handling the event */
 				sa->sndnr = 0;
 				uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, "");	
+				uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, "Load a sound file. Remember to set caching on for small sounds that are played often.");
 
 				if(sa->sound) {
 					char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4";
-					uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,width-40,19, sa->sound->id.name+2,    0.0, 21.0, 0, 0, "");
+					uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, sa->sound->id.name+2,    0.0, 21.0, 0, 0, "");
 					uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, "");
 					uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, 0.0,  1.0, 0, 0, "Sets the volume of this sound");
 					uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound");
 					uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space.");
 					if(sa->flag & ACT_SND_3D_SOUND)
 					{
-						uiDefButF(block, NUM, 0, "Rolloff: ", xco+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance.");
-						uiDefButF(block, NUM, 0, "Reference distance: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.reference_distance, 0.0, 1000.0, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0.");
+						uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away.");
+						uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, "The maximum gain of the sound, no matter how near it is..");
+						uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, 1000.0, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0.");
+						uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, 1000.0, 0.0, 0.0, "The maximum distance at which you can hear the sound.");
+						uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance.");
+						uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value und the normal gain in the inner cone.");
+						uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the outer cone.");
+						uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the inner cone.");
 					}
 				}
 				MEM_freeN(str);
 			} 
 			else {
-				uiDefBut(block, LABEL, 0, "Use Sound window (F10) to load samples", xco, yco-24, width, 19, NULL, 0, 0, 0, 0, "");
+				uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file.");
 			}
 					
 			yco-= ysize;





More information about the Bf-blender-cvs mailing list