Changeset 158 for trunk/src/org/thestaticvoid/iriverter/Converter.java
- Timestamp:
- 04/13/07 19:28:10 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/thestaticvoid/iriverter/Converter.java
r157 r158 1 /* 2 * Converter.java 3 * Copyright (C) 2005-2007 James Lee 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 * 02110-1301, USA. 19 * 20 * $Id$ 21 */ 1 22 package org.thestaticvoid.iriverter; 23 24 import java.util.*; 2 25 3 26 public class Converter extends Thread { 4 27 private Job[] jobs; 5 28 private ProgressDialogInfo progressDialogInfo; 6 private MencoderCommand currentCommand; 29 private DoSomeShit currentCommand; 30 private List failures; 7 31 8 32 public Converter(Job[] jobs, ProgressDialogInfo progressDialogInfo) { 9 33 this.jobs = jobs; 10 34 this.progressDialogInfo = progressDialogInfo; 35 failures = new ArrayList(); 11 36 } 12 37 13 38 public void run() { 14 39 for (int i = 0; i < jobs.length; i++) { 15 MencoderCommand[] mencoderCommands = jobs[i].getMencoderCommands(); 16 for (int j = 0; j < mencoderCommands.length; j++) { 17 currentCommand = mencoderCommands[j]; 18 currentCommand.run(progressDialogInfo); 40 progressDialogInfo.setCurrentJob(i + 1); 41 progressDialogInfo.setJobDescription(jobs[i].getDescription()); 42 43 try { 44 DoSomeShit[] shitToDo = jobs[i].getShitToDo(); 45 for (int j = 0; j < shitToDo.length; j++) { 46 currentCommand = shitToDo[j]; 47 currentCommand.run(progressDialogInfo); 48 } 49 } catch (FailedToDoSomeShit failed) { 50 failures.add(failed.getMessage()); 19 51 } 20 52 } … … 24 56 currentCommand.cancel(); 25 57 } 58 59 public String[] getFailures() { 60 return (String[]) failures.toArray(new String[]{}); 61 } 26 62 }
Note: See TracChangeset
for help on using the changeset viewer.
