track gain range max limit set to 99

This commit is contained in:
Nimesh Ghelani 2014-06-28 19:38:01 +05:30
parent d2ecc95276
commit 6925159342
2 changed files with 6 additions and 6 deletions

View file

@ -21,9 +21,9 @@ optional arguments:
--rename-unicode Rename Files Causing Unicode Errors, will do minimal
required renaming
--track-gain TRACK_GAIN
Store this (nonnegative integer) volume gain for all
tracks; 0 (default) means no gain and is usually fine;
e.g. 60 is very loud even on minimal player volume
Store this volume gain (0-99) for all tracks; 0
(default) means no gain and is usually fine; e.g. 60
is very loud even on minimal player volume
```
#### Additions to the original

View file

@ -520,15 +520,15 @@ def nonnegative_int(string):
except ValueError:
raise argparse.ArgumentTypeError("'%s' must be an integer" % string)
if intval < 0:
raise argparse.ArgumentTypeError("'%s' is negative while it shouldn't be" % string)
if intval < 0 or intval > 99:
raise argparse.ArgumentTypeError("Track gain value should be in range 0-99")
return intval
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--disable-voiceover', action='store_true', help='Disable Voiceover Feature')
parser.add_argument('--rename-unicode', action='store_true', help='Rename Files Causing Unicode Errors, will do minimal required renaming')
parser.add_argument('--track-gain', type=nonnegative_int, default=0, help='Store this (nonnegative integer) volume gain for all tracks; 0 (default) means no gain and is usually fine; e.g. 60 is very loud even on minimal player volume')
parser.add_argument('--track-gain', type=nonnegative_int, default=0, help='Store this volume gain (0-99) for all tracks; 0 (default) means no gain and is usually fine; e.g. 60 is very loud even on minimal player volume')
parser.add_argument('path')
result = parser.parse_args()