- Timestamp:
- 06/13/07 17:44:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/subplayer.xml
r9275 r9276 1 1 <?xml version="1.0"?> 2 3 4 2 <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" 5 3 xmlns:html="http://www.w3.org/1999/xhtml" … … 11 9 <content> 12 10 <svg:g xbl:inherits="transform"> 13 14 11 <svg:g class="buttonplayer" anonid="button"> 15 12 <svg:rect anonid="" x="0" y="0" width="40" height="40" /> … … 17 14 <svg:rect anonid="stop" x="8" y="8" width="24" height="24" /> 18 15 </svg:g> 16 19 17 <svg:rect anonid="ext" x="70" y="0" width="1000" height="40" stroke-width="0" /> 20 18 <svg:text anonid="text1" x="84" y="30" font-size="28" fill="#000" stroke-width="0" /> … … 23 21 <svg:audiograph x="70" y="0" height="40" width="925" anonid="audiograph" /> 24 22 <svg:rect anonid="ground" x="70" y="0" width="925" height="40" fill-opacity="0" /> 23 25 24 <svg:g class="subzone" style="visibility: hidden;"> 26 27 25 <svg:symbol id="zoneAnchorLeft" viewBox="15 0 40 40" preserveAspectRatio="none" 28 26 overflow="visible"> … … 42 40 height="36" stroke-width="2" /> 43 41 </svg:g> 42 44 43 <svg:svg anonid="cursor" x="0" y="0" width="10" height="40" viewBox="0 0 10 10" 45 44 preserveAspectRatio="none"> … … 48 47 </svg:g> 49 48 </content> 49 50 50 <implementation> 51 <method name="init">52 <parameter name="audioElt" />53 <body><![CDATA[54 this._audioElt = audioElt;55 56 while (this._modificationListeners.length)57 this._modificationListeners.pop();58 ]]></body>59 </method>60 <method name="drawGraph">61 <body><![CDATA[62 var graph = document.getAnonymousElementByAttribute(this, "anonid", "audiograph");63 if (this._audioElt.srcAudio) {64 graph.drawGraph(this._audioElt.srcAudio, "daim://fullGraph", 0, 950, 40);65 } else {66 graph.hideGraph();67 }68 ]]></body>69 </method>70 51 <constructor><![CDATA[ 71 52 //FIXME: init() … … 132 113 var initValue = handle.x.baseVal.value; 133 114 var newValue = initValue + delta / self._ratio; 134 self._resizeZone(self._selectedHandle == LEFT ? "left" : "right", newValue, true);115 self._resizeZone(self._selectedHandle == LEFT ? "left" : "right", newValue, true); 135 116 } 136 117 var groundClientLeft = self._audioElt._xulroot.boxObject.x + (self._ground.x.baseVal.value * self._ratio); … … 147 128 148 129 function _mousedownMiddle(event) { 149 if (event.button == 0) {150 self._state = DRAG;151 self._selectedHandle = MIDDLE;152 self.oriX = event.clientX;153 }130 if (event.button == 0) { 131 self._state = DRAG; 132 self._selectedHandle = MIDDLE; 133 self.oriX = event.clientX; 134 } 154 135 } 155 136 … … 199 180 this._ratio = coordTrans2.x - coordTrans1.x; 200 181 201 ]]></constructor> 182 ]]></constructor> 183 184 185 <property name="cursor"> 186 <getter><![CDATA[ 187 return 1000 * (this._cursor.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value; 188 ]]></getter> 189 190 <setter><![CDATA[ 191 if (val < 0) val = 0; 192 if (val > 1000 ) val = 1000; 193 this._cursor.x.baseVal.value = (val / 1000) * this._ground.width.baseVal.value + this._ground.x.baseVal.value; 194 ]]></setter> 195 </property> 196 197 <property name="t1"> 198 <getter><![CDATA[ 199 return 1000 * (this._zone.c1.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value; 200 ]]></getter> 201 </property> 202 203 <property name="t2"> 204 <getter><![CDATA[ 205 return 1000 * (this._zone.c2.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value; 206 ]]></getter> 207 </property> 208 209 <method name="setT2"> 210 <parameter name="val" /> 211 <parameter name="notify" /> 212 <body><![CDATA[ 213 if (val < 0) val = 0; 214 if (val > 1000 ) val = 1000; 215 this.showZone(true); 216 this._resizeZone("right", this._ground.x.baseVal.value + this._ground.width.baseVal.value * (val / 1000), notify); 217 ]]></body> 218 </method> 219 220 <property name="inner" readonly="true"> 221 <getter><![CDATA[ 222 return document.getAnonymousNodes(this)[0]; 223 ]]></getter> 224 </property> 225 226 <method name="init"> 227 <parameter name="audioElt" /> 228 <body><![CDATA[ 229 this._audioElt = audioElt; 230 231 while (this._modificationListeners.length) 232 this._modificationListeners.pop(); 233 ]]></body> 234 </method> 235 236 <method name="drawGraph"> 237 <body><![CDATA[ 238 var graph = document.getAnonymousElementByAttribute(this, "anonid", "audiograph"); 239 if (this._audioElt.srcAudio) { 240 graph.drawGraph(this._audioElt.srcAudio, "daim://fullGraph", 0, 950, 40); 241 } else { 242 graph.hideGraph(); 243 } 244 ]]></body> 245 </method> 202 246 203 247 <method name="_notifyPlayListeners"> … … 269 313 if (notify && modif) this._notifyResizeListeners( 270 314 1000 * (this._zone.c1.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value, 271 1000 * (this._zone.c2.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value,315 1000 * (this._zone.c2.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value, 272 316 handle); 273 317 return modif; … … 293 337 if (notify && modif) this._notifyResizeListeners( 294 338 1000 * (this._zone.c1.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value, 295 1000 * (this._zone.c2.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value,339 1000 * (this._zone.c2.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value, 296 340 'middle'); 297 341 return modif; 298 342 ]]></body> 299 343 </method> 300 301 344 302 345 <method name="addResizeListener"> … … 325 368 ]]></body> 326 369 </method> 370 327 371 <method name="showZone"> 328 372 <parameter name="show" /> … … 336 380 </method> 337 381 338 <property name="cursor">339 <getter><![CDATA[340 return 1000 * (this._cursor.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value;341 ]]></getter>342 <setter><![CDATA[343 if (val < 0) val = 0;344 if (val > 1000 ) val = 1000;345 this._cursor.x.baseVal.value = (val / 1000) * this._ground.width.baseVal.value + this._ground.x.baseVal.value;346 ]]></setter>347 </property>348 349 <property name="t1">350 <getter><![CDATA[351 return 1000 * (this._zone.c1.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value;352 ]]></getter>353 </property>354 355 382 <method name="setT1"> 356 383 <parameter name="val" /> … … 364 391 </method> 365 392 366 <property name="t2">367 <getter><![CDATA[368 return 1000 * (this._zone.c2.x.baseVal.value - this._ground.x.baseVal.value) / this._ground.width.baseVal.value;369 ]]></getter>370 </property>371 <method name="setT2">372 <parameter name="val" />373 <parameter name="notify" />374 <body><![CDATA[375 if (val < 0) val = 0;376 if (val > 1000 ) val = 1000;377 this.showZone(true);378 this._resizeZone("right", this._ground.x.baseVal.value + this._ground.width.baseVal.value * (val / 1000), notify);379 ]]></body>380 </method>381 382 <property name="inner" readonly="true">383 <getter><![CDATA[384 return document.getAnonymousNodes(this)[0];385 ]]></getter>386 </property>387 393 <method name="startplay"> 388 394 <body><![CDATA[ … … 390 396 ]]></body> 391 397 </method> 398 392 399 <method name="stopplay"> 393 400 <body><![CDATA[ … … 395 402 ]]></body> 396 403 </method> 397 398 404 </implementation> 405 399 406 <handlers> 400 407 <handler event="DOMMouseScroll"><![CDATA[
Note: See TracChangeset
for help on using the changeset viewer.