[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] SF.net SVN: supercollider:[8288] trunk/build/SCClassLibrary/Common



Revision: 8288
          http://supercollider.svn.sourceforge.net/supercollider/?rev=8288&view=rev
Author:   jrhb
Date:     2008-12-25 13:59:10 +0000 (Thu, 25 Dec 2008)

Log Message:
-----------
added setVolumeRange message to Volume, server window updates automatically.

Modified Paths:
--------------
    trunk/build/SCClassLibrary/Common/Control/Volume.sc
    trunk/build/SCClassLibrary/Common/GUI/PlusGUI/Control/ServerPlusGUI.sc

Modified: trunk/build/SCClassLibrary/Common/Control/Volume.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/Control/Volume.sc	2008-12-25 13:58:20 UTC (rev 8287)
+++ trunk/build/SCClassLibrary/Common/Control/Volume.sc	2008-12-25 13:59:10 UTC (rev 8288)
@@ -160,13 +160,13 @@
 				this.playVolume(isMuted);
 			})
 		});
-		volume = volume.clip(min, max);
+		volume = volume.clip(-90, 6);	
 		if(isMuted) { muteamp = volume };
 		if(isPlaying && isMuted.not) { ampSynth.set(\volumeAmp, volume.dbamp) };
 		this.changed(\amp, volume);
 	}
 	
-	playVolume {arg muted = false;
+	playVolume { arg muted = false;
 		(this.isPlaying.not and: {
 			(volume != 0.0) or: {muted}
 		}).if({
@@ -174,13 +174,19 @@
 		})
 	}
 			
-	lag_ {arg aLagTime;
+	lag_ { arg aLagTime;
 		lag = aLagTime;
 		ampSynth.set(\volumeLag, lag);
 	}
+	
+	setVolumeRange { arg argMin, argMax;
+		argMin !? { min = argMin };
+		argMax !? { max = argMax };
+		this.changed(\ampRange, min, max);
+	}
 		
 	
-	gui {arg window, bounds;
+	gui { arg window, bounds;
 //		this.debug(\gui);
 		^VolumeGui(this, window, bounds)	
 	}
@@ -221,6 +227,10 @@
 					box.value_(volume.round(0.01)) ;
 					slider.value_(spec.unmap(volume)) ;
 				})
+				.put(\ampRange, {|changer, what, min, max|
+					spec = [min, max, \db].asSpec.debug;
+					slider.value_(spec.unmap(model.volume)) ;
+				})
 	}
 }
 

Modified: trunk/build/SCClassLibrary/Common/GUI/PlusGUI/Control/ServerPlusGUI.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/PlusGUI/Control/ServerPlusGUI.sc	2008-12-25 13:58:20 UTC (rev 8287)
+++ trunk/build/SCClassLibrary/Common/GUI/PlusGUI/Control/ServerPlusGUI.sc	2008-12-25 13:59:10 UTC (rev 8288)
@@ -287,7 +287,11 @@
 					{
 						muteButton.value_(flag.binaryValue);
 					}.defer		
-				})				
+				})
+				.put(\ampRange, {|changer, what, min, max|
+					volSpec = [min, max, \db].asSpec;
+					volumeSlider.value_(volSpec.unmap(volume.volume));
+				})			
 					
 		}.value;
 		};


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/