<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE window SYSTEM "chrome://transerver/locale/transerver.dtd">
<?xml-stylesheet href="chrome://transerver/skin/css/feature.css" type="text/css"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" doctype-public="-//MOZILLA//DTD XUL V1.0//EN"/>
<xsl:template match="/root">
    
    <window id="media_tree"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
				flex="1"
        >
        <vbox flex="1">
            <label style="font-weight: bolder">&media.file.original;</label>
            <tree flex="1">
                <treecols>
                    <treecol label="&converter.parameter;" flex="1"/>
                    <treecol label="&converter.value;" flex="1"/>
                </treecols>
                <treechildren>                    
                    <treeitem >
                        <treerow properties="sectionHeader">
                            <treecell properties="sectionHeader" label="&converter.container;" class="treeCaptain"></treecell>
                        </treerow>
                    </treeitem>
                    <treeitem>
                        <treerow>
                            <treecell label="&converter.format;"/>
                            <treecell><xsl:attribute name="label"><xsl:value-of select="input/stream/container"/></xsl:attribute></treecell>
                        </treerow>
                    </treeitem>
                    <treeitem>
                         <treerow>
                            <treecell label="&player.bitrate;"/>
                            <treecell>
								<xsl:attribute name="label">
									<xsl:if test="input/stream/bitrate &gt; 0">
										<xsl:value-of select="input/stream/bitrate"/>Kbps
									</xsl:if>
								</xsl:attribute>
							</treecell>
                        </treerow>
                    </treeitem>
                    <treeitem>
                         <treerow>
                            <treecell label="&media.file.duration;"/>
                            <treecell><xsl:attribute name="label"><xsl:value-of select="input/stream/duration"/></xsl:attribute></treecell>
                        </treerow>
                    </treeitem>
                    <xsl:for-each select="input/video">
						<treeitem>
							<treerow properties="sectionHeader">
								<treecell properties="sectionHeader" label="&overall.label.video;" style="font-weight: bolder"></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&converter.format;"/>
								<treecell><xsl:attribute name="label"><xsl:value-of select="codec"/></xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							 <treerow>
								<treecell label="&player.bitrate;"/>
								<treecell><xsl:attribute name="label">
									<xsl:if test="bitrate &gt; 0">
										<xsl:value-of select="bitrate"/>Kbps
									</xsl:if>
								</xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&converter.resolution;"/>
								<treecell><xsl:attribute name="label">
									<xsl:if test="width &gt; 0">
										<xsl:value-of select="width"/> x <xsl:value-of select="height"/>
									</xsl:if>
								</xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&prefMan.label.aspect;"/>
								<treecell><xsl:attribute name="label">
									<xsl:if test="dar &gt; 0">
										<xsl:value-of select="dar"/>/<xsl:value-of select="dar.den"/>
									</xsl:if>
								</xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&converter.framerate;"/>
								<treecell><xsl:attribute name="label">
									<xsl:if test="fps &gt; 0">
										<xsl:value-of select="fps"/>/<xsl:value-of select="fps.den"/>
									</xsl:if>
								</xsl:attribute></treecell>
							</treerow>
						</treeitem>
					</xsl:for-each>
					<xsl:for-each select="input/audio">
						<treeitem>
							<treerow properties="sectionHeader">
								<treecell properties="sectionHeader" label="&overall.label.audio;" style="font-weight: bolder"></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="ID"/>
								<treecell><xsl:attribute name="label"><xsl:value-of select="codecId"/></xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&converter.format;"/>
								<treecell><xsl:attribute name="label"><xsl:value-of select="codec"/></xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&player.bitrate;"/>
								<treecell><xsl:attribute name="label">
									<xsl:if test="bitrate &gt; 0">
										<xsl:value-of select="bitrate"/>Kbps
									</xsl:if>
								</xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
							<treerow>
								<treecell label="&converter.samplerate;"/>
								<treecell><xsl:attribute name="label">
									<xsl:if test="samplerate &gt; 0">
										<xsl:value-of select="samplerate"/>Hz
									</xsl:if>
								</xsl:attribute></treecell>
							</treerow>
						</treeitem>
						<treeitem>
                        <treerow>
                            <treecell label="&prefMan.label.channel;"/>
                            <treecell><xsl:attribute name="label">
								<xsl:if test="channels &gt; -1">
									<xsl:value-of select="channels"/>
								</xsl:if>
							</xsl:attribute></treecell>
                        </treerow>
                    </treeitem>
					</xsl:for-each>
				</treechildren>
            </tree>
            <separator class="groove"></separator>
            <label style="font-weight: bolder">&media.file.transcoded;</label>
            <tree flex="1">
                <treecols>
                    <treecol label="&converter.parameter;" flex="1"/>
                    <treecol label="&converter.value;" flex="1"/>
                </treecols>
                <treechildren>
                    <xsl:for-each select="output/stream">
                        <treeitem>
                            <treerow properties="sectionHeader">
                                <treecell properties="sectionHeader"><xsl:attribute name="label">&converter.container;(<xsl:value-of select="id"></xsl:value-of>)</xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                                <treecell label="&converter.format;"/>
                                <treecell><xsl:attribute name="label"><xsl:value-of select="container"/></xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                               <treecell label="&media.file.duration;"/>
                               <treecell><xsl:attribute name="label"><xsl:value-of select="duration"/></xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                    </xsl:for-each>
                    <xsl:for-each select="output/video">
                        <treeitem>
                            <treerow properties="sectionHeader">
                                <treecell properties="sectionHeader"><xsl:attribute name="label">&overall.label.video;(<xsl:value-of select="id"></xsl:value-of>)</xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                                <treecell label="&converter.format;"/>
                                <treecell><xsl:attribute name="label"><xsl:value-of select="codec"/></xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                               <treecell label="&player.bitrate;"/>
                               <treecell><xsl:attribute name="label">
									<xsl:if test="bitrate &gt; 0">
										<xsl:value-of select="bitrate"/>Kbps
									</xsl:if>
							   </xsl:attribute></treecell>
                           </treerow>
                       </treeitem>
                       <treeitem>
                           <treerow>
                               <treecell label="&converter.resolution;"/>
                               <treecell><xsl:attribute name="label">
									<xsl:if test="width &gt; 0">
										<xsl:value-of select="width"/> x <xsl:value-of select="height"/>
									</xsl:if>
							   </xsl:attribute></treecell>
                           </treerow>
                       </treeitem>
					   <treeitem>
                        <treerow>
                            <treecell label="&prefMan.label.aspect;"/>
                            <treecell><xsl:attribute name="label">
								<xsl:if test="dar &gt; 0">
									<xsl:value-of select="dar"/>/<xsl:value-of select="dar.den"/>
								</xsl:if>
							</xsl:attribute></treecell>
                        </treerow>
                    </treeitem>
                       <treeitem>
                            <treerow>
                                <treecell label="&converter.framerate;"/>
                                <treecell><xsl:attribute name="label">
									<xsl:if test="fps &gt; 0">
										<xsl:value-of select="fps"/>/<xsl:value-of select="fps.den"/>
									</xsl:if>
								</xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                    </xsl:for-each>
                    <xsl:for-each select="output/audio">
                        <treeitem>
                            <treerow properties="sectionHeader">
                                <treecell properties="sectionHeader"><xsl:attribute name="label">&overall.label.audio;(<xsl:value-of select="id"></xsl:value-of>)</xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                                <treecell label="&converter.format;"/>
                                <treecell><xsl:attribute name="label"><xsl:value-of select="codec"/></xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                                <treecell label="&converter.samplerate;"/>
                                <treecell><xsl:attribute name="label">
									<xsl:if test="samplerate &gt; 0">
										<xsl:value-of select="samplerate"/>Hz
									</xsl:if>
								</xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                        <treeitem>
                            <treerow>
                                <treecell label="&prefMan.label.channel;"/>
                                <treecell><xsl:attribute name="label">
									<xsl:if test="channels &gt; -1">
										<xsl:value-of select="channels"/>
									</xsl:if>
								</xsl:attribute></treecell>
                            </treerow>
                        </treeitem>
                    </xsl:for-each>
                </treechildren>
            </tree>
        </vbox>
    </window>
</xsl:template>
</xsl:stylesheet>