Use switch to enable voiceover

This commit is contained in:
NicoHood 2016-04-06 22:02:54 +02:00
parent 4134e93cd3
commit 96a0d35dc8

View file

@ -646,8 +646,8 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description= parser = argparse.ArgumentParser(description=
'Python script for building the Track and Playlist database ' 'Python script for building the Track and Playlist database '
'for the newer gen IPod Shuffle.') 'for the newer gen IPod Shuffle.')
parser.add_argument('--disable-voiceover', action='store_true', parser.add_argument('--voiceover', action='store_true',
help='Disable voiceover feature') help='Enable voiceover feature')
parser.add_argument('--rename-unicode', action='store_true', parser.add_argument('--rename-unicode', action='store_true',
help='Rename files causing unicode errors, will do minimal required renaming') help='Rename files causing unicode errors, will do minimal required renaming')
parser.add_argument('--track-gain', type=nonnegative_int, default='0', parser.add_argument('--track-gain', type=nonnegative_int, default='0',
@ -666,11 +666,11 @@ if __name__ == '__main__':
if result.rename_unicode: if result.rename_unicode:
check_unicode(result.path) check_unicode(result.path)
if not result.disable_voiceover and not Text2Speech.check_support(): if result.voiceover and not Text2Speech.check_support():
print "Error: Did not find any voiceover program. Voiceover disabled." print "Error: Did not find any voiceover program. Voiceover disabled."
result.disable_voiceover = True result.voiceover = False
shuffle = Shuffler(result.path, voiceover=not result.disable_voiceover, rename=result.rename_unicode, trackgain=result.track_gain, auto_playlists=result.auto_playlists) shuffle = Shuffler(result.path, voiceover=result.voiceover, rename=result.rename_unicode, trackgain=result.track_gain, auto_playlists=result.auto_playlists)
shuffle.initialize() shuffle.initialize()
shuffle.populate() shuffle.populate()
shuffle.write_database() shuffle.write_database()