/*
* Meviz - Various tools collection to work with multimedia.
* Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public License
* as published by the Free Software Foundation.
import eu.svjatoslav.meviz.encoder.converters.Convert;
import eu.svjatoslav.meviz.encoder.converters.Ffmpeg2theora;
import eu.svjatoslav.meviz.encoder.converters.Flac;
+import eu.svjatoslav.meviz.encoder.converters.Midi2Wav;
import eu.svjatoslav.meviz.encoder.converters.Ogg2Wav;
public class FormatsRegistry {
registerEncoder(new Ogg2Wav());
registerEncoder(new Flac());
registerEncoder(new AvconvAudio());
+ registerEncoder(new Midi2Wav());
}
public List<AbstractConverter> getEncoders(final String sourceFormat,
--- /dev/null
+/*
+ * Meviz - Various tools collection to work with multimedia.
+ * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ */
+
+package eu.svjatoslav.meviz.encoder.converters;
+
+import java.io.File;
+import java.util.List;
+
+import eu.svjatoslav.meviz.encoder.EncodingOptions;
+
+public class Midi2Wav extends AbstractConverter {
+
+ @Override
+ public String getCommand(final File inputFile, final File targetFile,
+ final EncodingOptions options) {
+
+ return "timidity \"" + inputFile.getAbsolutePath() + "\" -Ow -o \""
+ + targetFile.getAbsolutePath() + "\"";
+ }
+
+ @Override
+ public List<String> getSourceFileExtensions() {
+ return toList("mid");
+ }
+
+ @Override
+ public List<String> getTargetFileExtensions() {
+ return toList("wav");
+ }
+
+ @Override
+ public boolean isTerminalMandatory() {
+ return true;
+ }
+
+}