- * modify it under the terms of version 2 of the GNU General Public License
- * as published by the Free Software Foundation.
- */
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+*/
package eu.svjatoslav.meviz.encoder;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
package eu.svjatoslav.meviz.encoder;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
- static public enum bitrate {
- LOW, MEDIUM, HIGH, COPY
- }
+ public BitrateParameter(final String description) {
+ super(description, ArgumentCount.SINGLE);
+ }
- public BitrateParameter(final String description) {
- super(description, ArgumentCount.SINGLE);
- }
+ @Override
+ public String describeFormat() {
+ return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY ]";
+ }
- @Override
- public bitrate getValue() {
- return bitrate.valueOf(arguments.get(0).toUpperCase());
- }
+ @Override
+ public boolean validate(final String value) {
+ try {
+ Bitrate.valueOf(value.toUpperCase());
+ } catch (final IllegalArgumentException exception) {
+ return false;
+ }