summaryrefslogtreecommitdiff
path: root/ctbtw.py
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2026-05-02 00:53:18 +0200
committerJavier <dev.git@javispedro.com>2026-05-02 00:53:18 +0200
commit39abc1e56af5a9333bba53a72ecf7e15b93d9acb (patch)
tree30f421f9d12c45f9a105695c7ba2f3f9150936dd /ctbtw.py
parente0311435a4cc96da9c1a990c6075f82c7d30e340 (diff)
downloadctbtw-39abc1e56af5a9333bba53a72ecf7e15b93d9acb.tar.gz
ctbtw-39abc1e56af5a9333bba53a72ecf7e15b93d9acb.zip
minor change in aptX UI: -q, -l become -xq , -xl
Diffstat (limited to 'ctbtw.py')
-rwxr-xr-xctbtw.py9
1 files changed, 4 insertions, 5 deletions
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