v0.90.0: Lint Oontz can look left or right in three-quarter view (Preferences › Visualizer › Looking)

This commit is contained in:
2026-11-06 02:48:52 -08:00
parent 0cf22773e7
commit 95bbcf9601
8 changed files with 87 additions and 11 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
"""LinTunes — iTunes-style music library manager and player for Linux."""
__version__ = "0.89.0"
__version__ = "0.90.0"
+18 -2
View File
@@ -881,11 +881,27 @@ class PreferencesDialog(QDialog):
view.setCurrentIndex(int(config["visualizer_lint_head_on"])) # before connect
view.setToolTip("Turned a little to one side, one headphone cup "
"behind its head — or facing you")
view.currentIndexChanged.connect(
lambda i: self._prefs.set("visualizer_lint_head_on", i == 1))
facing = QComboBox()
facing.addItems(["Right", "Left"])
facing.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
facing.setCurrentIndex(int(config["visualizer_lint_face_left"]))
facing.setToolTip("Which way it looks in three-quarter view")
facing.setEnabled(view.currentIndex() == 0)
def view_chosen(i):
facing.setEnabled(i == 0)
self._prefs.set("visualizer_lint_head_on", i == 1)
view.currentIndexChanged.connect(view_chosen)
facing.currentIndexChanged.connect(
lambda i: self._prefs.set("visualizer_lint_face_left", i == 1))
self._viz_setters["visualizer_lint_head_on"] = (
lambda value: view.setCurrentIndex(int(bool(value))))
self._viz_setters["visualizer_lint_face_left"] = (
lambda value: facing.setCurrentIndex(int(bool(value))))
self._lint_view, self._lint_facing = view, facing
form.addRow("View:", view)
form.addRow("Looking:", facing)
about = QLabel(
"A ball of lint in headphones: it bobs to the bass, dances when "
"the music is fast and full, sits down when it goes quiet and "
+18 -5
View File
@@ -26,7 +26,9 @@ What the music does to it:
Two views (``visualizer_lint_head_on``): three-quarter (the default: the
face turned to one side, one headphone cup seen whole and the other behind
the ball) or head on. Same moves in both.
the ball) or head on. Same moves in both. Three-quarter looks to our right
unless ``visualizer_lint_face_left``: then the whole drawing is mirrored
(the z's only moved, so they still read as z's).
The lines are the colour the wheel picks — highlight, gray or black
(``black_mode``: this style adds black to the wheel) — on the panel's gray.
@@ -42,6 +44,7 @@ from PyQt6.QtGui import QColor, QPainterPath, QPen, QTransform
STYLE = "lint"
HEAD_ON_KEY = "visualizer_lint_head_on"
FACE_LEFT_KEY = "visualizer_lint_face_left" # 3/4 view: looking to our left
FPS = 8 # stop motion: a new drawing this often
STEP_S = 1.0 / FPS
INSET = 3
@@ -155,6 +158,7 @@ class LintRenderer:
self._hair_len = rng.uniform(0.12, 0.3, 9)
self._rng = np.random.default_rng(104729)
self.head_on = False
self.face_left = False
self._behind = 0.0
self._clock = 0.0
self.step = 1 # 0 would be a blink
@@ -181,6 +185,7 @@ class LintRenderer:
def configure(self, config):
self.head_on = bool(config.get(HEAD_ON_KEY, False))
self.face_left = bool(config.get(FACE_LEFT_KEY, False))
@property
def asleep(self) -> bool:
@@ -364,7 +369,12 @@ class LintRenderer:
ground = cell.bottom() - pen.widthF()
cx = cell.center().x()
mirror = self.face_left and not self.head_on
painter.save()
if mirror:
painter.translate(cx, 0)
painter.scale(-1, 1)
painter.translate(-cx, 0)
if self.posture == SLEEP:
# Lying on its back, feet to the right: the standing drawing
# turned a quarter (rotate(-90) sends "down" to "right").
@@ -373,7 +383,9 @@ class LintRenderer:
painter.rotate(-90)
self._body(painter, r, j, 0.0)
painter.restore()
self._zzz(painter, head + r * 0.5, ground - r * 3.0, r, j)
x = head + r * 0.5
self._zzz(painter, 2 * cx - x if mirror else x, ground - r * 3.0,
r, j, -1 if mirror else 1)
return
if self.posture == SIT:
painter.translate(cx, ground - r * 1.1) # the ball on the floor
@@ -551,13 +563,14 @@ class LintRenderer:
painter.drawPolyline([j(*hip), j(*knee), j(*foot),
j(foot[0] + toe, foot[1])])
def _zzz(self, painter, x, y, r, j):
"""Little z's rising, a new one every few frames."""
def _zzz(self, painter, x, y, r, j, way=1):
"""Little z's rising (drifting ``way``: 1 right, -1 left), a new one
every few frames."""
phase = self.step % 12
for k in range(3):
age = (phase / 4 + k) % 3 # 0..3, how far it has risen
size = r * (0.18 + 0.08 * age)
zx = x + age * r * 0.3
zx = x + way * age * r * 0.3 - (size if way < 0 else 0)
zy = y - age * r * 0.4
painter.drawPolyline([j(zx, zy), j(zx + size, zy),
j(zx, zy + size), j(zx + size, zy + size)])
+1 -1
View File
@@ -33,7 +33,7 @@ STYLE_KEYS = {
"visualizer_laser_glow", "visualizer_laser_grid",
"visualizer_laser_head", "visualizer_laser_dot",
"visualizer_laser_grid_dot"),
"lint": ("visualizer_lint_head_on",),
"lint": ("visualizer_lint_head_on", "visualizer_lint_face_left"),
}
+1 -1
View File
@@ -78,7 +78,7 @@ LIMITS = {
}
_FLAGS = ("visualizer_radial_normalize", "visualizer_laser_head",
"visualizer_laser_glow", "visualizer_laser_grid",
"visualizer_lint_head_on")
"visualizer_lint_head_on", "visualizer_lint_face_left")
_INTEGER = ("visualizer_radial_spokes", "visualizer_radial_levels",
"visualizer_bars_count",
"visualizer_laser_low_hz", "visualizer_laser_high_hz")
+1
View File
@@ -36,6 +36,7 @@ DEFAULTS = {
"visualizer_radial_dot": 1.0, # dot size, × the automatic size
"visualizer_radial_normalize": True, # even out bass vs treble
"visualizer_lint_head_on": False, # Lint Oontz: head on, not 3/4 view
"visualizer_lint_face_left": False, # … and in 3/4, looking to the left
# Per-area grayscale overrides (0=black .. 255=white). None = inherit the
# current/default look for that surface, so nothing changes until the user
# drags a slider in Preferences.