Changeset 143
- Timestamp:
- 02/15/07 13:10:15 (2 years ago)
- Files:
-
- trunk/src/org/thestaticvoid/iriverter/Converter.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/ConverterUI.java (modified) (2 diffs)
- trunk/src/org/thestaticvoid/iriverter/DVD.java (modified) (2 diffs)
- trunk/src/org/thestaticvoid/iriverter/DVDInfoReader.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/DVDProgressDialog.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/GenericProgressDialog.java (added)
- trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/ManualSplit.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/org/thestaticvoid/iriverter/Converter.java
r117 r143 320 320 progressDialogInfo.setStatus("Gathering information about the input video..."); 321 321 322 MPlayerInfo info = new MPlayerInfo("dvd://" + dvdInfo.getTitle(), dvdInfo.getDrive() );322 MPlayerInfo info = new MPlayerInfo("dvd://" + dvdInfo.getTitle(), dvdInfo.getDrive(), ConverterOptions.getMPlayerPath()); 323 323 324 324 List commandList = prepareBaseCommandList("dvd://" + dvdInfo.getTitle(), dvdInfo.getOutputVideo(), info); trunk/src/org/thestaticvoid/iriverter/ConverterUI.java
r135 r143 394 394 progressDialog.open(); 395 395 converter.cancel(); 396 397 canceled = true; 396 398 } catch (MPlayerNotFoundException mpe) { 397 399 canceled = new MPlayerPathDialog(shell, SWT.NONE).open(); … … 407 409 408 410 if (file != null) { 409 try { 410 proc = Runtime.getRuntime().exec(new String[]{MPlayerInfo.getMPlayerPath() + "mplayer", file}); 411 } catch (IOException io) { 412 io.printStackTrace(); 413 } catch (MPlayerNotFoundException mpe) { 414 MPlayerPathDialog dialog = new MPlayerPathDialog(shell, SWT.NONE); 415 dialog.open(); 416 } 411 boolean canceled = false; 412 while (!canceled) 413 try { 414 proc = Runtime.getRuntime().exec(new String[]{MPlayerInfo.getMPlayerPath() + "mplayer", file}); 415 canceled = true; 416 } catch (IOException io) { 417 io.printStackTrace(); 418 canceled = true; 419 } catch (MPlayerNotFoundException mpe) { 420 canceled = new MPlayerPathDialog(shell, SWT.NONE).open(); 421 } 417 422 } 418 423 } trunk/src/org/thestaticvoid/iriverter/DVD.java
r117 r143 244 244 245 245 proc = Runtime.getRuntime().exec(command); 246 247 canceled = true; 246 248 } catch (IOException io) { 247 249 io.printStackTrace(); … … 338 340 339 341 setLanguageCombos(); 342 343 canceled = true; 340 344 } catch (MPlayerNotFoundException mpe) { 341 345 canceled = new MPlayerPathDialog(getParent().getShell(), SWT.NONE).open(); trunk/src/org/thestaticvoid/iriverter/DVDInfoReader.java
r117 r143 40 40 public void run() { 41 41 int numberOfTitles = new MPlayerInfo("dvd://", drive, mplayerPath).getNumberOfTitles(); 42 progressDialog.set NumberOfTitles(numberOfTitles);42 progressDialog.setMaximum(numberOfTitles); 43 43 44 44 for (int i = 1; i <= numberOfTitles; i++) { 45 progressDialog.setCurrent Title(i);45 progressDialog.setCurrent(i); 46 46 MPlayerInfo rawTitleInfo = new MPlayerInfo("dvd://" + i, drive, mplayerPath); 47 47 trunk/src/org/thestaticvoid/iriverter/DVDProgressDialog.java
r117 r143 22 22 package org.thestaticvoid.iriverter; 23 23 24 import org.eclipse.swt.*;25 24 import org.eclipse.swt.widgets.*; 26 import org.eclipse.swt.layout.*;27 import org.eclipse.swt.graphics.*;28 25 29 public class DVDProgressDialog extends Dialog { 30 private Shell shell; 31 private int style, syncNumberOfTitles, syncCurrentTitle; 32 private Label header, status; 33 private ProgressBar progressBar; 34 35 public DVDProgressDialog(Shell shell, int style) { 36 super(shell, style); 26 public class DVDProgressDialog extends GenericProgressDialog { 27 public DVDProgressDialog(Shell parent, int style) { 28 super(parent, style, "Gathering Information About DVD"); 37 29 } 38 30 39 public void open() { 40 shell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); 41 shell.setText("Gathering Information About DVD"); 42 GridLayout gridLayout = new GridLayout(); 43 gridLayout.horizontalSpacing = 6; 44 gridLayout.verticalSpacing = 6; 45 gridLayout.marginHeight = 12; 46 gridLayout.marginWidth = 12; 47 shell.setLayout(gridLayout); 31 public String getStatusText() { 32 if (getMaximum() == 0) 33 return "Getting how many titles are on the DVD"; 48 34 49 header = new Label(shell, SWT.NONE); 50 header.setText("Gathering Information About DVD"); 51 FontData[] fontData = header.getFont().getFontData(); 52 fontData[0].setStyle(SWT.BOLD); 53 fontData[0].setHeight(fontData[0].getHeight() + 4); 54 header.setFont(new Font(Display.getDefault(), fontData)); 55 56 progressBar = new ProgressBar(shell, SWT.HORIZONTAL | SWT.SMOOTH); 57 progressBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); 58 59 status = new Label(shell, SWT.NONE); 60 status.setText("Getting how many titles are on the DVD"); 61 fontData = status.getFont().getFontData(); 62 fontData[0].setStyle(SWT.ITALIC); 63 status.setFont(new Font(getParent().getDisplay(), fontData)); 64 65 shell.pack(); 66 shell.setSize(400, shell.getSize().y); 67 68 shell.open(); 69 while (!shell.isDisposed()) 70 if (!getParent().getDisplay().readAndDispatch()) 71 getParent().getDisplay().sleep(); 72 } 73 74 public synchronized void close() { 75 Display.getDefault().syncExec(new Runnable() { 76 public void run() { 77 shell.dispose(); 78 } 79 }); 80 } 81 82 public synchronized void setNumberOfTitles(int numberOfTitles) { 83 syncNumberOfTitles = numberOfTitles; 84 85 Display.getDefault().syncExec(new Runnable() { 86 public void run() { 87 progressBar.setMaximum(syncNumberOfTitles); 88 } 89 }); 90 } 91 92 public synchronized void setCurrentTitle(int currentTitle) { 93 syncCurrentTitle = currentTitle; 94 95 Display.getDefault().syncExec(new Runnable() { 96 public void run() { 97 progressBar.setSelection(syncCurrentTitle); 98 status.setText("Reading title " + syncCurrentTitle + " of " + syncNumberOfTitles); 99 status.pack(); 100 } 101 }); 35 return "Reading title " + getCurrent() + " of " + getMaximum(); 102 36 } 103 37 } trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java
r117 r143 42 42 String[] command = null; 43 43 if (dvdDrive != null) 44 command = new String[]{mplayerPath + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", "-dvd-device", dvdDrive, video.toString(), "-v", "-identify"};44 command = new String[]{mplayerPath + File.separator + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", "-dvd-device", dvdDrive, video.toString(), "-v", "-identify"}; 45 45 else 46 command = new String[]{mplayerPath + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", video.toString(), "-identify"};46 command = new String[]{mplayerPath + File.separator + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", video.toString(), "-identify"}; 47 47 48 48 String commandStr = ""; trunk/src/org/thestaticvoid/iriverter/ManualSplit.java
r117 r143 187 187 sec.setText("00"); 188 188 marksList.removeAll(); 189 190 canceled = true; 189 191 } catch (MPlayerNotFoundException mpe) { 190 192 canceled = new MPlayerPathDialog(getParent().getShell(), SWT.NONE).open();
