2 * Meviz - Various tools collection to work with multimedia.
3 * Copyright (C) 2012 -- 2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 3 of the GNU Lesser General Public License
7 * or later as published by the Free Software Foundation.
10 package eu.svjatoslav.meviz.encoder;
12 import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
13 import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
15 public class BitrateParameter extends Parameter<BitrateParameter.Bitrate, BitrateParameter> {
17 public BitrateParameter(final String description) {
18 super(description, ArgumentCount.SINGLE);
22 public String describeFormat() {
23 return "Target bitrate [NONE / LOW / MEDIUM / HIGH / COPY / LOSSLESS]";
27 public Bitrate getValue() {
28 return Bitrate.valueOf(arguments.get(0).toUpperCase());
32 public boolean validate(final String value) {
34 Bitrate.valueOf(value.toUpperCase());
35 } catch (final IllegalArgumentException exception) {
43 NONE, LOW, MEDIUM, HIGH, COPY, LOSSLESS