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.converters;
13 import java.util.ArrayList;
14 import java.util.List;
16 import eu.svjatoslav.meviz.encoder.EncodingOptions;
18 public abstract class AbstractConverter {
20 public abstract String getCommand(File inputFile, File targetFile,
21 EncodingOptions options);
23 public abstract List<String> getSourceFileExtensions();
25 public abstract List<String> getTargetFileExtensions();
28 * For some reasons some encoders require terminal to run. Until this is
29 * resolved, encoder can request for terminal using this method.
31 public abstract boolean isTerminalMandatory();
33 public boolean supportsSource(final String format) {
34 return getSourceFileExtensions().contains(format);
37 public boolean supportsTarget(final String format) {
38 return getTargetFileExtensions().contains(format);
41 public List<String> toList(final String... strings) {
42 final ArrayList<String> result = new ArrayList<String>();
44 for (final String string : strings)