[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] SF.net SVN: supercollider:[8313] trunk/build
Revision: 8313
http://supercollider.svn.sourceforge.net/supercollider/?rev=8313&view=rev
Author: jrhb
Date: 2008-12-27 22:24:33 +0000 (Sat, 27 Dec 2008)
Log Message:
-----------
added Andrew Pascoe's suggestion for setDeviation of a RangeSlider.
Modified Paths:
--------------
trunk/build/Help/GUI/Cocoa-GUI/SCRangeSlider.html
trunk/build/SCClassLibrary/Common/GUI/osx/Base/SCView.sc
Modified: trunk/build/Help/GUI/Cocoa-GUI/SCRangeSlider.html
===================================================================
--- trunk/build/Help/GUI/Cocoa-GUI/SCRangeSlider.html 2008-12-27 15:44:21 UTC (rev 8312)
+++ trunk/build/Help/GUI/Cocoa-GUI/SCRangeSlider.html 2008-12-27 22:24:33 UTC (rev 8313)
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
-<meta name="CocoaVersion" content="949.35">
+<meta name="CocoaVersion" content="949.43">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
@@ -17,28 +17,28 @@
p.p8 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica}
p.p9 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
-p.p11 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
-p.p12 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
-p.p13 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco}
-p.p14 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #516a24}
-p.p15 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000; min-height: 12.0px}
-p.p16 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
+p.p11 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
+p.p12 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco}
+p.p13 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; color: #57682a}
+p.p14 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d}
+p.p15 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
span.s1 {font: 18.0px Helvetica}
-span.s2 {color: #636a99}
-span.s3 {color: #485abb}
-span.s4 {color: #6c7188}
-span.s5 {color: #5f689f}
-span.s6 {color: #4357c0}
+span.s2 {color: #636b97}
+span.s3 {color: #485eb7}
+span.s4 {color: #6c7287}
+span.s5 {color: #5f6a9c}
+span.s6 {color: #435bbc}
span.s7 {color: #6f717a}
-span.s8 {color: #0000bf}
-span.s9 {color: #007300}
-span.s10 {color: #000000}
-span.s11 {font: 11.0px Monaco}
-span.s12 {font: 11.0px Monaco; color: #0018b8}
-span.s13 {font: 14.0px Helvetica}
-span.s14 {color: #6f7180}
+span.s8 {color: #001bb9}
+span.s9 {color: #2c7014}
+span.s10 {font: 11.0px Monaco}
+span.s11 {font: 11.0px Monaco; color: #0024b3}
+span.s12 {font: 14.0px Helvetica}
+span.s13 {color: #6f717f}
+span.s14 {color: #000000}
span.s15 {font: 9.0px Monaco}
-span.s16 {color: #606060}
+span.s16 {color: #0000bf}
+span.s17 {color: #606060}
span.Apple-tab-span {white-space:pre}
</style>
</head>
@@ -47,32 +47,32 @@
<p class="p2"><br></p>
<p class="p1"><b>Inherits from: </b><a href="../../Core/Object.html"><span class="s2"><b>Object</b></span></a><b> : </b><a href="SCView.html"><span class="s2"><b>SCView</b></span></a><b> : </b><a href="SCControlView.html"><span class="s3"><b>SCControlView</b></span></a><b> : </b><a href="SCSliderBase.html"><span class="s2"><b>SCSliderBase</b></span></a></p>
<p class="p3"><br></p>
-<p class="p1">A slider for setting two values (usually low and high values). Dragging in the slider sets the lo and high ranges according to mouse down and mouse up. To move the whole range, hold down the ctrl key while dragging. </span>Arrow keys will also move the whole range.</p>
+<p class="p1">A slider for setting two values (usually low and high values). Dragging in the slider sets the lo and high ranges according to mouse down and mouse up. To move the whole range, hold down the ctrl key while dragging. Arrow keys will also move the whole range.</p>
<p class="p2"><br></p>
<p class="p1"><b>See also:</b> <a href="../EZ-GUI/EZRanger.html"><span class="s2">EZRanger</span></a></p>
<p class="p2"><br></p>
-<p class="p4"><b>Some Important Issues Regarding SCRangeSlider</span></b></p>
+<p class="p4"><b>Some Important Issues Regarding SCRangeSlider</b></p>
<p class="p2"><br></p>
-<p class="p1">SCRangeSlider always has a range between zero and one. </span>You must scale the output and input values to your needs. Using <b>map</b> and <b>unmap,</b> combined with </span>a <a href="../../Control/Spec.html"><span class="s4">Spec</span></a>, are helpful for this. To set the increment or decrement value of the slider, set the <b>step</b> (see <a href="SCSliderBase.html"><span class="s4">SCSliderBase</span></a>) . </span>Drag and drop returns and accepts <a href="../../Geometry/Point.html"><span class="s5">Point</span></a>s. </span>Inherits some formatting from <a href="SCSliderBase.html"><span class="s6">SCSliderBase</span></a>.</p>
+<p class="p1">SCRangeSlider always has a range between zero and one. You must scale the output and input values to your needs. Using <b>map</b> and <b>unmap,</b> combined with a <a href="../../Control/Spec.html"><span class="s4">Spec</span></a>, are helpful for this. To set the increment or decrement value of the slider, set the <b>step</b> (see <a href="SCSliderBase.html"><span class="s4">SCSliderBase</span></a>) . Drag and drop returns and accepts <a href="../../Geometry/Point.html"><span class="s5">Point</span></a>s. Inherits some formatting from <a href="SCSliderBase.html"><span class="s6">SCSliderBase</span></a>.</p>
<p class="p2"><br></p>
<p class="p4"><b>Creation / Class Methods</b></p>
<p class="p5"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>*new (parent, bounds)</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>parent </b>- </span>The parent view.</p>
-<p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>bounds </b>- An instance of <a href="../../Geometry/Rect.html"><span class="s7">Rect</span></a>, </span>or </span>a <a href="../../Geometry/Point.html"><span class="s7">Point</span></a> indicating width@height.</p>
+<p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>parent </b>- The parent view.</p>
+<p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>bounds </b>- An instance of <a href="../../Geometry/Rect.html"><span class="s7">Rect</span></a>, or a <a href="../../Geometry/Point.html"><span class="s7">Point</span></a> indicating width@height.</p>
<p class="p9"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>(</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>w = <span class="s8">SCWindow</span>.new.front;</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(20, 80, 120, 30))</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.range_(0.4)</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s9">\sliderLOW</span>, slider.lo, <span class="s9">\sliderHI</span>, slider.hi].postln;</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s10">)</span></p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>w = <span class="s8">SCWindow</span>.new.front;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(20, 80, 120, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.range_(0.4)</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s9">\sliderLOW</span>, slider.lo, <span class="s9">\sliderHI</span>, slider.hi].postln;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>)</p>
<p class="p5"><br></p>
-<p class="p12"><b>Accessing Instance and Class Variables</b></p>
+<p class="p11"><b>Accessing Instance and Class Variables</b></p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>lo</b></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>lo_ (val)</b></p>
@@ -103,20 +103,25 @@
<p class="p5"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>setSpan (lo, hi)</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>A convenience method which performs both the <b>lo_</b> </span>and <b>hi_</b> setters. This will not do the <b>action</b> of the slider.</p>
+<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>A convenience method which performs both the <b>lo_</b> and <b>hi_</b> setters. This will not do the <b>action</b> of the slider.</p>
<p class="p5"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>setSpanActive (lo, hi)</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>A convenience method which performs both the <b>lo_</b> </span>and <b>hi_</b> setters. Does the <b>action</b> of the slider.</p>
+<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>A convenience method which performs both the <b>lo_</b> and <b>hi_</b> setters. Does the <b>action</b> of the slider.</p>
+<p class="p7"><span class="Apple-tab-span"> </span></p>
+<p class="p6"><span class="Apple-tab-span"> </span><b>setDeviation(deviation, average)</b></p>
+<p class="p7"><span class="Apple-tab-span"> </span></p>
+<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>A convenience methods which allows to set <b>lo</b> and <b>hi</b> according to their deviation and their average instead of their absolute values.</p>
+<p class="p7"><span class="Apple-tab-span"> </span></p>
<p class="p5"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>increment (zoom)</b></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>decrement (zoom)</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>These are the methods called by pressing the arrow keys. These methods increment or decrement both the the slider values (<b>hi</b> and <b>lo</b>) by <span class="s11">(max(</span><span class="s12">this</span><span class="s11">.step, </span><span class="s12">this</span><span class="s11">.pixelStep) * zoom)</span>. This means that by default increment </span>and decrement change the value by <b>pixelStep</b> (<b>step</b> is nil by default). You can set <b>step</b> to quantize the slider values. If you call these methods from your code, you can also change the resolution of the values with the <b>zoom</b> factor. This will not effect how the keys work, since they will always use a zoom factor of 1. Performs the action of the slider.</p>
-<p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>zoom </b>- Defaults to 1.</span></p>
+<p class="p6"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>These are the methods called by pressing the arrow keys. These methods increment or decrement both the the slider values (<b>hi</b> and <b>lo</b>) by <span class="s10">(max(</span><span class="s11">this</span><span class="s10">.step, </span><span class="s11">this</span><span class="s10">.pixelStep) * zoom)</span>. This means that by default increment and decrement change the value by <b>pixelStep</b> (<b>step</b> is nil by default). You can set <b>step</b> to quantize the slider values. If you call these methods from your code, you can also change the resolution of the values with the <b>zoom</b> factor. This will not effect how the keys work, since they will always use a zoom factor of 1. Performs the action of the slider.</p>
+<p class="p8"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>zoom </b>- Defaults to 1.</p>
<p class="p5"><br></p>
-<p class="p12"><b>Subclassing and Internal Methods</span></b></p>
-<p class="p6"><span class="s13"><span class="Apple-tab-span"> </span></span>The following methods are usually not used directly or are called by a primitive. Programmers can still call or override these as needed.</span></p>
+<p class="p11"><b>Subclassing and Internal Methods</b></p>
+<p class="p6"><span class="s12"><span class="Apple-tab-span"> </span></span>The following methods are usually not used directly or are called by a primitive. Programmers can still call or override these as needed.</p>
<p class="p7"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>defaultKeyDownAction (char, modifiers, unicode)</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
@@ -134,10 +139,10 @@
<p class="p5"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>properties</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p6"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>A list of properties to which this view responds. See <a href="SCView.html"><span class="s14">SCView</span></a>.</span></p>
+<p class="p6"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>A list of properties to which this view responds. See <a href="SCView.html"><span class="s13">SCView</span></a>.</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
-<p class="p13"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>returns:</p>
-<p class="p14"><span class="s10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[ </span>\bounds<span class="s10">, </span>\visible<span class="s10">, </span>\enabled<span class="s10">, </span>\canFocus<span class="s10">, </span>\resize<span class="s10">, </span>\background<span class="s10">, </span>\minWidth<span class="s10">, </span>\maxWidth<span class="s10">, </span>\minHeight<span class="s10">, </span>\maxHeight<span class="s10">, </span>\knobColor<span class="s10">, </span>\step<span class="s10">, </span>\lo<span class="s10">, </span>\hi<span class="s10"> ]</span></p>
+<p class="p12"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>returns:</p>
+<p class="p13"><span class="s14"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[ </span>\bounds<span class="s14">, </span>\visible<span class="s14">, </span>\enabled<span class="s14">, </span>\canFocus<span class="s14">, </span>\resize<span class="s14">, </span>\background<span class="s14">, </span>\minWidth<span class="s14">, </span>\maxWidth<span class="s14">, </span>\minHeight<span class="s14">, </span>\maxHeight<span class="s14">, </span>\knobColor<span class="s14">, </span>\step<span class="s14">, </span>\lo<span class="s14">, </span>\hi<span class="s14"> ]</span></p>
<p class="p5"><br></p>
<p class="p6"><b><span class="Apple-tab-span"> </span>defaultGetDrag</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
@@ -145,69 +150,92 @@
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
<p class="p6"><span class="Apple-tab-span"> </span><b>defaultCanReceiveDrag</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p6"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The method called by default when attempting to drop a drag in this object. By default, SCSlider will respond only to drags </span>where </span>the drag contains a <a href="../../Geometry/Point.html"><span class="s2">Point</span></a>. </span></p>
+<p class="p6"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The method called by default when attempting to drop a drag in this object. By default, SCSlider will respond only to drags where the drag contains a <a href="../../Geometry/Point.html"><span class="s2">Point</span></a>.</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s15"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span></p>
<p class="p6"><span class="Apple-tab-span"> </span><b>defaultReceiveDrag</b></p>
<p class="p7"><b><span class="Apple-tab-span"> </span></b></p>
-<p class="p6"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The default method called when a drag has been recieved. Sets <b>lo</b> and <b>hi</b> </span>repectively using the <a href="../../Geometry/Point.html"><span class="s2">Point</span></a>(currentDrag.x@xxxxxxxxxxxxx). Does <b>not</b> perform the action. </span></p>
+<p class="p6"><b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b>The default method called when a drag has been recieved. Sets <b>lo</b> and <b>hi</b> repectively using the <a href="../../Geometry/Point.html"><span class="s2">Point</span></a>(currentDrag.x@xxxxxxxxxxxxx). Does <b>not</b> perform the action.</p>
<p class="p7"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
<p class="p5"><br></p>
-<p class="p12"><b>Examples</b></p>
-<p class="p15"><br></p>
-<p class="p11">(</p>
-<p class="p11">w = <span class="s8">SCWindow</span>.new.front;</p>
-<p class="p11">a = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(20, 80, 120, 30))</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.range_(0.4)</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s9">\sliderLOW</span>, slider.lo, <span class="s9">\sliderHI</span>, slider.hi].postln;</p>
-<p class="p11"><span class="Apple-tab-span"> </span>});</p>
-<p class="p11">)</p>
-<p class="p15"><br></p>
-<p class="p16">// ---------</p>
-<p class="p15"><br></p>
-<p class="p11">(</p>
-<p class="p11">w = <span class="s8">SCWindow</span>.new.front;</p>
-<p class="p11">a = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(20, 80, 120, 30))</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.hi_(0.8)</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
-<p class="p16"><span class="s10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>b.activeLo_(slider.lo); </span>// this will trigger the action of b (and set it's value)</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>b.hi_(slider.hi);</p>
-<p class="p11"><span class="Apple-tab-span"> </span>});</p>
-<p class="p11">b = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(220, 80, 20, 130))</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.hi_(0.8)</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.knobColor_(<span class="s8">HiliteGradient</span>(<span class="s8">Color</span>.red, <span class="s8">Color</span>.white, <span class="s8">Color</span>.red))</p>
-<p class="p11"><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s9">\sliderLOW</span>, slider.lo, <span class="s9">\sliderHI</span>, slider.hi].postln;</p>
-<p class="p11"><span class="Apple-tab-span"> </span>});</p>
-<p class="p15"><br></p>
-<p class="p11">)</p>
-<p class="p15"><br></p>
-<p class="p16">// SoundExample</p>
-<p class="p15"><br></p>
-<p class="p16">// Shape a bandpass filter. Hold down the ctrl-key to move the whole frequency range</p>
-<p class="p11">(</p>
-<p class="p11">s.waitForBoot({</p>
-<p class="p11"><span class="Apple-tab-span"> </span>a={<span class="s8">arg</span> freq=1800, bw=0.2; </span></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s8">var</span> r;</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s8">BBandPass</span>.ar(<span class="s8">WhiteNoise</span>.ar(0.3), </span>freq, bw);</p>
-<p class="p15"><br></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>}.play;</p>
-<p class="p15"><br></p>
-<p class="p11"><span class="Apple-tab-span"> </span>w = <span class="s8">SCWindow</span>(<span class="s16">"SC2DSlider"</span>, <span class="s8">Rect</span>(100,<span class="s8">SCWindow</span>.screenBounds.height-400, 400 ,50));</p>
-<p class="p11"><span class="Apple-tab-span"> </span>t = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(10, 10, 380, 30))</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.lo_(0.4)</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.hi_(0.6)</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.action_({<span class="s8">|sl|</span></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a.set(<span class="s9">\freq</span>,1800*(sl.lo+sl.lo)+10,<span class="s9">\bw</span>, (sl.hi-sl.lo).abs+0.01);</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
-<p class="p11"><span class="Apple-tab-span"> </span>t.doAction;</p>
-<p class="p15"><span class="Apple-tab-span"> </span></p>
-<p class="p11"><span class="Apple-tab-span"> </span>w.front;</p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="s8">CmdPeriod</span>.doOnce({w.close});</p>
-<p class="p11">})</p>
-<p class="p11">)</p>
+<p class="p11"><b>Examples</b></p>
+<p class="p3"><br></p>
+<p class="p10">(</p>
+<p class="p10">w = <span class="s8">SCWindow</span>.new.front;</p>
+<p class="p10">a = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(20, 80, 120, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.range_(0.4)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s9">\sliderLOW</span>, slider.lo, <span class="s9">\sliderHI</span>, slider.hi].postln;</p>
+<p class="p10"><span class="Apple-tab-span"> </span>});</p>
+<p class="p10">)</p>
+<p class="p3"><br></p>
+<p class="p14">// ---------</p>
+<p class="p3"><br></p>
+<p class="p10">(</p>
+<p class="p10">w = <span class="s8">SCWindow</span>.new.front;</p>
+<p class="p10">a = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(20, 80, 120, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.hi_(0.8)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
+<p class="p14"><span class="s14"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>b.activeLo_(slider.lo); </span>// this will trigger the action of b (and set it's value)</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>b.hi_(slider.hi);</p>
+<p class="p10"><span class="Apple-tab-span"> </span>});</p>
+<p class="p10">b = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(220, 80, 20, 130))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.lo_(0.2)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.hi_(0.8)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.knobColor_(<span class="s8">HiliteGradient</span>(<span class="s8">Color</span>.red, <span class="s8">Color</span>.white, <span class="s8">Color</span>.red))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.action_({ <span class="s8">|slider|</span></p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>[<span class="s9">\sliderLOW</span>, slider.lo, <span class="s9">\sliderHI</span>, slider.hi].postln;</p>
+<p class="p10"><span class="Apple-tab-span"> </span>});</p>
+<p class="p3"><br></p>
+<p class="p10">)</p>
+<p class="p3"><br></p>
+<p class="p15">// setDeviation:</p>
+<p class="p10">(</p>
+<p class="p3"><br></p>
+<p class="p10">w = <span class="s16">Window</span>(<span class="s17">"</span>setDeviation<span class="s17">"</span>, <span class="s16">Rect</span>(300, 300, 300, 150));</p>
+<p class="p10">a = <span class="s16">RangeSlider</span>(w, <span class="s16">Rect</span>(10, 10, 200, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.lo_(0)</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.hi_(1);</p>
+<p class="p10">b = <span class="s16">Slider</span>(w, <span class="s16">Rect</span>(10, 50, 200, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.action_(</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>{<span class="Apple-tab-span"> </span><span class="s16">arg</span> me;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a.setDeviation(c.value, b.value);</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
+<p class="p10">c = <span class="s16">Slider</span>(w, <span class="s16">Rect</span>(10, 100, 200, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span>.action_(</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>{<span class="Apple-tab-span"> </span><span class="s16">arg</span> me;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a.setDeviation(c.value, b.value);</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>}</p>
+<p class="p10"><span class="Apple-tab-span"> </span>);</p>
+<p class="p10">c.valueAction = 0.2;</p>
+<p class="p10">w.front;</p>
+<p class="p10">)</p>
+<p class="p3"><br></p>
+<p class="p3"><br></p>
+<p class="p14">// SoundExample</p>
+<p class="p3"><br></p>
+<p class="p14">// Shape a bandpass filter. Hold down the ctrl-key to move the whole frequency range</p>
+<p class="p10">(</p>
+<p class="p10">s.waitForBoot({</p>
+<p class="p10"><span class="Apple-tab-span"> </span>a={<span class="s8">arg</span> freq=1800, bw=0.2;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s8">var</span> r;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s8">BBandPass</span>.ar(<span class="s8">WhiteNoise</span>.ar(0.3), freq, bw);</p>
+<p class="p3"><br></p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>}.play;</p>
+<p class="p3"><br></p>
+<p class="p10"><span class="Apple-tab-span"> </span>w = <span class="s8">SCWindow</span>(<span class="s17">"SC2DSlider"</span>, <span class="s8">Rect</span>(100,<span class="s8">SCWindow</span>.screenBounds.height-400, 400 ,50));</p>
+<p class="p10"><span class="Apple-tab-span"> </span>t = <span class="s8">SCRangeSlider</span>(w, <span class="s8">Rect</span>(10, 10, 380, 30))</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.lo_(0.4)</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.hi_(0.6)</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>.action_({<span class="s8">|sl|</span></p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>a.set(<span class="s9">\freq</span>,1800*(sl.lo+sl.lo)+10,<span class="s9">\bw</span>, (sl.hi-sl.lo).abs+0.01);</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
+<p class="p10"><span class="Apple-tab-span"> </span>t.doAction;</p>
+<p class="p3"><span class="Apple-tab-span"> </span></p>
+<p class="p10"><span class="Apple-tab-span"> </span>w.front;</p>
+<p class="p10"><span class="Apple-tab-span"> </span><span class="s8">CmdPeriod</span>.doOnce({w.close});</p>
+<p class="p10">})</p>
+<p class="p10">)</p>
</body>
</html>
Modified: trunk/build/SCClassLibrary/Common/GUI/osx/Base/SCView.sc
===================================================================
--- trunk/build/SCClassLibrary/Common/GUI/osx/Base/SCView.sc 2008-12-27 15:44:21 UTC (rev 8312)
+++ trunk/build/SCClassLibrary/Common/GUI/osx/Base/SCView.sc 2008-12-27 22:24:33 UTC (rev 8313)
@@ -722,6 +722,11 @@
this.setSpan( lo, hi );
this.doAction;
}
+
+ setDeviation { arg deviation, average;
+ var lo = ( 1 - deviation ) * average;
+ this.setSpan(lo, lo + deviation);
+ }
properties {
^super.properties ++ #[\lo, \hi]
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/