NullParameter testParameter = parser.add(
new NullParameter("Simulate file encoding.")).addAliases("-t",
- "--test");
+ "--test");
NullParameter recursiveParameter = parser.add(
new NullParameter("Enable recursive mode.")).addAliases("-r",
NullParameter forPortableParameter = parser.add(
new NullParameter("Encode for portable player.")).addAliases("-p",
- "--portable");
+ "--portable");
StringParameters inputPatternParameter = parser
.add(new StringParameters("File input pattern."))
BitrateParameter audioBitrateParameter = parser.add(
new BitrateParameter("Audio bitrate")).addAliases("-a",
- "--audio-bitrate");
+ "--audio-bitrate");
/**
* @return {@link EncodingOptions} if commandline arguments were
parser.parse(args);
- options.recursive = recursiveParameter.isParameterSpecified();
+ options.setRecursive(recursiveParameter.isParameterSpecified());
- options.deinterlace = deinterlaceParameter.isParameterSpecified();
+ options.setDeinterlace(deinterlaceParameter.isParameterSpecified());
- options.testOnly = testParameter.isParameterSpecified();
+ options.setTestOnly(testParameter.isParameterSpecified());
if (outputFormatParameter.isParameterSpecified())
- options.outputFormats.addAll(outputFormatParameter.getValue());
+ options.getOutputFormats().addAll(outputFormatParameter.getValue());
if (workingDirectoryParameter.isParameterSpecified())
- options.workingDirectory = workingDirectoryParameter.getValue();
+ options.setWorkingDirectory(workingDirectoryParameter.getValue());
if (inputPatternParameter.isParameterSpecified())
- options.inputPatterns.addAll(inputPatternParameter.getValue());
+ options.getInputPatterns().addAll(inputPatternParameter.getValue());
- options.forPortablePlayer = forPortableParameter.isParameterSpecified();
+ options.setForPortablePlayer(forPortableParameter.isParameterSpecified());
if (videoBitrateParameter.isParameterSpecified())
- try {
- options.setVideoBitrate(videoBitrateParameter.getValue());
- } catch (final Exception e) {
- System.out
- .println("Invalid video bitrate. Valid values are: LOW, MEDIUM, HIGH.");
- return null;
- }
+ options.setVideoBitrate(videoBitrateParameter.getValue());
+
+ if (audioBitrateParameter.isParameterSpecified())
+ options.setAudioBitrate(audioBitrateParameter.getValue());
return options;
}