- Timestamp:
- 06/13/07 16:55:58 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/area.xml
r9197 r9275 3 3 4 4 5 <bindings xmlns = "http://www.mozilla.org/xbl" 6 xmlns:xbl = "http://www.mozilla.org/xbl" 7 xmlns:html = "http://www.w3.org/1999/xhtml" 8 xmlns:xul = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 9 xmlns:ec = "http://ircam.fr/ecoute" 10 xmlns:xlink="http://www.w3.org/1999/xlink" 5 <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" 6 xmlns:html="http://www.w3.org/1999/xhtml" 7 xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 8 xmlns:ec="http://ircam.fr/ecoute" xmlns:xlink="http://www.w3.org/1999/xlink" 11 9 xmlns:svg="http://www.w3.org/2000/svg"> 12 10 13 <binding id="area" extends="svg:generic"> 14 <content> 15 <svg:audiograph x="0" y="20" height="80" width="1000" anonid="audiograph"/> 16 <svg:rect x="0" y="0" width="1000" height="20" fill="#fff" stroke-width="0"/> 17 <svg:rect x="0" y="20" width="1000" height="80" fill="#f6e69d" opacity="0.8" stroke-width="0"/> 18 <svg:g anonid="area_rules"> 19 <svg:line x1="0" x2="1000" y1="20" y2="20" stroke="#aaa" fill="black" stroke-width="1"/> 20 </svg:g> 21 <svg:g anonid="sections"> 22 <children/> 23 </svg:g> 24 <svg:svg anonid="cursor" x="0" y="0" width="2%" height="100" viewBox="0 0 10 10" preserveAspectRatio="none"> 25 <svg:line x1="0" x2="0" y1="0" y2="10" fill="red" stroke-width="2"/> 26 </svg:svg> 11 <binding id="area" extends="svg:generic"> 12 <content> 13 <svg:audiograph x="0" y="20" height="80" width="1000" anonid="audiograph" /> 14 <svg:rect x="0" y="0" width="1000" height="20" fill="#fff" stroke-width="0" /> 15 <svg:rect x="0" y="20" width="1000" height="80" fill="#f6e69d" opacity="0.8" stroke-width="0" /> 16 <svg:g anonid="area_rules"> 17 <svg:line x1="0" x2="1000" y1="20" y2="20" stroke="#aaa" fill="black" stroke-width="1" /> 18 </svg:g> 19 <svg:g anonid="sections"> 20 <children /> 21 </svg:g> 22 <svg:svg anonid="cursor" x="0" y="0" width="2%" height="100" viewBox="0 0 10 10" 23 preserveAspectRatio="none"> 24 <svg:line x1="0" x2="0" y1="0" y2="10" fill="red" stroke-width="2" /> 25 </svg:svg> 27 26 28 </content>27 </content> 29 28 30 <implementation> 31 <constructor> 32 <![CDATA[ 29 <implementation> 30 <constructor><![CDATA[ 33 31 this._cursor = document.getAnonymousElementByAttribute(this, "anonid", "cursor"); 34 ]]> 35 </constructor> 36 <method name="init"> 37 <parameter name="audioElt"/> 38 <body> 39 <![CDATA[ 32 ]]></constructor> 33 <method name="init"> 34 <parameter name="audioElt" /> 35 <body><![CDATA[ 40 36 this._audioElt = audioElt; 41 37 var aSectionWalker = this.newSectionWalker(); … … 88 84 89 85 this.updateRatio(); 90 ]]> 91 </body> 92 </method> 93 <method name="updateRatio"> 94 <body> 95 <![CDATA[ 86 ]]></body> 87 </method> 88 <method name="updateRatio"> 89 <body><![CDATA[ 96 90 var sections = document.getAnonymousElementByAttribute(this, "anonid", "sections"); 97 91 var aMatrix = sections.ownerSVGElement.getViewboxToViewportTransform(); … … 107 101 var coordTrans2 = coord2.matrixTransform(aMatrix); 108 102 this._ratio = (coordTrans2.x - coordTrans1.x) * this._audioElt._segplayer._ratio; 109 110 ]]> 111 </body> 112 </method> 113 <method name="drawGraph"> 114 <body> 115 <![CDATA[ 103 ]]></body> 104 </method> 105 <method name="drawGraph"> 106 <body><![CDATA[ 116 107 var graph = document.getAnonymousElementByAttribute(this, "anonid", "audiograph"); 117 108 if (this._audioElt.srcAudio) { … … 120 111 graph.hideGraph(); 121 112 } 122 ]]> 123 </body> 124 </method> 125 <property name="rootSection"> 126 <getter> 127 <![CDATA[ 113 ]]></body> 114 </method> 115 <property name="rootSection"> 116 <getter> 117 <![CDATA[ 128 118 var firstSection = this.firstChild; 129 119 while(firstSection && firstSection.localName != "section") { … … 131 121 } 132 122 return firstSection; 133 ]]> 134 </getter> 135 </property> 136 <method name="newSectionWalker"> 137 <body> 138 <![CDATA[ 123 ]]></getter> 124 </property> 125 <method name="newSectionWalker"> 126 <body><![CDATA[ 139 127 function sectionFilter(node) { 140 128 if (node.localName == "section") … … 145 133 146 134 return document.createTreeWalker(this.rootSection, NodeFilter.SHOW_ELEMENT, sectionFilter, false); 147 ]]> 148 </body> 149 </method> 150 <property name="inner" readonly="true"> 151 <getter> 152 <![CDATA[ 153 return document.getAnonymousNodes(this)[0]; 154 ]]> 155 </getter> 156 </property> 135 ]]></body> 136 </method> 137 <property name="inner" readonly="true"> 138 <getter><![CDATA[ 139 return document.getAnonymousNodes(this)[0]; 140 ]]></getter> 141 </property> 157 142 158 143 159 <property name="cursor"> 160 <getter> 161 <![CDATA[ 144 <property name="cursor"> 145 <getter><![CDATA[ 162 146 return this._cursor.x.baseVal.value; 163 ]]> 164 </getter> 165 <setter> 166 <![CDATA[ 147 ]]></getter> 148 <setter><![CDATA[ 167 149 if (val < 0) val = 0; 168 150 if (val > 1000 ) val = 1000; 169 151 this._cursor.x.baseVal.value = val; 170 ]]> 171 </setter> 172 </property> 152 ]]></setter> 153 </property> 154 </implementation> 155 156 <handlers> 157 <handler event="DOMMouseScroll"><![CDATA[ 158 var delta = event.detail; 159 var z1 = this._audioElt._zoomplayer.t1; 160 var z2 = this._audioElt._zoomplayer.t2; 161 var width = z2 - z1; 162 z1 -= (delta * width / 100); 163 z2 += (delta * width / 100); 164 this._audioElt._zoomplayer.setZone(z1, z2); 165 166 return; 167 ]]></handler> 168 </handlers> 173 169 174 175 176 </implementation> 177 <handlers> 178 <handler event="DOMMouseScroll"> 179 <![CDATA[ 180 var delta = event.detail; 181 var z1 = this._audioElt._zoomplayer.t1; 182 var z2 = this._audioElt._zoomplayer.t2; 183 var width = z2 - z1; 184 z1 -= (delta * width / 100); 185 z2 += (delta * width / 100); 186 this._audioElt._zoomplayer.setZone(z1, z2); 187 188 return; 189 ]]> 190 </handler> 191 </handlers> 192 193 </binding> 170 </binding> 194 171 </bindings>