Ignore:
Timestamp:
04/14/07 20:11:39 (5 years ago)
Author:
jlee
Message:

JoinVideos? made modular using ConcatenateShit? class. Now everything compiles successfully. There are still a lot of things left to do before useable again:

  • Reimplement DVD in SingleVideo? (=> automatic Matroska/OGM support thanks to KuwaiiRiver?'s code)
  • Add error detection in all Jobs
  • Close ProgressDialog? when done with Jobs and show errors if any

Things I want to do before 18:

Yes...I'm happy with the way things are going. 18 will almost be the way this program should have always been.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/thestaticvoid/iriverter/JoinVideos.java

    r157 r163  
    3131import org.eclipse.swt.layout.*; 
    3232 
    33 public class JoinVideos extends Composite implements SelectionListener, TabItemControl, JoinVideosInfo {         
     33public class JoinVideos extends Composite implements SelectionListener, TabItemControl, Job {    
    3434        private CTabItem tabItem; 
    3535        private java.util.List inputVideos; 
     
    3737        private Button up, add, remove, down, outputVideoSelect; 
    3838        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) { 
    4242                super(parent, style); 
    4343                this.tabItem = tabItem; 
     44                this.mplayerPath = mplayerPath; 
    4445                inputVideos = new java.util.ArrayList(); 
    4546                 
     
    241242        } 
    242243         
    243         public synchronized String getOutputVideo() { 
     244        public String getOutputVideo() { 
    244245                Display.getDefault().syncExec(new Runnable() { 
    245246                        public void run() { 
     
    251252        } 
    252253         
    253         public synchronized void setOutputVideo(String outputVideo) { 
     254        public void setOutputVideo(String outputVideo) { 
    254255                syncOutputVideo = outputVideo; 
    255256                 
     
    260261                }); 
    261262        } 
     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        } 
    262285} 
Note: See TracChangeset for help on using the changeset viewer.