Changeset 163
- Timestamp:
- 04/14/07 17:11:39 (2 years ago)
- Files:
-
- trunk/src/org/thestaticvoid/iriverter/ConcatenateShit.java (added)
- trunk/src/org/thestaticvoid/iriverter/ConverterUI.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/JoinVideos.java (modified) (5 diffs)
- trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/MencoderShit.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/org/thestaticvoid/iriverter/ConverterUI.java
r162 r163 768 768 } 769 769 770 private JoinVideosnewJoinVideos() {770 private void newJoinVideos() { 771 771 CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE); 772 JoinVideos joinVideos = new JoinVideos(tabFolder, SWT.NONE, tabItem); 773 tabItem.setControl(joinVideos); 774 tabFolder.setSelection(tabItem); 775 tabChanged(false); 776 777 return joinVideos; 772 JoinVideos joinVideos = null; 773 774 boolean canceled = false; 775 while (!canceled) 776 try { 777 joinVideos = new JoinVideos(tabFolder, SWT.NONE, tabItem, MPlayerInfo.getMPlayerPath()); 778 tabItem.setControl(joinVideos); 779 tabFolder.setSelection(tabItem); 780 tabChanged(false); 781 canceled = true; 782 } catch (MPlayerNotFoundException mpe) { 783 canceled = new MPlayerPathDialog(shell).open(); 784 } catch (Exception e) { 785 tabItem.dispose(); 786 canceled = true; 787 } 778 788 } 779 789 trunk/src/org/thestaticvoid/iriverter/JoinVideos.java
r157 r163 31 31 import org.eclipse.swt.layout.*; 32 32 33 public class JoinVideos extends Composite implements SelectionListener, TabItemControl, Jo inVideosInfo{33 public class JoinVideos extends Composite implements SelectionListener, TabItemControl, Job { 34 34 private CTabItem tabItem; 35 35 private java.util.List inputVideos; … … 37 37 private Button up, add, remove, down, outputVideoSelect; 38 38 private Text outputVideoInput; 39 private String syncOutputVideo ;40 41 public JoinVideos(Composite parent, int style, CTabItem tabItem ) {39 private String syncOutputVideo, mplayerPath; 40 41 public JoinVideos(Composite parent, int style, CTabItem tabItem, String mplayerPath) { 42 42 super(parent, style); 43 43 this.tabItem = tabItem; 44 this.mplayerPath = mplayerPath; 44 45 inputVideos = new java.util.ArrayList(); 45 46 … … 241 242 } 242 243 243 public synchronizedString getOutputVideo() {244 public String getOutputVideo() { 244 245 Display.getDefault().syncExec(new Runnable() { 245 246 public void run() { … … 251 252 } 252 253 253 public synchronizedvoid setOutputVideo(String outputVideo) {254 public void setOutputVideo(String outputVideo) { 254 255 syncOutputVideo = outputVideo; 255 256 … … 260 261 }); 261 262 } 263 264 public String getDescription() { 265 return "Joining videos into " + new File(getOutputVideo()).getName(); 266 } 267 268 public ShitToDo[] getShitToDo() { 269 java.util.List shitToDo = new java.util.ArrayList(); 270 271 File tempFile; 272 try { 273 tempFile = File.createTempFile("iriverter-", ".avi"); 274 tempFile.deleteOnExit(); 275 } catch (IOException io) { 276 Logger.logException(io); 277 return new ShitToDo[]{}; 278 } 279 280 shitToDo.add(new ConcatenateShit("Concatenating videos to a temporary file...", getInputVideos(), tempFile.toString())); 281 shitToDo.add(new MencoderShit("Writing header...", new MencoderCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, "-forceidx", "-ovc", "copy", "-oac", "copy"}, new InputVideo(tempFile.toString()), getOutputVideo()))); 282 283 return (ShitToDo[]) shitToDo.toArray(new ShitToDo[]{}); 284 } 262 285 } trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java
r161 r163 33 33 private Process proc; 34 34 private StringBuffer mplayerOutput; 35 private boolean commandFound = true;36 35 37 36 public MPlayerInfo(InputVideo inputVideo) throws MPlayerNotFoundException { trunk/src/org/thestaticvoid/iriverter/MencoderShit.java
r161 r163 45 45 46 46 progressDialogInfo.setSubdescription(description); 47 progressDialogInfo.setMiscellaneous1(""); 48 progressDialogInfo.setMiscellaneous2(""); 47 49 48 50 try { … … 92 94 // This should never happen 93 95 e.printStackTrace(); 96 throw new FailedToDoSomeShit(description); 94 97 } 95 98 }
