2 * Meviz - Various tools collection to work with multimedia.
3 * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
10 package eu.svjatoslav.meviz.encoder;
12 import java.io.IOException;
13 import java.util.ArrayList;
15 public class EncodingPlan {
17 public ArrayList<EncodingTask> encodingTasks = new ArrayList<EncodingTask>();
19 public void execute(final EncodingOptions encodingOptions) throws IOException {
20 for (final EncodingTask task : encodingTasks) {
23 String command = task.getCommand(encodingOptions);
25 if (task.doUseTerminal()) {
26 command = "xterm -e '" + command + "'";
29 System.out.println("Executing command: " + command);
31 final Runtime run = Runtime.getRuntime();
33 pr = run.exec(new String[] { "/bin/bash", "-c", command });
37 } catch (final Exception e) {
38 System.out.println(e.toString());
46 public void scheduleTask(final EncodingTask encodingTask) {
47 encodingTasks.add(encodingTask);