X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fmeviz%2Fencoder%2FBitrateParameter.java;h=c4a9e2a4db87d7f4d51471d6be4850b47f3511c6;hb=567410640f4e0428caf9de9fc83df4c73f0e5067;hp=c8aa863dfbcc86a5306f8ab878e33999d24c1190;hpb=2f596bbc660625e4363be4330a3962227dc8f416;p=meviz.git diff --git a/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java b/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java index c8aa863..c4a9e2a 100755 --- a/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java +++ b/src/main/java/eu/svjatoslav/meviz/encoder/BitrateParameter.java @@ -1,57 +1,45 @@ /* * Meviz - Various tools collection to work with multimedia. - * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright (C) 2012 -- 2019, 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. - */ + * 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; -public class BitrateParameter extends Parameter { - - static public enum bitrate { - LOW, MEDIUM, HIGH, COPY - } - - public BitrateParameter(final String description) { - super(description, ArgumentCount.SINGLE); - } - - @Override - public BitrateParameter addAliases(final String... aliasArray) { - addAliasesProtected(aliasArray); - return this; - } - - @Override - public String describeFormat() { - return "Target bitrate [LOW / MEDIUM / HIGH / COPY]"; - }; - - @Override - public bitrate getValue() { - return bitrate.valueOf(arguments.get(0).toUpperCase()); - } - - @Override - public BitrateParameter setMandatory() { - setMandatoryProtected(); - return this; - } - - @Override - public boolean validate(final String value) { - try { - bitrate.valueOf(value); - } catch (final IllegalArgumentException exception) { - return false; - } - - return true; - } +public class BitrateParameter extends Parameter { + + 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; + } + + return true; + } + + public enum Bitrate { + NONE, LOW, MEDIUM, HIGH, COPY + } }