v0.90.1: the visualizer's sync delay is a box with 1 ms arrows instead of a slider

This commit is contained in:
2026-11-06 02:55:16 -08:00
parent 95bbcf9601
commit 15f1ed5c96
3 changed files with 39 additions and 16 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
"""LinTunes — iTunes-style music library manager and player for Linux."""
__version__ = "0.90.0"
__version__ = "0.90.1"
+18 -15
View File
@@ -1081,37 +1081,40 @@ class PreferencesDialog(QDialog):
form.addRow("Frequency range:", row)
return slider
def _sync_delay_slider(self, form, style: str) -> QSlider:
def _sync_delay_slider(self, form, style: str) -> "QSpinBox":
"""This style's sync delay — this machine's speakers' latency plus
the style's own lag, so one per style, in config.json."""
the style's own lag, so one per style, in config.json. A box with
1 ms arrows (Round 125): a slider was too fidgety to set it by."""
from PyQt6.QtWidgets import QSpinBox
lo, hi = visualizer_styles.SYNC_DELAY_LIMITS
slider = _viz_slider_widget()
slider.setRange(lo, hi)
slider.setSingleStep(5)
slider.setPageStep(25)
slider.setToolTip(
box = QSpinBox()
box.setRange(lo, hi)
box.setSingleStep(1)
box.setSuffix(" ms")
box.setKeyboardTracking(False) # typing saves on Enter/leaving
box.setToolTip(
"If the visualizer runs ahead of what you hear — Bluetooth "
"headphones especially — hold it back this much. Below zero it "
"reacts sooner, by up to as much audio as the player has decoded "
"ahead (usually a few tens of ms). Set per computer and per "
"style, since each style lags in its own way.")
slider.setValue(visualizer_styles.sync_delay_ms(load_config(), style))
text = QLabel(_sync_text(slider.value()))
text.setMinimumWidth(max(_VALUE_WIDTH, text.fontMetrics().horizontalAdvance(
_sync_text(visualizer_styles.SYNC_DELAY_LIMITS[0])) + 4))
box.setValue(visualizer_styles.sync_delay_ms(load_config(), style))
text = QLabel(_sync_text(box.value()))
text.setEnabled(False)
def changed(value):
text.setText(_sync_text(value))
self._sync_save_timer.start()
slider.valueChanged.connect(changed)
self._sync_sliders[style] = slider
box.valueChanged.connect(changed)
self._sync_sliders[style] = box
row = QHBoxLayout()
row.addWidget(slider, stretch=1)
row.addWidget(box)
row.addSpacing(8)
row.addWidget(text)
row.addStretch(1)
form.addRow("Sync delay:", row)
return slider
return box
def _save_sync_delay(self):
config = load_config()