<?xml version="1.0"?>
<!DOCTYPE window SYSTEM "chrome://transerver/locale/transerver.dtd">
<?xul-overlay href="basictab.xul"?>
<overlay id="prefman_overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <vbox id="PrefPage">
    <hbox flex="1">
      <vbox id="PrefPage_left_box">     
        <tree id="LocalPreserFileTree" flex="1"  hidecolumnpicker="false"  seltype="single"  class="tree" onselect="OnPrefTreeSelect(this)" onblur="">
          <treecols id="treecols">
            <treecol id="lpf_tree_col1" primary="true" flex="1" label="Preset File"></treecol>
          </treecols>          
          <treechildren>
            <treeitem container="true" open="true">
              <treerow ><treecell label="Local Root" mtype="root" id="lpf_tree_cell"/></treerow>
              <treechildren id="lpf_tree_children"/>
            </treeitem>
            <treeitem container="true" open="false" hidden="true" id="rpf_tree_item">
              <treerow ><treecell label="Remote Root" mtype="remote_root" remote="true" id="rpf_tree_cell"/></treerow>
              <treechildren id="rpf_tree_children"/>
            </treeitem>
          </treechildren>
        </tree>       
        <hbox>
           <image class="btn_imgsmall pref_op_btn add_floder_pref" id="add_folder_pref" onclick="addPrefFolder()" tooltiptext="&overall.label.add;"></image>
            <image class="btn_imgsmall pref_op_btn" id="add_pref" onclick="addNewPref()" tooltiptext="&overall.label.add;"></image>
            <image class="btn_imgsmall pref_op_btn" id="del_pref" onclick="removePref()" tooltiptext="&overall.label.remove;"></image>
            <image class="btn_imgsmall pref_op_btn" id="rename_pref" onclick="renamePref()"  tooltiptext="&overall.label.rename;"></image>          
            <image class="btn_imgsmall pref_op_btn" id="save_pref" onclick="saveCurPref()" tooltiptext="&overall.label.save;"></image>
            <image class="btn_imgsmall pref_op_btn" id="import_pref" onclick="importPref()" tooltiptext="&overall.label.import;"></image>
            <image class="btn_imgsmall pref_op_btn" id="export_pref" onclick="exportCurPref()" tooltiptext="&overall.label.export;"></image>          
        </hbox>
        <hbox>          
            <button label="Apply to MediaCoder" oncommand="ApplyPrefSet()" flex="1"></button>
        </hbox>
		<spacer height="10"/>
      </vbox>
      <tabbox flex="1">
        <tabs>
          <tab label="&prefMan.label.normal;" style="font-weight:bold" oncommand="isSymbol=false;updateBasicSetting(currentPrefItemDoc);isSymbol=true;" />
          <tab label="&prefMan.label.advanced;" style="font-weight:bold" oncommand="UpdateAdvancedSetting(currentPrefItemDoc, mccoreDoc);ChangeSettingBox(1);" />
          <tab id="adv_pref_panel_all" label="&prefMan.label.advancedall;" style="font-weight:bold" oncommand="UpdateSettingsAll(currentPrefItemDoc, mccoreDoc);ChangeSettingBox(2);" />
        </tabs>
        <tabpanels flex="1">
          <tabpanel>       
          <vbox flex="1">
            <groupbox>
              <caption align="center" class="uniqueBack">
                <label style="font-weight:bold">&prefMan.label.video;</label>
                <checkbox id="check_video_enable" label="&overall.label.enable;" checked="true" oncommand="enableVideo(this.checked)"></checkbox>
                <checkbox id="check_video_copy" label="&prefMan.check.copy;" checked="false" oncommand="enableCopyVideo(this.checked)"></checkbox>
                <checkbox id="cuda_enable" label="&pref.cuda.enable;" checked="false" oncommand="enableCuda(this.checked)"></checkbox>
                <checkbox id="avisynth_enable" label="&prefMan.label.avisynth;" checked="false" oncommand="enableAviSynth(this.checked)"></checkbox> 
              </caption>
              <grid>
                <columns>
                  <column />
                  <column />
                  <column />
                  <column />
                  <column />
                  <column />
                </columns>
                <rows>
                  <row align="center">
                    <label>&prefMan.label.format;</label>
                    <menulist id="menu_video_format" oncommand="menuVideoFormatChange(this);">
                      <menupopup>
                        <menuitem label="XVID" value="XviD" />
                        <menuitem label="H.264" value="H.264" />
                        <menuitem label="MPEG1" value="MPEG1" />
                        <menuitem label="MPEG2" value="MPEG2" />
                        <menuitem label="MPEG4" value="MPEG4" />
                        <menuitem label="FLV" value="Flash Video" />
                        <menuitem label="THEORA" value="Theora" />
                        <menuitem label="VC-1" value="VC-1" />
                        <menuitem label="WMV 7" value="WMV 7" />
                        <menuitem label="WMV 8" value="WMV 8" />
                        <menuitem label="WMV 9" value="WMV 9" />
                        <menuitem label="DIRAC" value="Dirac Video" />                       
                        <menuitem label="RM" value="RealVideo" />
                        <menuitem label="H.263" value="H.263" />
                        <menuitem label="H.263P" value="H.263+" />
                        <menuitem label="H.261" value="H.261" />
                        <menuitem label="MSMPEG4V2" value="MS-MPEG4-V2" />
                        <menuitem label="DV" value="DV Video" />
                        <menuitem label="MJPEG" value="Motion JPEG" />
                        <menuitem label="LJPEG" value="Lossless JPEG" />
                        <menuitem label="HUFFYUV" value="Huffyuv" />
                        <menuitem label="SNOW" value="Snow" />
                        <menuitem label="AMV" value="AMV" />
                        <menuitem label="Matrox MPEG2-I" value="Matrox MPEG2-I" />
                        <menuitem label="Matrox MPEG2-I HD" value="Matrox MPEG2-I HD" />
                        <menuitem label="Matrox DVCAM" value="Matrox DVCAM" />
                        <menuitem label="Matrox DVPRO" value="Matrox DVPRO" />
                        <menuitem label="Matrox DVPRO50" value="Matrox DVPRO50" />
                        <menuitem label="Canopus DV" value="Canopus DV" />
                        <menuitem label="RAW" value="Raw Video" />
                      </menupopup>
                    </menulist>
                    <label>&prefMan.label.mode;</label>
                      <menulist id="menu_video_mode" oncommand="menuVideoModeChange(this)">
                        <menupopup>
                          <menuitem label="&overall.video.mode.abr;" value="0" />
                          <menuitem label="&overall.video.mode.vbr;" value="1" />
                          <menuitem label="&overall.video.mode.cbr;" value="2" />
                          <menuitem label="2-Pass" value="3" />
                          <menuitem label="3-Pass" value="4" />
                        </menupopup>
                      </menulist>                                         
                  </row>
                  <row align="center">
                    <label>&prefMan.label.resolution;</label>
                    <menulist id="menu_video_resolution" editable="true" value="Original" oninput="inputStart()" onblur="menuVideoResolutionChangeInput(this)" oncommand="menuVideoResolutionChange(this)">
                      <menupopup>
                        <menuitem label="&overall.label.origin;" value="Original" />
                        <menuitem label="1920x1080" value="1920x1080" />
                        <menuitem label="1440x816" value="1440x816" />
                        <menuitem label="1366x768" value="1366x768" />
                        <menuitem label="1280x720" value="1280x720" />
                        <menuitem label="1024x576" value="1024x576" />
                        <menuitem label="960x576" value="960x576" />
                        <menuitem label="768x576" value="768x576" />
                        <menuitem label="720x576" value="720x576" />
                        <menuitem label="720x480" value="720x480" />
                        <menuitem label="720x400" value="720x400" />
                        <menuitem label="640x480" value="640x480" />
                        <menuitem label="640x368" value="640x368" />
                        <menuitem label="624x352" value="624x352" />
                        <menuitem label="608x336" value="608x336" />
                        <menuitem label="512x384" value="512x384" />
                        <menuitem label="512x288" value="512x288" />
                        <menuitem label="480x320" value="480x320" />
                        <menuitem label="480x272" value="480x272" />
                        <menuitem label="368x208" value="368x208" />
                        <menuitem label="352x576" value="352x576" />
                        <menuitem label="352x480" value="352x480" />
                        <menuitem label="352x288" value="352x288" />
                        <menuitem label="352x240" value="352x240" />
                        <menuitem label="320x320" value="320x320" />
                        <menuitem label="320x240" value="320x240" />
                        <menuitem label="320x160" value="320x160" />
                        <menuitem label="240x180" value="240x180" />
                        <menuitem label="220x176" value="220x176" />
                        <menuitem label="208x176" value="208x176" />
                        <menuitem label="176x208" value="176x208" />
                        <menuitem label="176x144" value="176x144" />
                        <menuitem label="160x120" value="160x120" />
                        <menuitem label="160x96" value="160x96" />
                        <menuitem label="128x96" value="128x96" />
                        <menuitem label="128x64" value="128x64" />
                      </menupopup>
                    </menulist>
                    <label id="vbandvq_1">&prefMan.label.brate;</label>
                    <hbox align="center" id="vbandvq_2">
                        <textbox id="video_bit_text" width="80px" value="8000" type="number" onchange="menuVideoBitRateChange(this)"></textbox>
                        <label>Kbps</label>
                      </hbox>
                      <label hidden="true" id="vbandvq_3">&prefMan.label.quality;</label>
                      <hbox align="center" hidden="true" id="vbandvq_4">
                        <textbox id="video_quality_text" width="80px" value="8000"  type="number" onchange="menuVideoQualityChange(this)"></textbox>
                        <label>Kbps</label>
                      </hbox>  
                  </row>
                  <row align="center">
                    <label>&prefMan.label.aspect;</label>
                    <menulist id="menu_video_ratio" editable="true" value="Original" oninput="inputStart()" onblur="menuVideoRatioChangeInput(this)" oncommand="menuVideoRatioChange(this)">
                      <menupopup>
                        <menuitem label="&overall.label.origin;" value="Original" />
                        <menuitem label="4:3" value="4:3" />
                        <menuitem label="16:9" value="16:9" />
                        <menuitem label="5:4" value="5:4" />
                        <menuitem label="3:2" value="3:2" />
                        <menuitem label="2:1" value="2:1" />
                      </menupopup>
                    </menulist>                  
                    <label>&prefMan.label.maxbrate;</label>            
                       <hbox align="center">
                         <textbox id="video_maxbit_text" width="80px" value="0"  onchange="menuVideoMaxBitRateChange(this)" disabled='true' type="number"></textbox>
                         <label>Kbps</label>
                       </hbox>                     
                  </row>
                   <row align="center">
                        <label>&prefMan.label.crop;</label>
                        <menulist id="menu_crop_mode" oncommand="menuCropModeChange(this)">
                          <menupopup>
                            <menuitem label="&videofilter.crop.mode.disabled;" value="0" />
                            <menuitem label="&videofilter.crop.mode.crop2fit;" value="2" />
                            <menuitem label="&videofilter.crop.mode.expand2fit;" value="3" />
                          </menupopup>
                        </menulist>              
                        <label>&prefMan.label.minbrate;</label>            
                       <hbox align="center">
                         <textbox id="video_minbit_text" width="80px" value="0" onchange="menuVideoMinBitRateChange(this)" disabled='true'  type="number"></textbox>
                         <label>Kbps</label>
                       </hbox>
                  </row>
                    <row align="center">
                        <label>&prefMan.label.fps;</label>
                      <menulist id="menu_video_fps" editable="true" value="Original" oninput="inputStart()" onblur="menuVideoFpsChangeInput(this)" oncommand="menuVideoFpsChange(this)">
                        <menupopup>
                          <menuitem label="&overall.label.origin;" value="Original" />
                          <menuitem label="8" value="8" />
                          <menuitem label="10" value="10" />
                          <menuitem label="12.5" value="25/2" />
                          <menuitem label="15000/1001" value="15000/1001" />
                          <menuitem label="15" value="15" />
                          <menuitem label="20" value="20" />
                          <menuitem label="24000/1001" value="24000/1001" />
                          <menuitem label="24" value="24" />
                          <menuitem label="25" value="25" />
                          <menuitem label="30000/1001" value="30000/1001" />
                          <menuitem label="30" value="30" />
                        </menupopup>
                      </menulist>               
                          <label>&prefMan.label.buffersize;</label>            
                          <hbox align="center">
                            <textbox id="video_bufsize_text" width="80px" value="0" onchange="menuVideoBufSizeRateChange(this)" disabled='true' type="number"></textbox>
                            <label>Kbit</label>
                          </hbox>
                   </row>
                </rows>
              </grid>
            </groupbox>
            <groupbox>
              <caption align="center" class="uniqueBack">
                <label style="font-weight:bold">&prefMan.label.audio;</label>
                <checkbox id="check_audio_enable" label="&overall.label.enable;" checked="true" oncommand="enableAudio(this.checked)"></checkbox>
                <checkbox id="check_audio_copy" label="&prefMan.check.copy;" checked="false" oncommand="enableCopyAudio(this.checked)"></checkbox>
              </caption>
              <grid>
                <columns>
                  <column />
                  <column />
                  <column />
                  <column />
                </columns>
                <rows>
                  <row align="center">
                    <label>&prefMan.label.format;</label>
                    <menulist id="menu_audio_format" oncommand="menuAudioFormatChange(this)">
                      <menupopup>
                        <menuitem label="&overall.label.default;" value="Default" />
                        <menuitem label="MP3" value="MP3" />
                        <menuitem label="Vorbis" value="Vorbis" />
                        <menuitem label="AAC" value="LC-AAC" />
                        <menuitem label="AAC+" value="HE-AAC" />
                        <menuitem label="AAC+V2" value="HE-AAC V2" />
                        <menuitem label="WMA 7" value="WMA 7" />
                        <menuitem label="WMA 8" value="WMA 8" />
                        <menuitem label="WMA 9" value="WMA 9" />
                        <menuitem label="MP2" value="MP2" />
                        <menuitem label="AC3" value="AC3" />                        
                        <menuitem label="MPC" value="MusePack" />
                        <menuitem label="SPEEX" value="Speex" />
                        <menuitem label="AMR" value="AMR" />
                        <menuitem label="FLAC" value="FLAC" />
                        <menuitem label="APE" value="APE" />
			<menuitem label="WAVEPACK" value="WAVEPACK" />
	                <menuitem label="ALAC" value="ALAC" />
                        <menuitem label="PCM" value="PCM" />
                      </menupopup>
                    </menulist>
                    <label>&prefMan.label.channel;</label>
                    <menulist id="menu_audio_channel" oncommand="menuAudioChannelChange(this)">
                      <menupopup>
                        <menuitem label="&overall.label.origin;" value="Original" />                   
                        <menuitem label="&prefMan.label.channel.left;" value="1" />
                        <menuitem label="&prefMan.label.channel.right;" value="2" />
                        <menuitem label="&prefMan.label.channel.stereo;" value="3" />
                      </menupopup>
                    </menulist>
                  </row>
                  <row align="center">
                    <label>&prefMan.label.resample;</label>
                    <menulist id="menu_audio_resample" editable="true" value="Original" oninput="inputStart()" onblur="menuAudioResampleChangeInput(this)" oncommand="menuAudioResampleChange(this)">
                      <menupopup>
                        <menuitem label="&overall.label.origin;" value="Original" />
                        <menuitem label="8000Hz" value="8000" />
                        <menuitem label="11025Hz" value="11025" />
                        <menuitem label="16000Hz" value="16000" />
                        <menuitem label="22050Hz" value="22050" />
                        <menuitem label="24000Hz" value="24000" />
                        <menuitem label="32000Hz" value="32000" />
                        <menuitem label="44100Hz" value="44100" />
                        <menuitem label="48000Hz" value="48000" />
                      </menupopup>
                    </menulist>
                    <label>&prefMan.label.brate;</label>
                    <hbox>
                      <textbox id="audio_bit_text" width="80px" value="0" onchange="menuAudioBitRateChange(this)" type="number"></textbox>
                      <label>Kbps</label>
                    </hbox>
                  </row>
                </rows>
              </grid>
            </groupbox>
            <groupbox>
              <caption align="center" class="uniqueBack">
                <label style="font-weight:bold">&prefMan.label.container;</label>
              </caption>
              <grid>
                <columns>
                  <column />
                  <column />
                  <column />
                  <column />
                </columns>
                <rows>
                  <row align="center">
                    <label>&prefMan.label.format;</label>
                    <menulist id="menu_muxer_format" oncommand="menuMuxerFormatChange(this)">
                      <menupopup>
                        <menuitem label="&overall.label.default;" value="Default" />
                        <menuitem label="Raw Stream" value="Raw Stream" />
                        <menuitem label="AVI" value="AVI" />
                        <menuitem label="MP4" value="MP4" />
                        <menuitem label="Matroska" value="Matroska" />
                        <menuitem label="MPEG1" value="MPEG1" />
                        <menuitem label="MPEG2" value="MPEG2" />
                        <menuitem label="MPEG TS" value="MPEG TS" />
                        <menuitem label="M2TS" value="M2TS" />
                        <menuitem label="FLV" value="FLV" />
                        <menuitem label="F4V" value="F4V" />
                        <menuitem label="ASF" value="ASF" />
                        <menuitem label="3GP" value="3GP" />
                        <menuitem label="3GP2" value="3GP2" />
                        <menuitem label="MOV" value="MOV" />
                        <menuitem label="OGG" value="OGG" />
                        <menuitem label="MJPEG" value="MJPEG" />
                        <menuitem label="RealMedia" value="RealMedia" />
                        <menuitem label="DV Format" value="DV" />
                        <menuitem label="NUT" value="NUT" />
                        <menuitem label="PMP" value="PMP" />                       
                      </menupopup>
                    </menulist>
                  </row>
                </rows>
              </grid>
            </groupbox>
          </vbox>
          </tabpanel>
          <tabpanel>            
              <vbox>
                <vbox class="select_list" onclick="selectCodec(PREFVIDEOCODEC, this)">
                  <hbox flex="1">
                    <spacer flex="1"/>
                    <image class="sel_vcodec select_img"></image>
                    <spacer flex="1"/>
                  </hbox>
                  <hbox>
                    <label>&pref.video.codec;</label>
                  </hbox>
                </vbox>
                <vbox class="select_list" onclick="selectCodec(PREFAUDIOCODEC, this)">
                  <hbox flex="1">
                    <spacer flex="1"/>
                    <image class="sel_acodec select_img"></image>
                    <spacer flex="1"/>
                  </hbox>  
                  <hbox>
                    <label>&pref.audio.codec;</label>
                  </hbox>
                </vbox>
                <vbox class="select_list" onclick="selectCodec(PREFMUXER, this)">
                   <hbox flex="1">
                    <spacer flex="1"/>
                    <image class="sel_container select_img"></image>
                    <spacer flex="1"/>
                  </hbox>  
                  <hbox>
                    <spacer flex="1"/>
                    <label>&pref.video.container;</label>
                    <spacer flex="1"/>
                  </hbox>
                </vbox>
                <vbox class="select_list" onclick="selectCodec(PREFVIDEOFILTER, this)">
                   <hbox flex="1">
                    <spacer flex="1"/>
                    <image class="sel_vfilter select_img"></image>
                    <spacer flex="1"/>
                  </hbox>  
                  <hbox>
                    <spacer flex="1"/>
                    <label>&pref.video.filter;</label>
                    <spacer flex="1"/>
                  </hbox>
                </vbox>
                <vbox class="select_list" onclick="selectCodec(PREFAUDIOFILTER, this)">
                   <hbox flex="1">
                    <spacer flex="1"/>
                    <image class="sel_afilter select_img"></image>
                    <spacer flex="1"/>
                  </hbox>
                  <hbox>
                    <spacer flex="1"/>
                    <label>&pref.audio.filter;</label>
                    <spacer flex="1"/>
                  </hbox>
                </vbox>
                <vbox class="select_list" onclick="selectCodec(PREFSUBTITLE, this)">
                   <hbox flex="1">
                    <spacer flex="1"/>
                    <image class="sel_subtitle select_img"></image>
                    <spacer flex="1"/>
                  </hbox>
                  <hbox>
                    <spacer flex="1"/>
                    <label>&pref.video.subtitle;</label>
                    <spacer flex="1"/>
                  </hbox>
                </vbox>
              </vbox>
              <splitter></splitter>
              <vbox flex="1">
                <box id="adv_coder_mode" hidden="true"></box>
                <splitter id="adv_splitter" collapse="after" resizeafter="grow" hidden="true"><grippy/></splitter>
                <vbox flex="1" id="advpref_list_container1">
                  <box id="adv_pref" flex="1"></box>
                  <box id="descview"></box>
                  <hbox id="adv_pref_modify_part">
                    <box id="valuebox" flex="1"></box>
                    <button label="&overall.label.revert;" onclick="RevertValue()" id="adv_revert_btn"></button>
                  </hbox>
               </vbox>
              </vbox>
        </tabpanel>
            <vbox flex="1" id="advpref_list_container2">
                  <box id="adv_pref_all" flex="1"></box>                  
               </vbox>
          <tabpanel>
            <vbox></vbox>
          </tabpanel>
        </tabpanels>
      </tabbox>
    </hbox>
  </vbox>
</overlay>
