diff options
| -rwxr-xr-x | ctbtw.py | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -650,8 +650,7 @@ if __name__ == '__main__': parser = ArgumentParser(prog='ctbtw', description="Control CT BT-W* Bluetooth Audio Trasmitter devices", epilog="With no arguments, show current device state") parser.add_argument('--verbose', '-v', action='store_true', help="print protocol traces") actions = parser.add_mutually_exclusive_group() - actions.add_argument('--aptxll', '-l', action='store_true', help="for aptX, prefer low-latency mode") - actions.add_argument('--aptxhq', '-q', action='store_true', help="for aptX, prefer high-quality mode (also enables aptX lossless)") + actions.add_argument('--aptx', '-x', action='store', choices=["l", "q"], help="prefer (L)atency or (Q)uality for aptX adaptative") actions.add_argument('--devices', '-s', action='store_true', help="list currently paired devices") actions.add_argument('--connect', '-c', metavar="DEV", action='store', help="connect to (already paired) device with given name/address") actions.add_argument('--disconnect', '-d', metavar="D", action='store', nargs='?', const='*', help="disconnect from device with given name/address, or current device if no %(metavar)s") @@ -683,9 +682,9 @@ if __name__ == '__main__': if verbose: print("Opened device '%s'" % devinfo['product_string']) - if args.aptxll or args.aptxhq: - codec = BTCodec.aptXAdaptiveHighQuality if args.aptxhq else BTCodec.aptXAdaptiveLowLatency - print("Switching preferred aptX codec to %s" % codec.name) + if args.aptx: + codec = BTCodec.aptXAdaptiveHighQuality if args.aptx.startswith("q") else BTCodec.aptXAdaptiveLowLatency + print("Switching aptX adaptative preference to %s" % codec.name) msg = SetFeatureReq(BTFeatureSet.PreferredAptXCodecVariant, codec) dev.send_msg(msg) read_and_explain_msgs(dev, timeout_ms=1000) # Use larger timeout to give time to print final codec used, if any |
