forked from trav/lintunes
v0.65.0: DJ mode round three, and the small things
- The shelf is revealed in place: the decks don't stretch or squeeze as the window parts. - The DJ button is the top row's last box (where bpm was), so it stays put; bpm moved under it. - Tempo, vocals and the crossfader snap to their middle and show it. The vocals slider has icons, lined up with its ends and middle. - Sync sticks: a synced deck follows the other's tempo, glows and says Synced until its own tempo fader moves. The ½×/1×/2× switch re-syncs, and the BPM line says when it's counted half or double. - A back-to-the-start button per deck. - The air horn is a real recording (CC0): tap for the phrase, hold to stretch the first blast. - The zoomed waveforms ease out while a deck is paused or held. - DJ audio follows a change of output device instead of going silent. - A new playlist folder is named in place, scrolled into view. - Visualizer bars: choose how many, 1 to 1024 (one per pixel at most). - The volume slider is as tall as the scrubber.
This commit is contained in:
+30
-26
@@ -488,6 +488,7 @@ class TransportBar(QWidget):
|
||||
# between the visualizer and the timeline. The HBox centers it
|
||||
# vertically, so nothing stacks above or below it (iTunes-style).
|
||||
self._volume_slider = ClickJumpSlider()
|
||||
self._volume_slider.setProperty("tall", True) # the scrubber's height
|
||||
self._volume_slider.setRange(0, 100)
|
||||
self._volume_slider.setFixedWidth(96)
|
||||
# As tall as the boxes, so its groove (drawn centered) sits on the
|
||||
@@ -573,18 +574,28 @@ class TransportBar(QWidget):
|
||||
self._now_playing.installEventFilter(self)
|
||||
gap()
|
||||
|
||||
# bpm tap button lives on the far right as its own box, top-aligned
|
||||
# with the now-playing panel like the transport boxes — kept out of
|
||||
# the seek row so it doesn't drive the timeline row's height.
|
||||
self._bpm_button = BpmButton(player, manager)
|
||||
# The whole box is the tap target, so it darkens (and taps) as one.
|
||||
bpm_box = _box(self._bpm_button, bg=box_bg, margins=(3, 3, 3, 3),
|
||||
hug=True, height=CONTROL_HEIGHT, split=True)
|
||||
self._boxes.append(bpm_box)
|
||||
layout.addWidget(bpm_box, alignment=TOP)
|
||||
# DJ mode's button is the far-right box (Round 94: it swapped with
|
||||
# bpm, so it stays put while the window parts under it); the bpm
|
||||
# tap button sits under it, in the header row.
|
||||
self.dj_button = QToolButton()
|
||||
self.dj_button.setObjectName("djButton")
|
||||
self.dj_button.setCheckable(True)
|
||||
self.dj_button.setToolTip("DJ mode")
|
||||
self.dj_button.setIcon(turntable_icon(QColor(ICON_GRAY), 22))
|
||||
self.dj_button.setIconSize(QSize(30, 22))
|
||||
self.dj_button.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
self.dj_button.setFixedWidth(52)
|
||||
self.dj_button.toggled.connect(self._on_dj_button)
|
||||
dj_box = _box(self.dj_button, bg=box_bg, margins=(3, 3, 3, 3),
|
||||
hug=True, height=CONTROL_HEIGHT, split=True)
|
||||
self._boxes.append(dj_box)
|
||||
layout.addWidget(dj_box, alignment=TOP)
|
||||
self._fixed_controls = (transport_box, shuffle_box, repeat_box,
|
||||
self._visualizer,
|
||||
self._volume_slider, bpm_box)
|
||||
self._volume_slider, dj_box)
|
||||
self._bpm_button = BpmButton(player, manager)
|
||||
self._bpm_button.setObjectName("bpmHeader")
|
||||
self._bpm_button.setFlat(False)
|
||||
|
||||
# Library button · the current view's header · seek row. MainWindow
|
||||
# hands over the first two (see set_sidebar_header / set_view_header)
|
||||
@@ -594,16 +605,7 @@ class TransportBar(QWidget):
|
||||
self.set_header_height(34)
|
||||
outer.addWidget(self._header_row)
|
||||
|
||||
# DJ mode's button: under the bpm box, in the header row.
|
||||
self.dj_button = QToolButton()
|
||||
self.dj_button.setObjectName("djButton")
|
||||
self.dj_button.setCheckable(True)
|
||||
self.dj_button.setToolTip("DJ mode")
|
||||
self.dj_button.setIcon(turntable_icon(QColor(ICON_GRAY)))
|
||||
self.dj_button.setIconSize(QSize(24, 18))
|
||||
self.dj_button.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
self.dj_button.toggled.connect(self._on_dj_button)
|
||||
self._dj_bpm_box = bpm_box
|
||||
self._dj_box = dj_box
|
||||
self._apply_dj_button_style()
|
||||
self._split_widgets: tuple = ()
|
||||
|
||||
@@ -631,10 +633,12 @@ class TransportBar(QWidget):
|
||||
# ---- DJ mode ----
|
||||
|
||||
def _apply_dj_button_style(self):
|
||||
"""The bpm button under the DJ box wears the shared face (radius 8);
|
||||
the DJ button is styled by its box like shuffle and repeat."""
|
||||
bg = theme.gray(theme.gray_value(self._prefs, "color_button"))
|
||||
self.dj_button.setStyleSheet(theme.button_face_qss(
|
||||
"QToolButton#djButton", bg, radius=8, extra="padding: 0;",
|
||||
checked_color=bg.darker(theme.CHECKED_DARKER)))
|
||||
self._bpm_button.setStyleSheet(theme.button_face_qss(
|
||||
"QPushButton#bpmHeader", bg, radius=8,
|
||||
extra="padding: 0; color: black;"))
|
||||
|
||||
def _on_dj_button(self, on: bool):
|
||||
self._on_dj_button_icon(on)
|
||||
@@ -668,7 +672,7 @@ class TransportBar(QWidget):
|
||||
|
||||
def _on_dj_button_icon(self, on: bool):
|
||||
color = self.palette().highlight().color() if on else QColor(ICON_GRAY)
|
||||
self.dj_button.setIcon(turntable_icon(color))
|
||||
self.dj_button.setIcon(turntable_icon(color, 22))
|
||||
|
||||
def volume_level(self) -> float:
|
||||
"""The volume slider, 0..1 (perceptual, as Player takes it)."""
|
||||
@@ -769,8 +773,8 @@ class TransportBar(QWidget):
|
||||
|
||||
row.set_panel(QRect(x_of(self._now_playing), 0,
|
||||
self._now_playing.width(), row.height()))
|
||||
box = self._dj_bpm_box
|
||||
row.set_right(self.dj_button, QRect(x_of(box), 0, box.width(), row.height()))
|
||||
box = self._dj_box
|
||||
row.set_right(self._bpm_button, QRect(x_of(box), 0, box.width(), row.height()))
|
||||
if self._split_widgets:
|
||||
lists, content = self._split_widgets
|
||||
row.set_split(x_of(lists), x_of(lists, lists.width()),
|
||||
|
||||
Reference in New Issue
Block a user