Changeset 9276


Ignore:
Timestamp:
06/13/07 17:44:00 (5 years ago)
Author:
dar
Message:

Réorganisation du code (constructor, field, property, method)

Location:
branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/area.xml

    r9275 r9276  
    11<?xml version="1.0"?> 
    2  
    3   
    4  
    52<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" 
    63        xmlns:html="http://www.w3.org/1999/xhtml" 
     
    1411                        <svg:rect x="0" y="0" width="1000" height="20" fill="#fff" stroke-width="0" /> 
    1512                        <svg:rect x="0" y="20" width="1000" height="80" fill="#f6e69d" opacity="0.8" stroke-width="0" /> 
     13 
    1614                        <svg:g anonid="area_rules"> 
    1715                                <svg:line x1="0" x2="1000" y1="20" y2="20" stroke="#aaa" fill="black" stroke-width="1" /> 
    1816                        </svg:g> 
     17 
    1918                        <svg:g anonid="sections"> 
    2019                                <children /> 
    2120                        </svg:g> 
     21 
    2222                        <svg:svg anonid="cursor" x="0" y="0" width="2%" height="100" viewBox="0 0 10 10" 
    2323                                preserveAspectRatio="none"> 
    2424                                <svg:line x1="0" x2="0" y1="0" y2="10" fill="red" stroke-width="2" /> 
    2525                        </svg:svg> 
    26  
    2726                </content> 
    2827 
     
    3130                                this._cursor = document.getAnonymousElementByAttribute(this, "anonid", "cursor"); 
    3231                        ]]></constructor> 
     32 
     33                        <property name="rootSection"> 
     34                                <getter><![CDATA[ 
     35                                        var firstSection = this.firstChild; 
     36                                        while(firstSection && firstSection.localName != "section") { 
     37                                                firstSection = firstSection.nextSibling; 
     38                                        } 
     39                                        return firstSection; 
     40                                ]]></getter> 
     41                        </property> 
     42 
     43                        <property name="inner" readonly="true"> 
     44                                <getter><![CDATA[ 
     45                                        return document.getAnonymousNodes(this)[0]; 
     46                                ]]></getter> 
     47                        </property> 
     48 
     49                        <property name="cursor"> 
     50                                <getter><![CDATA[ 
     51                                        return this._cursor.x.baseVal.value; 
     52                                ]]></getter> 
     53                                <setter><![CDATA[ 
     54                                        if (val < 0) val = 0; 
     55                                        if (val > 1000 ) val = 1000; 
     56                                        this._cursor.x.baseVal.value = val; 
     57                                ]]></setter> 
     58                        </property> 
     59 
    3360                        <method name="init"> 
    3461                                <parameter name="audioElt" /> 
     
    86113                                ]]></body> 
    87114                        </method> 
     115 
    88116                        <method name="updateRatio"> 
    89117                                <body><![CDATA[ 
     
    103131                                ]]></body> 
    104132                        </method> 
     133 
    105134                        <method name="drawGraph"> 
    106135                                <body><![CDATA[ 
    107                                                 var graph = document.getAnonymousElementByAttribute(this, "anonid", "audiograph"); 
    108                                                 if (this._audioElt.srcAudio) { 
    109                                                         graph.drawGraph(this._audioElt.srcAudio, "daim://zoomedGraph", 1, 10000, 80); 
    110                                                 } else { 
    111                                                         graph.hideGraph(); 
    112                                                 } 
     136                                        var graph = document.getAnonymousElementByAttribute(this, "anonid", "audiograph"); 
     137                                        if (this._audioElt.srcAudio) { 
     138                                                graph.drawGraph(this._audioElt.srcAudio, "daim://zoomedGraph", 1, 10000, 80); 
     139                                        } else { 
     140                                                graph.hideGraph(); 
     141                                        } 
    113142                                ]]></body> 
    114143                        </method> 
    115                         <property name="rootSection"> 
    116                                 <getter> 
    117                                         <![CDATA[ 
    118                                         var firstSection = this.firstChild; 
    119                                         while(firstSection && firstSection.localName != "section") { 
    120                                                 firstSection = firstSection.nextSibling; 
    121                                         } 
    122                                         return firstSection; 
    123                                 ]]></getter> 
    124                         </property> 
     144 
    125145                        <method name="newSectionWalker"> 
    126146                                <body><![CDATA[ 
    127                                                 function sectionFilter(node) { 
    128                                                         if (node.localName == "section") 
    129                                                                 return NodeFilter.FILTER_ACCEPT 
    130                                                         else 
    131                                                                 return NodeFilter.FILTER_SKIP 
    132                                                 } 
     147                                        function sectionFilter(node) { 
     148                                                if (node.localName == "section") 
     149                                                        return NodeFilter.FILTER_ACCEPT 
     150                                                else 
     151                                                        return NodeFilter.FILTER_SKIP 
     152                                        } 
    133153 
    134                                                 return document.createTreeWalker(this.rootSection, NodeFilter.SHOW_ELEMENT, sectionFilter, false); 
     154                                        return document.createTreeWalker(this.rootSection, NodeFilter.SHOW_ELEMENT, sectionFilter, false); 
    135155                                ]]></body> 
    136156                        </method> 
    137                         <property name="inner" readonly="true"> 
    138                                 <getter><![CDATA[ 
    139                                         return document.getAnonymousNodes(this)[0]; 
    140                                 ]]></getter> 
    141                         </property> 
     157                </implementation> 
    142158 
    143  
    144                         <property name="cursor"> 
    145                                 <getter><![CDATA[ 
    146                                         return this._cursor.x.baseVal.value; 
    147                                 ]]></getter> 
    148                                 <setter><![CDATA[ 
    149                                         if (val < 0) val = 0; 
    150                                         if (val > 1000 ) val = 1000; 
    151                                         this._cursor.x.baseVal.value = val; 
    152                                 ]]></setter> 
    153                         </property> 
    154                 </implementation> 
    155                  
    156159                <handlers> 
    157160                        <handler event="DOMMouseScroll"><![CDATA[ 
     
    167170                        ]]></handler> 
    168171                </handlers> 
    169  
    170172        </binding> 
    171173</bindings> 
  • branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/audio.xml

    r9275 r9276  
    11<?xml version="1.0"?> 
    2    
    3  
    42<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" 
    53        xmlns:html="http://www.w3.org/1999/xhtml" 
     
    119                <content> 
    1210                        <xul:vbox anonid="xulroot"> 
    13  
    1411                                <svg:svg width="550px" height="200px" viewBox="0 0 1100 400" anonid="svgbody" 
    1512                                        preserveAspectRatio="xMinYMin meet" opacity="0.3"> 
     
    2522                                                leftHandle="chrome://audio-toolkit/content/images/handleLeft.png" 
    2623                                                rightHandle="chrome://audio-toolkit/content/images/handleRight.png" /> 
     24 
    2725                                        <svg:g transform="translate(0, 140)" class="zoomarea"> 
    2826                                                <svg:g anonid="plotbox" /> 
     
    3028                                                <svg:line class="zmarker" anonid="zmarker2" x1="925" y1="0" x2="995" y2="50" /> 
    3129                                                <svg:rect anonid="ground" x="70" y="50" height="200" width="925" stroke="black" /> 
     30 
    3231                                                <svg:svg anonid="zoomarea" x="70" y="50" height="200" width="925" viewBox="0 0 1000 100" 
    3332                                                        preserveAspectRatio="none" overflow="hidden"> 
     
    3534                                                </svg:svg> 
    3635                                        </svg:g> 
     36 
    3737                                        <svg:svg x="1040" y="0" width="60" height="400" stroke="red" fill="red" class="svgtoolbar" 
    3838                                                viewBox="0 0 60 400" overflow="visible"> 
     
    4141                                                                stroke="#444" rx="5" ry="5" /> 
    4242                                                </svg:g> 
     43 
    4344                                                <svg:g anonid="button_add" transform="translate(0, 50)"> 
    4445                                                        <svg:rect x="0" y="0" height="34" width="34" fill="#aaa;" stroke-width="4" 
     
    4647                                                        <svg:path d="M8,17 l18,0 M17,8 l0,18" stroke="#000" stroke-width="5" /> 
    4748                                                </svg:g> 
     49 
    4850                                                <svg:g anonid="button_zoom1" transform="translate(0, 100)"> 
    4951                                                        <svg:rect x="0" y="0" height="34" width="34" fill="#aaa;" stroke-width="4" 
     
    5355                                                </svg:g> 
    5456                                        </svg:svg> 
     57 
    5558                                        <svg:rect anonid="disablelayer" x="0" y="0" height="100%" width="100%" opacity="0" /> 
    5659                                </svg:svg> 
     
    6972                                this._zoomarea= document.getAnonymousElementByAttribute(this, "anonid", "zoomarea"); 
    7073 
    71  
    7274                                this.updateZoom(0, 1000); 
    7375                        ]]></constructor> 
     76 
    7477                        <field name="playState" /> 
     78 
    7579                        <field name="statusEditor" /> 
     80 
     81                        <field name="focusedSegment" /> 
     82 
    7683                        <property name="title"> 
    7784                                <setter><![CDATA[ 
     
    7986                                        this._mainplayer.setText("left", val); 
    8087                                ]]></setter> 
     88 
    8189                                <getter><![CDATA[ 
    8290                                        return this._title; 
    8391                                ]]></getter> 
    8492                        </property> 
     93 
    8594                        <property name="srcAudio"> 
    8695                                <getter><![CDATA[ 
    8796                                        return this._srcAudio; 
     97                                ]]></getter> 
     98                        </property> 
     99 
     100                        <property name="audioStream"> 
     101                                <getter><![CDATA[ 
     102                                        if (!this.srcAudio) 
     103                                                return null; 
     104                                        if (!this._audioStream) { 
     105                                                this._audioStream = Components.classes["@scenari.org/audio/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); 
     106                                                this._audioStream.init(this.srcAudio, 1, 0, Components.interfaces.nsIFileInputStream.REOPEN_ON_REWIND); 
     107                                                this._audioStream.QueryInterface(Components.interfaces.scIAudioStream); 
     108                                        } 
     109                                         
     110                                        return this._audioStream; 
     111                                ]]></getter> 
     112                        </property> 
     113 
     114                        <property name="innerSvg" readonly="true"> 
     115                                <getter><![CDATA[ 
     116                                        return document.getAnonymousElementByAttribute(this, "anonid", "svgbody"); 
     117                                ]]></getter> 
     118                        </property> 
     119 
     120                        <property name="inner" readonly="true"> 
     121                                <getter><![CDATA[ 
     122                                        return document.getAnonymousNodes(this)[0]; 
     123                                ]]></getter> 
     124                        </property> 
     125 
     126                        <property name="duration"> 
     127                                <getter><![CDATA[ 
     128                                        return this._duration;           
     129                                ]]></getter> 
     130                        </property> 
     131 
     132                        <property name="cursor"> 
     133                                <setter><![CDATA[ 
     134                                        this._mainplayer.cursor = val; 
     135                                        this._segplayer.cursor = val; 
     136                                        this._zoomplayer.cursor = val; 
     137 
     138                                        var i; 
     139                                        var child; 
     140                                        for (i = 0; i < this.childNodes.length; i++) { 
     141                                        child = this.childNodes[i]; 
     142                                                if (child.localName == "area") { 
     143                                                        child.cursor = val; 
     144                                                } 
     145                                        } 
     146                                ]]></setter> 
     147 
     148                                <getter><![CDATA[ 
     149                                        return this._mainplayer.cursor; 
    88150                                ]]></getter> 
    89151                        </property> 
     
    112174                                ]]></body> 
    113175                        </method> 
     176 
    114177                        <method name="setFocusOnSegment"> 
    115178                                <parameter name="aSegment" /> 
     
    143206                                ]]></body> 
    144207                        </method> 
    145                         <field name="focusedSegment" /> 
     208 
    146209                        <method name="beginBatch"> 
    147210                                <body><![CDATA[ 
     
    151214                                ]]></body> 
    152215                        </method> 
     216 
    153217                        <method name="refresh"> 
    154218                                <body><![CDATA[ 
     
    183247                                        this.setFocusOnSegment(vNewFocus); 
    184248 
    185           this.updatePlot(); 
     249                                        this.updatePlot(); 
    186250                                        this.innerSvg.unsuspendRedraw(this._suspendId); 
    187251 
    188252                                ]]></body> 
    189253                        </method> 
     254 
    190255                        <method name="s2Str"> 
    191256                                <parameter name="aMs" /> 
     
    218283                                ]]></body> 
    219284                        </method> 
     285 
    220286                        <method name="removeSection"> 
    221287                                <parameter name="pSection" /> 
    222288                                <body><![CDATA[  
    223           if (pSection == this.focusedSegment) { 
    224             this.setFocusOnSegment(null); 
    225           } 
     289                                        if (pSection == this.focusedSegment) { 
     290                                                this.setFocusOnSegment(null); 
     291                                        } 
    226292                                        var vParentSection = pSection.parentSection;  
    227           try { 
    228             pSection.parentNode.removeChild(pSection);  
    229           } catch(e) {} 
    230           vParentSection.init(this); 
     293                                        try { 
     294                                                pSection.parentNode.removeChild(pSection);  
     295                                        } catch(e) {} 
     296                                        vParentSection.init(this); 
    231297                                        var sectionWalker = vParentSection.ownerArea.newSectionWalker(); 
    232298                                        while (sectionWalker.nextNode()) { 
    233             sectionWalker.currentNode.updateStartRequest(null); 
    234                                         } 
    235           var vUpdatedSegments = this.getUpdatedSegmentsAndCompute(vParentSection);  
    236           this.updatePlot(); 
    237           this.setFocusOnSegment(this.focusedSegment); 
    238           return vUpdatedSegments;  
    239                                 ]]></body> 
    240                         </method> 
     299                                                sectionWalker.currentNode.updateStartRequest(null); 
     300                                        } 
     301                                        var vUpdatedSegments = this.getUpdatedSegmentsAndCompute(vParentSection);  
     302                                        this.updatePlot(); 
     303                                        this.setFocusOnSegment(this.focusedSegment); 
     304                                        return vUpdatedSegments;  
     305                                ]]></body> 
     306                        </method> 
     307 
    241308                        <method name="init"> 
    242309                                <parameter name="aAudioObject" /> 
     
    426493                                                this.statusEditor |= 2; 
    427494 
    428  
    429  
    430495                                        /// Player listener 
    431  
    432496                                        this._playerListener = { 
    433497                                                mPlayer:null, 
     
    441505                                                resume : function () { 
    442506                                                        if(this.mPlayer) 
    443                                                                 this.mPlayer.resume();    
     507                                                                this.mPlayer.resume(); 
    444508                                                }, 
    445509                                                cancel: function () { 
     
    450514                                                        dump("===> onStartRequest\n");  
    451515                                                        if(request instanceof Components.interfaces.scIAsyncAudioPlayer) 
    452                                                                 this.mPlayer = request;   
     516                                                                this.mPlayer = request; 
    453517                                                }, 
    454518 
     
    476540                                                // nsIProgressEventSink 
    477541 
    478                                                 onProgress: function ( request, ctxt ,  progress , progressMax ) { 
     542                                                onProgress: function ( request, ctxt , progress , progressMax ) { 
    479543                                                        var value = 1000 * (self._offset + (self._window * progress / progressMax)); 
    480544                                                        self.cursor = value; 
     
    482546 
    483547                                                onStatus: function ( request , ctxt , status , statusArg ) { 
    484                                                         dump("===> onStatus status: "+status+" statusArg: "+statusArg+"\n");        
     548                                                        dump("===> onStatus status: "+status+" statusArg: "+statusArg+"\n"); 
    485549                                                }, 
    486550 
     
    489553                                                        if(iid.equals(Components.interfaces.nsIProgressEventSink)) { 
    490554                                                                return this; 
    491                                                         }      
     555                                                        } 
    492556                                                        Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE; 
    493557                                                        return null; 
     
    505569 
    506570                                        this._zoomplayer.drawGraph(); 
    507           this.cursor = 0; 
     571                                        this.cursor = 0; 
    508572 
    509573                                        this.updatePlot(); 
    510574                                ]]></body> 
    511575                        </method> 
    512  
    513                         <property name="audioStream"> 
    514                                 <getter><![CDATA[ 
    515                                         if (!this.srcAudio) 
    516                                                 return null; 
    517                                         if (!this._audioStream) { 
    518                                                 this._audioStream = Components.classes["@scenari.org/audio/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); 
    519                                                 this._audioStream.init(this.srcAudio, 1, 0, Components.interfaces.nsIFileInputStream.REOPEN_ON_REWIND); 
    520                                                 this._audioStream.QueryInterface(Components.interfaces.scIAudioStream); 
    521                                         } 
    522                                          
    523                                         return this._audioStream; 
    524                                 ]]></getter> 
    525                         </property> 
    526576 
    527577                        <method name="play"> 
     
    544594                                                this._audioPlayer.contentStream = this.audioStream; 
    545595 
    546                                                 this._audioPlayer.frameSegmentSize  = 512; 
     596                                                this._audioPlayer.frameSegmentSize = 512; 
    547597                                                this._audioPlayer.frameSegmentCount = 10; 
    548598 
     
    555605                                ]]></body> 
    556606                        </method> 
     607 
    557608                        <method name="stop"> 
    558609                                <body><![CDATA[ 
     
    588639                        <method name="redraw"> 
    589640                                <body><![CDATA[ 
    590                                                 this.innerSvg.style.visibility = "hidden"; 
    591                                                 this.innerSvg.style.visibility = "visible"; 
    592                                                 this._zoomarea.style.visibility = "hidden"; 
    593                                                 this._zoomarea.style.visibility = "visible"; 
     641                                        this.innerSvg.style.visibility = "hidden"; 
     642                                        this.innerSvg.style.visibility = "visible"; 
     643                                        this._zoomarea.style.visibility = "hidden"; 
     644                                        this._zoomarea.style.visibility = "visible"; 
    594645                                ]]></body> 
    595646                        </method> 
     
    611662                        </method> 
    612663 
    613                         <property name="innerSvg" readonly="true"> 
    614                                 <getter><![CDATA[ 
    615                                         return document.getAnonymousElementByAttribute(this, "anonid", "svgbody"); 
    616                                 ]]></getter> 
    617                         </property> 
    618                          
    619                         <property name="inner" readonly="true"> 
    620                                 <getter><![CDATA[ 
    621                                         return document.getAnonymousNodes(this)[0]; 
    622                                 ]]></getter> 
    623                         </property> 
    624  
    625664                        <method name="updateZoom"> 
    626665                                <parameter name="x1" /> 
     
    632671                                ]]></body> 
    633672                        </method> 
    634  
    635                         <property name="duration"> 
    636                                 <getter><![CDATA[ 
    637                                         return this._duration;           
    638                                 ]]></getter> 
    639                         </property> 
    640673 
    641674                        <method name="askForCutRequest"> 
     
    666699                                ]]></body> 
    667700                        </method> 
     701 
    668702                        <method name="updatePlot"> 
    669703                                <body><![CDATA[ 
     
    681715                                                        var vNode; 
    682716                                                        while ( (vNode = sectionWalker.nextNode()) ) { 
    683                                                                 var plot  = document.createElementNS("http://www.w3.org/2000/svg", "line"); 
     717                                                                var plot = document.createElementNS("http://www.w3.org/2000/svg", "line"); 
    684718                                                                plot.setAttribute("x1", 70 + (vNode.start * 0.925)); 
    685719                                                                plot.setAttribute("x2", 70 + (vNode.start * 0.925)); 
     
    694728                                ]]></body> 
    695729                        </method> 
     730 
    696731                        <method name="playFromCursor"> 
    697732                                <body><![CDATA[ 
     
    701736                                ]]></body> 
    702737                        </method> 
    703                          
    704                         <property name="cursor"> 
    705                                 <setter><![CDATA[ 
    706                                         this._mainplayer.cursor = val; 
    707                                         this._segplayer.cursor = val; 
    708                                         this._zoomplayer.cursor = val; 
    709  
    710                                         var i; 
    711                                         var child; 
    712                                         for (i = 0; i < this.childNodes.length; i++) { 
    713                                         child = this.childNodes[i]; 
    714                                                 if (child.localName == "area") { 
    715                                                         child.cursor = val; 
    716                                                 } 
    717                                         } 
    718                                 ]]></setter> 
    719                                 <getter><![CDATA[ 
    720                                         return this._mainplayer.cursor; 
    721                                 ]]></getter> 
    722                         </property> 
    723  
    724738                </implementation> 
    725739        </binding> 
    726  
    727  
    728740</bindings> 
  • branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/background.xml

    r9275 r9276  
    4444        xmlns:ec="http://ircam.fr/ecoute" xmlns:xlink="http://www.w3.org/1999/xlink" 
    4545        xmlns:svg="http://www.w3.org/2000/svg"> 
    46  
    47  
    48  
    4946        <binding id="background" extends="svg:generic"> </binding> 
    50  
    51  
    5247</bindings> 
  • branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/section.xml

    r9275 r9276  
    11<?xml version="1.0"?> 
    2   
    3  
    42<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" 
    53        xmlns:html="http://www.w3.org/1999/xhtml" 
     
    5654                                const RIGHT = 1; 
    5755 
    58  
    59  
    6056                                this.isBinded = true; 
    6157                                this._handles_rect = document.getAnonymousElementByAttribute(this, "anonid", "handles_rect"); 
     
    6662                                this._sectioneltAnchorRect = document.getAnonymousElementByAttribute(this, "anonid", "sectionAnchorRect"); 
    6763 
    68  
    6964                                var self = this; 
    7065 
     
    7368                                                if (self.audioElt.focusedSegment == self) return; 
    7469                                                self.audioElt.setFocusOnSegment(self); 
    75             event.stopPropagation(); 
    76                                         } else { 
    77             self.ownerArea.updateRatio(); 
    78             var ratio = self.ownerArea._ratio; 
    79             var val = event.layerX - (self.audioElt._zoomarea.x.baseVal.value * self.audioElt._segplayer._ratio); 
    80             var z1 = self.audioElt._zoomplayer.t1; 
    81             self.audioElt.cursor = (z1 * ratio + val) / ratio; 
     70                                                event.stopPropagation(); 
     71                                        } else { 
     72                                                self.ownerArea.updateRatio(); 
     73                                                var ratio = self.ownerArea._ratio; 
     74                                                var val = event.layerX - (self.audioElt._zoomarea.x.baseVal.value * self.audioElt._segplayer._ratio); 
     75                                                var z1 = self.audioElt._zoomplayer.t1; 
     76                                                self.audioElt.cursor = (z1 * ratio + val) / ratio; 
    8277                                                self.audioElt.playFromCursor(); 
    8378                                        } 
     
    107102                                } 
    108103                        ]]></constructor> 
     104 
    109105                        <field name="audioElt" /> 
     106 
     107                        <field name="segmentOwner" /> 
     108 
     109                        <field name="isModified" /> 
     110 
     111                        <property name="start_Second"> 
     112                                <getter><![CDATA[ 
     113                                        return this.start * this.audioElt.duration / 1000; 
     114                                ]]></getter> 
     115                        </property> 
     116 
     117                        <property name="end_Second"> 
     118                                <getter><![CDATA[ 
     119                                        return this.end * (this.audioElt.duration / 1000); 
     120                                ]]></getter> 
     121                        </property> 
     122 
     123                        <property name="childSections"> 
     124                                <getter><![CDATA[ 
     125                                        var child = new Array();                 
     126                                        if (this.hasChildSections()) { 
     127                                                var aChild = this.firstSection; 
     128                                                do { 
     129                                                        child.push(aChild); 
     130                                                        aChild = aChild.nextSection; 
     131                                                } while(aChild); 
     132                                        } 
     133                                        return child; 
     134                                ]]></getter> 
     135                        </property> 
     136 
     137                        <property name="end"> 
     138                                <getter><![CDATA[ 
     139                                        return this._inMemoryEnd; 
     140                                ]]></getter> 
     141 
     142                                <setter><![CDATA[ 
     143                                        if (this._sectionelt) { 
     144                                                if (this._inMemoryEnd != val) { 
     145                                                        this.isModified = true; 
     146                                                } 
     147                                                var vLength = val - this._inMemoryStart; 
     148                                                this._sectionelt.width.baseVal.value = vLength; 
     149                                                this._handles_rect.width.baseVal.value = vLength; 
     150                                                this._handles_right.x.baseVal.value = val; 
     151                                                this._inMemoryEnd = val; 
     152                                        } 
     153                                ]]></setter> 
     154                        </property> 
     155 
     156 
     157                        <property name="previousSection"> 
     158                                <getter><![CDATA[ 
     159                                        var previoussibling = this; 
     160                                        do { 
     161                                                previoussibling = previoussibling.previousSibling; 
     162                                        } while (previoussibling && previoussibling.localName != "section"); 
     163                                        if (previoussibling && previoussibling.localName != "section") return null; 
     164                                        return previoussibling;  
     165                                         
     166                                ]]></getter> 
     167                        </property> 
     168 
     169                        <property name="parentSection"> 
     170                                <getter><![CDATA[ 
     171                                        if (this.parentNode.localName == "section") { 
     172                                                return this.parentNode; 
     173                                        } else { 
     174                                                if (this.parentNode.parentNode && this.parentNode.parentNode.localName == "section") { 
     175                                                        return this.parentNode.parentNode; 
     176                                                } else { 
     177                                                        return null; 
     178                                                } 
     179                                        } 
     180                                ]]></getter> 
     181                        </property> 
     182 
     183                        <property name="firstSection"> 
     184                                <getter><![CDATA[ 
     185                                        var nextsibling = this.container; 
     186                                        nextsibling = nextsibling.firstChild; 
     187                                        while (nextsibling && nextsibling.localName != "section") { 
     188                                                nextsibling = nextsibling.nextSibling; 
     189                                        } 
     190                                        return nextsibling;      
     191                                ]]></getter> 
     192                        </property> 
     193 
     194                        <property name="lastSection"> 
     195                                <getter><![CDATA[ 
     196                                        var previoussibling = this.container; 
     197                                        previoussibling = previoussibling.lastChild; 
     198                                        while (previoussibling && previoussibling.localName != "section") { 
     199                                                previoussibling = previoussibling.previousSibling; 
     200                                        } 
     201                                        return previoussibling;  
     202                                ]]></getter> 
     203                        </property> 
     204 
     205                        <property name="nextSection"> 
     206                                <getter><![CDATA[ 
     207                                        var nextsibling = this; 
     208                                        do { 
     209                                                nextsibling = nextsibling.nextSibling; 
     210                                        } while (nextsibling && nextsibling.localName != "section"); 
     211                                        if (nextsibling && nextsibling.localName != "section") return null; 
     212                                        return nextsibling;      
     213                                ]]></getter> 
     214                        </property> 
     215 
     216                        <property name="ownerArea"> 
     217                                <getter><![CDATA[ 
     218                                        if (!this.parentSection && this.parentNode.localName == "area") 
     219                                                return this.parentNode; 
     220                                        else 
     221                                                if (this.parentSection) 
     222                                                        return this.parentSection.ownerArea; 
     223                                                else 
     224                                                        return null; 
     225                                ]]></getter> 
     226                        </property> 
     227 
     228                        <property name="inner" readonly="true"> 
     229                                <getter><![CDATA[ 
     230                                        return document.getAnonymousNodes(this)[0]; 
     231                                ]]></getter> 
     232                        </property> 
     233 
     234                        <property name="container"> 
     235                                <getter><![CDATA[ 
     236                                        //return this; 
     237                                        var i; 
     238                                        for (i = 0; i < this.childNodes.length; i++) { 
     239                                                if (this.childNodes[i].localName == "g") 
     240                                                        return this.childNodes[i]; 
     241                                        } 
     242                                        throw "A section *must* host a <svg:g> element" + this.firstChild; 
     243                                ]]></getter> 
     244                        </property> 
     245 
    110246                        <method name="init"> 
    111247                                <parameter name="audioElt" /> 
     
    120256                                        var vChilds = this.childSections; 
    121257                                        for (i = 0; i < vChilds.length; i++) { 
    122             if ("init" in vChilds[i]) 
    123                                                 vChilds[i].init(audioElt); 
    124                                         } 
    125                                 ]]></body> 
    126                         </method> 
    127  
    128                         <property name="start_Second"> 
    129                                 <getter><![CDATA[ 
    130                                         return this.start * this.audioElt.duration / 1000; 
    131                                 ]]></getter> 
    132                         </property> 
    133                         <property name="end_Second"> 
    134                                 <getter><![CDATA[ 
    135                                                 return this.end * (this.audioElt.duration / 1000); 
    136                                 ]]></getter> 
    137                         </property> 
     258                                                if ("init" in vChilds[i]) 
     259                                                        vChilds[i].init(audioElt); 
     260                                        } 
     261                                ]]></body> 
     262                        </method> 
     263 
    138264                        <method name="resetStart"> 
    139265                                <parameter name="newStart_msSecond" /> 
    140  
    141                                 <body><![CDATA[ 
    142                                                 this._inMemoryEnd = null; 
    143                                                 this._inMemoryStart = null; 
    144                                                 this.setAttribute("start", newStart_msSecond); 
    145                                                 //update _inMemoryStart 
    146                                                 this.start; 
    147             this.end; 
    148                                 ]]></body> 
    149                         </method> 
    150  
    151                         <field name="segmentOwner" /> 
     266                                <body><![CDATA[ 
     267                                        this._inMemoryEnd = null; 
     268                                        this._inMemoryStart = null; 
     269                                        this.setAttribute("start", newStart_msSecond); 
     270                                        //update _inMemoryStart 
     271                                        this.start; 
     272                                        this.end; 
     273                                ]]></body> 
     274                        </method> 
    152275 
    153276                        <method name="removeSection"> 
     
    193316                                                this.container.insertBefore(pNewSection, pBeforeSection); 
    194317                                        } else { 
    195             if (this.hasChildSections()) { 
    196               var oldLastChild = this.lastSection;  
    197               var vInsertPos = ("_TimeToCut" in this.audioElt) ? this.audioElt._TimeToCut : null;  
    198               if(vInsertPos == null || vInsertPos < oldLastChild.start_Second || vInsertPos > oldLastChild.end_Second) {  
    199                 var vInsertPos = (oldLastChild.start_Second + oldLastChild.end_Second) / 2;  
    200               }  
    201               pNewSection.setAttribute("start", vInsertPos);  
    202               pOthersSegmentsUpdated.push(oldLastChild);  
    203               this.container.appendChild(pNewSection);  
    204             } else { 
    205               pNewSection.setAttribute("start", this.start_Second); 
    206                                                 this.container.appendChild(pNewSection); 
    207             } 
     318                                                if (this.hasChildSections()) { 
     319                                                        var oldLastChild = this.lastSection;  
     320                                                        var vInsertPos = ("_TimeToCut" in this.audioElt) ? this.audioElt._TimeToCut : null;  
     321                                                        if(vInsertPos == null || vInsertPos < oldLastChild.start_Second || vInsertPos > oldLastChild.end_Second) {  
     322                                                                var vInsertPos = (oldLastChild.start_Second + oldLastChild.end_Second) / 2;  
     323                                                        }  
     324                                                        pNewSection.setAttribute("start", vInsertPos);  
     325                                                        pOthersSegmentsUpdated.push(oldLastChild);  
     326                                                        this.container.appendChild(pNewSection);  
     327                                                } else { 
     328                                                        pNewSection.setAttribute("start", this.start_Second); 
     329                                                        this.container.appendChild(pNewSection); 
     330                                                } 
    208331                                        } 
    209332                                        pNewSection.segmentOwner = pSegmentOwner; 
     
    214337                        </method> 
    215338 
    216                                 <property name="nextSection"> 
    217                                 <getter><![CDATA[ 
    218                                         var nextsibling = this; 
    219                                         do { 
    220                                                 nextsibling = nextsibling.nextSibling; 
    221                                         } while (nextsibling && nextsibling.localName != "section"); 
    222           if (nextsibling && nextsibling.localName != "section") return null; 
    223                                         return nextsibling;      
    224                                 ]]></getter> 
    225                         </property> 
    226                         <property name="previousSection"> 
    227                                 <getter><![CDATA[ 
    228                                         var previoussibling = this; 
    229                                         do { 
    230                                                 previoussibling = previoussibling.previousSibling; 
    231                                         } while (previoussibling && previoussibling.localName != "section"); 
    232           if (previoussibling && previoussibling.localName != "section") return null; 
    233                                         return previoussibling;  
    234                                          
    235                                 ]]></getter> 
    236                         </property> 
    237                         <property name="parentSection"> 
    238                                 <getter><![CDATA[ 
    239                                         if (this.parentNode.localName == "section") { 
    240                                                 return this.parentNode; 
    241                                         } else { 
    242                                                 if (this.parentNode.parentNode && this.parentNode.parentNode.localName == "section") { 
    243                                                         return this.parentNode.parentNode; 
    244                                                 } else { 
    245                                                         return null; 
    246                                                 } 
    247                                         } 
    248                                 ]]></getter> 
    249                         </property> 
    250                         <property name="firstSection"> 
    251                                 <getter><![CDATA[ 
    252                                         var nextsibling = this.container; 
    253                                         nextsibling = nextsibling.firstChild; 
    254                                         while (nextsibling && nextsibling.localName != "section") { 
    255                                                 nextsibling = nextsibling.nextSibling; 
    256                                         } 
    257                                         return nextsibling;      
    258                                 ]]></getter> 
    259                         </property> 
    260                         <property name="lastSection"> 
    261                                 <getter><![CDATA[ 
    262                                         var previoussibling = this.container; 
    263                                         previoussibling = previoussibling.lastChild; 
    264                                         while (previoussibling && previoussibling.localName != "section") { 
    265                                                 previoussibling = previoussibling.previousSibling; 
    266                                         } 
    267                                         return previoussibling;  
    268                                 ]]></getter> 
    269                         </property> 
    270339                        <method name="hasChildSections"> 
    271340                                <body><![CDATA[ 
     
    273342                                ]]></body> 
    274343                        </method> 
    275                         <property name="childSections"> 
    276                                 <getter><![CDATA[ 
    277                                         var child = new Array();                 
    278                                         if (this.hasChildSections()) { 
    279                                                 var aChild = this.firstSection; 
    280                                                 do { 
    281                                                         child.push(aChild); 
    282                                                         aChild = aChild.nextSection; 
    283                                                 } while(aChild); 
    284                                         } 
    285                                         return child; 
    286                                 ]]></getter> 
    287                         </property> 
    288  
    289                         <field name="isModified" /> 
    290                         <property name="end"> 
    291                                 <getter><![CDATA[ 
    292                                         return this._inMemoryEnd; 
    293                                 ]]></getter> 
    294                                 <setter><![CDATA[ 
    295                                         if (this._sectionelt) { 
    296                                                 if (this._inMemoryEnd != val) { 
    297                                                         this.isModified = true; 
    298                                                 } 
    299                                                 var vLength = val - this._inMemoryStart; 
    300                                                 this._sectionelt.width.baseVal.value = vLength; 
    301                                                 this._handles_rect.width.baseVal.value = vLength; 
    302                                                 this._handles_right.x.baseVal.value = val; 
    303                                                 this._inMemoryEnd = val; 
    304                                         } 
    305                                 ]]></setter> 
    306                         </property> 
    307344 
    308345                        <method name="updateEndRequest"> 
     
    316353                                ]]></body> 
    317354                        </method> 
    318                                  
     355 
    319356                        <method name="updateStartRequest"> 
    320357                                <parameter name="value" /> 
     
    329366                                        var start = this.getAttribute("start"); 
    330367 
    331           if (this.previousSection) { 
    332                                         if (start && start != "") { 
    333                                                 this._inMemoryStart = start * 1000 / this.audioElt.duration; 
    334                                                 return this._inMemoryStart; 
    335             } else { 
     368                                        if (this.previousSection) { 
     369                                                if (start && start != "") { 
     370                                                        this._inMemoryStart = start * 1000 / this.audioElt.duration; 
     371                                                        return this._inMemoryStart; 
     372                                                } else { 
    336373                                                        if (this.nextSection) 
    337374                                                                this.resetStart(this.audioElt.duration * (this.previousSection.start + this.nextSection.start) / 2000); 
    338375                                                        else 
    339376                                                                this.resetStart(1000); 
    340             } 
    341           } else { 
    342                                         this._inMemoryStart = 0; 
    343                                         return this._inMemoryStart; 
    344           } 
    345  
    346           /* 
     377                                                } 
     378                                        } else { 
     379                                                this._inMemoryStart = 0; 
     380                                                return this._inMemoryStart; 
     381                                        } 
     382 
     383                                        /* 
    347384                                        if (start && start != "") { 
    348385                                                this._inMemoryStart = start * 1000 / this.audioElt.duration; 
     
    360397                                                } 
    361398                                        }; 
    362           */ 
     399                                        */ 
    363400 
    364401                                        return this.start; 
    365402                                ]]></getter> 
     403 
    366404                                <setter><![CDATA[ 
    367405                                        if (val === null) { 
    368406                                                val = this.start; 
    369407                                        } 
    370           if (!this.previousSection && val != 0) { 
     408                                        if (!this.previousSection && val != 0) { 
    371409                                                return; 
    372           } 
     410                                        } 
    373411 
    374412                                        if (this._inMemoryStart != val) 
     
    417455                                ]]></setter> 
    418456                        </property> 
     457 
    419458                        <method name="compute"> 
    420459                                <body><![CDATA[ 
    421                                                 this.setAttribute("start", this._inMemoryStart * (this.audioElt.duration / 1000)); 
    422                                                 this._collided_prev = null; 
    423                                                 this._collided_next = null; 
    424                                 ]]></body> 
    425                         </method> 
    426  
    427  
    428                         <property name="ownerArea"> 
    429                                 <getter><![CDATA[ 
    430                                         if (!this.parentSection && this.parentNode.localName == "area") 
    431                                                 return this.parentNode; 
    432                                         else 
    433                                                 if (this.parentSection) 
    434                                                         return this.parentSection.ownerArea; 
    435                                                 else 
    436                                                         return null; 
    437                                 ]]></getter> 
    438                         </property> 
    439  
    440                         <property name="inner" readonly="true"> 
    441                                 <getter><![CDATA[ 
    442                                         return document.getAnonymousNodes(this)[0]; 
    443                                 ]]></getter> 
    444                         </property> 
    445  
    446                         <property name="container"> 
    447                                 <getter><![CDATA[ 
    448                                         //return this; 
    449                                         var i; 
    450                                         for (i = 0; i < this.childNodes.length; i++) { 
    451                                                 if (this.childNodes[i].localName == "g") 
    452                                                         return this.childNodes[i]; 
    453                                         } 
    454                                         throw "A section *must* host a <svg:g> element" + this.firstChild; 
    455                                 ]]></getter> 
    456                         </property> 
     460                                        this.setAttribute("start", this._inMemoryStart * (this.audioElt.duration / 1000)); 
     461                                        this._collided_prev = null; 
     462                                        this._collided_next = null; 
     463                                ]]></body> 
     464                        </method> 
     465 
    457466                </implementation> 
    458467        </binding> 
    459468 
    460         <binding id="section-ro" extends="svg:generic"> </binding> 
    461  
     469        <binding id="section-ro" extends="svg:generic" /> 
    462470</bindings> 
  • branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/subplayer.xml

    r9275 r9276  
    11<?xml version="1.0"?> 
    2   
    3  
    42<bindings xmlns="http://www.mozilla.org/xbl" xmlns:xbl="http://www.mozilla.org/xbl" 
    53        xmlns:html="http://www.w3.org/1999/xhtml" 
     
    119                <content> 
    1210                        <svg:g xbl:inherits="transform"> 
    13  
    1411                                <svg:g class="buttonplayer" anonid="button"> 
    1512                                        <svg:rect anonid="" x="0" y="0" width="40" height="40" /> 
     
    1714                                        <svg:rect anonid="stop" x="8" y="8" width="24" height="24" /> 
    1815                                </svg:g> 
     16 
    1917                                <svg:rect anonid="ext" x="70" y="0" width="1000" height="40" stroke-width="0" /> 
    2018                                <svg:text anonid="text1" x="84" y="30" font-size="28" fill="#000" stroke-width="0" /> 
     
    2321                                <svg:audiograph x="70" y="0" height="40" width="925" anonid="audiograph" /> 
    2422                                <svg:rect anonid="ground" x="70" y="0" width="925" height="40" fill-opacity="0" /> 
     23 
    2524                                <svg:g class="subzone" style="visibility: hidden;"> 
    26  
    2725                                        <svg:symbol id="zoneAnchorLeft" viewBox="15 0 40 40" preserveAspectRatio="none" 
    2826                                                overflow="visible"> 
     
    4240                                                height="36" stroke-width="2" /> 
    4341                                </svg:g> 
     42 
    4443                                <svg:svg anonid="cursor" x="0" y="0" width="10" height="40" viewBox="0 0 10 10" 
    4544                                        preserveAspectRatio="none"> 
     
    4847                        </svg:g> 
    4948                </content> 
     49 
    5050                <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> 
    7051                        <constructor><![CDATA[ 
    7152                                //FIXME: init() 
     
    132113                                                        var initValue = handle.x.baseVal.value; 
    133114                                                        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); 
    135116                                                } 
    136117                                                var groundClientLeft = self._audioElt._xulroot.boxObject.x + (self._ground.x.baseVal.value * self._ratio); 
     
    147128 
    148129                                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                                        } 
    154135                                } 
    155136 
     
    199180                                this._ratio = coordTrans2.x - coordTrans1.x; 
    200181 
    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> 
    202246 
    203247                        <method name="_notifyPlayListeners"> 
     
    269313                                        if (notify && modif) this._notifyResizeListeners( 
    270314                                                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, 
    272316                                                handle); 
    273317                                        return modif; 
     
    293337                                        if (notify && modif) this._notifyResizeListeners( 
    294338                                                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, 
    296340                                                'middle'); 
    297341                                        return modif; 
    298342                                ]]></body> 
    299343                        </method> 
    300  
    301344 
    302345                        <method name="addResizeListener"> 
     
    325368                                ]]></body> 
    326369                        </method> 
     370 
    327371                        <method name="showZone"> 
    328372                                <parameter name="show" /> 
     
    336380                        </method> 
    337381 
    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  
    355382                        <method name="setT1"> 
    356383                                <parameter name="val" /> 
     
    364391                        </method> 
    365392 
    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> 
    387393                        <method name="startplay"> 
    388394                                <body><![CDATA[ 
     
    390396                                ]]></body> 
    391397                        </method> 
     398 
    392399                        <method name="stopplay"> 
    393400                                <body><![CDATA[ 
     
    395402                                ]]></body> 
    396403                        </method> 
    397  
    398404                </implementation> 
     405 
    399406                <handlers> 
    400407                        <handler event="DOMMouseScroll"><![CDATA[ 
  • branches/xAudioHier/Xul_Audio/chrome/content/audio-toolkit/waves.xml

    r9275 r9276  
    5353                                preserveAspectRatio="none" /> 
    5454                </content> 
     55 
    5556                <implementation> 
    5657                        <property name="inner" readonly="true"> 
     
    5960                                ]]></getter> 
    6061                        </property> 
     62 
    6163                        <method name="drawGraph"> 
    6264                                <parameter name="file" /> 
     
    9597 
    9698                                                        var mIoSrvc = Components.classes["@mozilla.org/network/io-service;1"] 
    97                                                                                                                                 .getService(Components.interfaces.nsIIOService);          
     99                                                                                                                                .getService(Components.interfaces.nsIIOService); 
    98100 
    99101                                                        var src = audioGraphUri + "?index=" + idx; 
     
    127129                                                 
    128130                                        // Create a Parameter objects which will hold the images list 
    129                                         var gParameters =  DaimFactory.createInstance("@daim.project/parameters;1", Components.interfaces.nsIDaimParameters); 
     131                                        var gParameters = DaimFactory.createInstance("@daim.project/parameters;1", Components.interfaces.nsIDaimParameters); 
    130132 
    131133                                        // Assign imagelist 
     
    135137                                        // Drawing helper 
    136138 
    137                                         var gCanvas = DaimFactory.createInstance("@daim.project/draw2d;1", Components.interfaces.nsIDaimDraw2d);                              
     139                                        var gCanvas = DaimFactory.createInstance("@daim.project/draw2d;1", Components.interfaces.nsIDaimDraw2d); 
    138140                         
    139141                                        // Create the image in which the graph will be drawn 
     
    155157                                ]]></body> 
    156158                        </method> 
     159 
    157160                        <method name="hideGraph"> 
    158161                                <body><![CDATA[ 
Note: See TracChangeset for help on using the changeset viewer.