home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Utils / Avidemux / avidemux_2.5.2_win32.exe / scripts / video / autoWizard.js next >
Encoding:
Text File  |  2009-03-09  |  1.5 KB  |  39 lines

  1. function videoAutoWizard(title, resolutions, codecs)
  2. {
  3.     var aspectRatios = [[1, 1], [4, 3], [16, 9]];
  4.     var mnuResolution = new DFMenu("Resolution:");
  5.     var mnuSourceRatio = new DFMenu("Source Aspect Ratio:");
  6.     var mnuDestinationRatio = new DFMenu("Destination Aspect Ratio:");
  7.     var dlgWizard = new DialogFactory(title);
  8.     var i;
  9.  
  10.     for (i = 0; i < resolutions.length; i++)
  11.         mnuResolution.addItem(resolutions[i][0].toString() + " x " + resolutions[i][1].toString());
  12.  
  13.     for (i = 0; i < aspectRatios.length; i++)
  14.     {
  15.         mnuSourceRatio.addItem(aspectRatios[i][0].toString() + ":" + aspectRatios[i][1].toString());
  16.         mnuDestinationRatio.addItem(aspectRatios[i][0].toString() + ":" + aspectRatios[i][1].toString());
  17.     }
  18.     
  19.     if (codecs != null)
  20.     {
  21.         var mnuCodec = new DFMenu("Codec:");
  22.                
  23.         dlgWizard.addControl(mnuCodec);
  24.         
  25.         for (i = 0; i < codecs.length; i++)
  26.             mnuCodec.addItem(codecs[i]);
  27.     }
  28.  
  29.     dlgWizard.addControl(mnuResolution);
  30.     dlgWizard.addControl(mnuSourceRatio);
  31.     dlgWizard.addControl(mnuDestinationRatio);
  32.  
  33.     if (dlgWizard.show())
  34.         return [[resolutions[mnuResolution.index][0], resolutions[mnuResolution.index][1]],
  35.             [aspectRatios[mnuSourceRatio.index][0], aspectRatios[mnuSourceRatio.index][1]],
  36.             [aspectRatios[mnuDestinationRatio.index][0], aspectRatios[mnuDestinationRatio.index][1]], codecs == null ? -1 : mnuCodec.index];
  37.     else
  38.         return null;
  39. }