Improves comments for converters

This commit is contained in:
2020-03-20 12:47:11 +01:00
parent 0f9fbc06c7
commit bf6542c22a
4 changed files with 274 additions and 178 deletions

View File

@ -10,6 +10,12 @@ import java.util.List;
public class AudioConverter extends Converter {
private String newExt;
/**
* Instantiates a new audio converter
* @param ffprobePath <p>Path/command to ffprobe.</p>
* @param ffmpegPath <p>Path/command to ffmpeg.</p>
* @param newExt <p>The extension of the new file.</p>
*/
public AudioConverter(String ffprobePath, String ffmpegPath, String newExt) {
this.ffprobePath = ffprobePath;
this.ffmpegPath = ffmpegPath;
@ -17,11 +23,11 @@ public class AudioConverter extends Converter {
}
/**
* Reads streams from a file, and converts it to an mp4.
*
* @param folder The folder of the file to process
* @param file The file to process
* @throws IOException If the BufferedReader fails
* Processes a file conversion
* @param folder <p>The work folder containing the file.</p>
* @param file <p>The file to convert.</p>
* @param newExt <p>The extension of the new file.</p>
* @throws IOException <p>If the file cannot be converted.</p>
*/
private void processFile(File folder, File file, String newExt) throws IOException {
List<StreamObject> streams = probeFile(ffprobePath, file);
@ -34,12 +40,11 @@ public class AudioConverter extends Converter {
/**
* Generates a command for a ProcessBuilder.
*
* @param executable The executable file for ffmpeg
* @param fileName The input file
* @param streams A list of ffprobe streams
* @param outFile The output file
* @return A list of commands
* @param executable <p>The executable file for ffmpeg.</p>
* @param fileName <p>The input file.</p>
* @param streams <p>A list of ffprobe streams.</p>
* @param outFile <p>The output file.</p>
* @return <p>A list of commands.</p>
*/
private String[] builderCommand(String executable, String fileName, List<StreamObject> streams, String outFile) {
List<String> command = generalFile(executable, fileName);