From 39abc1e56af5a9333bba53a72ecf7e15b93d9acb Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 2 May 2026 00:53:18 +0200 Subject: minor change in aptX UI: -q, -l become -xq , -xl --- ctbtw.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ctbtw.py') diff --git a/ctbtw.py b/ctbtw.py index 90d3f95..77d4601 100755 --- a/ctbtw.py +++ b/ctbtw.py @@ -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 -- cgit v1.2.3