Changeset 163 for trunk/src/org/thestaticvoid/iriverter/JoinVideos.java
- Timestamp:
- 04/14/07 20:11:39 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.
