forked from upstream/IPod-Shuffle-4g
track gain range max limit set to 99
This commit is contained in:
parent
d2ecc95276
commit
6925159342
2 changed files with 6 additions and 6 deletions
|
|
@ -21,9 +21,9 @@ optional arguments:
|
||||||
--rename-unicode Rename Files Causing Unicode Errors, will do minimal
|
--rename-unicode Rename Files Causing Unicode Errors, will do minimal
|
||||||
required renaming
|
required renaming
|
||||||
--track-gain TRACK_GAIN
|
--track-gain TRACK_GAIN
|
||||||
Store this (nonnegative integer) volume gain for all
|
Store this volume gain (0-99) for all tracks; 0
|
||||||
tracks; 0 (default) means no gain and is usually fine;
|
(default) means no gain and is usually fine; e.g. 60
|
||||||
e.g. 60 is very loud even on minimal player volume
|
is very loud even on minimal player volume
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Additions to the original
|
#### Additions to the original
|
||||||
|
|
|
||||||
|
|
@ -520,15 +520,15 @@ def nonnegative_int(string):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise argparse.ArgumentTypeError("'%s' must be an integer" % string)
|
raise argparse.ArgumentTypeError("'%s' must be an integer" % string)
|
||||||
|
|
||||||
if intval < 0:
|
if intval < 0 or intval > 99:
|
||||||
raise argparse.ArgumentTypeError("'%s' is negative while it shouldn't be" % string)
|
raise argparse.ArgumentTypeError("Track gain value should be in range 0-99")
|
||||||
return intval
|
return intval
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--disable-voiceover', action='store_true', help='Disable Voiceover Feature')
|
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('--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')
|
parser.add_argument('path')
|
||||||
result = parser.parse_args()
|
result = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue