forked from trav/lintunes
v0.66.0: DJ mode's djay layout, loops, a sync that sets once, a real horn, a smooth slide
- Records in the top corners, each deck's controls beside them facing the middle, the zoomed A-over-B waveforms in the centre, and a whole-song overview per deck below (click to jump, drag to move) with the crossfader between them. - Loops per deck: Loop plus a 1/32 to 8 beat stepper; a loop starts on the next beat and shows on both waveforms. - Sync sets this deck to the other's tempo once, and stays lit only while that still holds. - The air horn plays like a real one: every press a fresh blast, held it carries the note, let go it stops. - Opening and closing DJ mode slides a picture over the final layout instead of re-laying-out the window every frame (the flicker). - Tests: garbage is collected on the main thread after each test, which stops a rare segfault in the full run.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
"""LinTunes — iTunes-style music library manager and player for Linux."""
|
||||
|
||||
__version__ = "0.65.0"
|
||||
__version__ = "0.66.0"
|
||||
|
||||
+70
-36
@@ -89,6 +89,7 @@ class Deck:
|
||||
self.vocal_mix = 0.0
|
||||
self.scratch_rate: float | None = None
|
||||
self.volume = 1.0 # the deck's own fader, before the crossfader
|
||||
self.loop: tuple[int, int] | None = None # (start, end) source frames
|
||||
self.ended = False # reached the end by playing (GUI clears)
|
||||
self._ola: np.ndarray | None = None # overlap-add tail
|
||||
self._last: int | None = None # where the last window was read
|
||||
@@ -97,6 +98,7 @@ class Deck:
|
||||
|
||||
def load(self, source: Source | None):
|
||||
self.playing = False
|
||||
self.loop = None
|
||||
self.source = source
|
||||
self.position = 0.0
|
||||
self.ended = False
|
||||
@@ -117,6 +119,34 @@ class Deck:
|
||||
# ---- rendering ----
|
||||
|
||||
def render(self, count: int) -> np.ndarray:
|
||||
"""``count`` frames out. With a loop set, playback that crosses its
|
||||
end jumps back to its start — rendered in pieces that stop at the
|
||||
end, so even a 1/32-beat loop lands where it should."""
|
||||
loop = self.loop
|
||||
if loop is None or self.scratch_rate is not None or not self.playing:
|
||||
return self._render(count)
|
||||
start, end = loop
|
||||
pieces = []
|
||||
left = count
|
||||
while left > 0:
|
||||
speed = max(self.speed, 1e-3)
|
||||
n = left
|
||||
if self.position < end:
|
||||
to_end = int(np.ceil((end - self.position) / speed))
|
||||
n = max(1, min(left, to_end))
|
||||
before = self.position
|
||||
pieces.append(self._render(n))
|
||||
left -= n
|
||||
if before < end <= self.position:
|
||||
self.position -= (end - start)
|
||||
if not self.playing:
|
||||
break
|
||||
out = np.concatenate(pieces) if pieces else np.zeros((0, CHANNELS), np.float32)
|
||||
if len(out) < count:
|
||||
out = np.concatenate([out, np.zeros((count - len(out), CHANNELS), np.float32)])
|
||||
return out
|
||||
|
||||
def _render(self, count: int) -> np.ndarray:
|
||||
src = self.source
|
||||
if src is None:
|
||||
return np.zeros((count, CHANNELS), np.float32)
|
||||
@@ -231,22 +261,24 @@ def crossfade_gains(x: float) -> tuple[float, float]:
|
||||
|
||||
|
||||
class Horn:
|
||||
"""The air horn: a real recording ("Air Horn Hype", CC0 — see
|
||||
lintunes/sounds/CREDITS.md), the classic BWAAH-bwah-bwah-BWAAAH.
|
||||
Pressed, it plays from the top; *held*, the first long blast is
|
||||
stretched for as long as the button stays down (its steady middle,
|
||||
``LOOP``, looped with a crossfade so the seam can't be heard); let go,
|
||||
the rest of the phrase plays out. A tap is simply the whole phrase."""
|
||||
"""The air horn, played like the real thing: a real recording ("Air
|
||||
Horn Hype", CC0 — see lintunes/sounds/CREDITS.md). Every press is a
|
||||
fresh blast from the top; held, it carries the note (the first blast's
|
||||
steady middle, ``LOOP``, looped with a crossfade); let go, it stops,
|
||||
with a short natural fade — so rapid taps give BWAH-BWAH-BWAH and a
|
||||
hold gives one long BWAAAAAH. A press while a blast is still ringing
|
||||
starts a new one and lets the old one fade under it (no click)."""
|
||||
|
||||
LOOP = (0.10, 0.40) # seconds: inside the first blast (0–0.48 s)
|
||||
CROSSFADE = 0.03
|
||||
RELEASE = 0.09 # the fade once the button comes up
|
||||
VOICES = 3
|
||||
LEVEL = 1.0
|
||||
|
||||
def __init__(self, sample: np.ndarray | None = None):
|
||||
self.on = False
|
||||
self._src = None
|
||||
self._held = None
|
||||
self._pos = None # None = silent
|
||||
self._voices: list[dict] = [] # {"pos", "gain", "fading"}
|
||||
if sample is not None:
|
||||
self.set_sample(sample)
|
||||
|
||||
@@ -255,7 +287,6 @@ class Horn:
|
||||
src = sample.astype(np.float32)
|
||||
if sample.dtype == np.int16:
|
||||
src /= 32768.0
|
||||
self._src = src
|
||||
l0, l1 = (int(t * RATE) for t in self.LOOP)
|
||||
xf = int(self.CROSSFADE * RATE)
|
||||
l1 = min(l1, len(src))
|
||||
@@ -266,43 +297,46 @@ class Horn:
|
||||
# its start, so jumping back to l0 continues seamlessly
|
||||
held[l1 - xf:l1] = src[l1 - xf:l1] * (1 - ramp) + src[l0 - xf:l0] * ramp
|
||||
self._held = held
|
||||
self._loop = (l0, l1, xf)
|
||||
self._loop = (l0, l1)
|
||||
|
||||
def press(self):
|
||||
self.on = True
|
||||
self._pos = 0
|
||||
for voice in self._voices:
|
||||
voice["fading"] = True
|
||||
self._voices.append({"pos": 0, "gain": 1.0, "fading": False})
|
||||
del self._voices[:-self.VOICES]
|
||||
|
||||
def release(self):
|
||||
self.on = False
|
||||
for voice in self._voices:
|
||||
voice["fading"] = True
|
||||
|
||||
def render(self, count: int) -> np.ndarray | None:
|
||||
if self._src is None or self._pos is None:
|
||||
if self._held is None or not self._voices:
|
||||
return None
|
||||
l0, l1, xf = self._loop
|
||||
l0, l1 = self._loop
|
||||
out = np.zeros((count, CHANNELS), np.float32)
|
||||
made = 0
|
||||
while made < count:
|
||||
pos = self._pos
|
||||
if pos >= len(self._src):
|
||||
self._pos = None
|
||||
break
|
||||
if self.on or l1 - xf <= pos < l1 and pos >= l0:
|
||||
# held (or finishing the crossfade lap): play the looped
|
||||
# version, wrapping at the loop's end
|
||||
take = min(count - made, (l1 - pos) if pos < l1 else len(self._src) - pos)
|
||||
if pos < l1:
|
||||
out[made:made + take] = self._held[pos:pos + take]
|
||||
self._pos = pos + take
|
||||
if self._pos >= l1 and self.on:
|
||||
self._pos = l0
|
||||
else:
|
||||
out[made:made + take] = self._src[pos:pos + take]
|
||||
self._pos = pos + take
|
||||
else:
|
||||
take = min(count - made, len(self._src) - pos)
|
||||
out[made:made + take] = self._src[pos:pos + take]
|
||||
self._pos = pos + take
|
||||
made += take
|
||||
step = 1.0 / (self.RELEASE * RATE)
|
||||
kept = []
|
||||
for voice in self._voices:
|
||||
# the frames this voice plays: the loop while it's held
|
||||
index = voice["pos"] + np.arange(count)
|
||||
if not voice["fading"]:
|
||||
over = index >= l1
|
||||
index[over] = l0 + (index[over] - l1) % (l1 - l0)
|
||||
alive = index < len(self._held)
|
||||
frames = np.zeros((count, CHANNELS), np.float32)
|
||||
frames[alive] = self._held[index[alive]]
|
||||
if voice["fading"]:
|
||||
gain = voice["gain"] - step * np.arange(1, count + 1)
|
||||
gain = np.clip(gain, 0.0, 1.0)
|
||||
voice["gain"] = float(gain[-1])
|
||||
frames *= gain[:, None]
|
||||
out += frames
|
||||
voice["pos"] = int(index[-1]) + 1
|
||||
if voice["gain"] > 0 and voice["pos"] < len(self._held):
|
||||
kept.append(voice)
|
||||
self._voices = kept
|
||||
return out * self.LEVEL
|
||||
|
||||
|
||||
|
||||
+394
-112
@@ -51,7 +51,9 @@ COMPACT_HEIGHT = 200
|
||||
DEFAULT_ROWS_BELOW = 15
|
||||
MIN_ROWS_BELOW, MAX_ROWS_BELOW = 5, 28
|
||||
GRIP = 8
|
||||
DECK_WIDTH = 250 # a record's column: |◀ ⏯ and "Sync to other track" fit
|
||||
RECORD_SIZE = 170 # the records, top corners
|
||||
CONTROLS_WIDTH = 236 # a deck's controls, beside its record
|
||||
CROSSFADER_WIDTH = 280
|
||||
WARN_GAIN = 0.5
|
||||
|
||||
|
||||
@@ -69,7 +71,9 @@ class DeckView:
|
||||
self.bpm_saved = False
|
||||
self.counted = False
|
||||
self.mult = 1.0 # the ½× / 1× / 2× switch
|
||||
self.synced = False # following the other deck's tempo
|
||||
self.synced = False # set to the other deck's tempo, and still is
|
||||
self.synced_to = None # …the track it was set to
|
||||
self.loop_beats = 4.0
|
||||
|
||||
@property
|
||||
def color(self) -> QColor:
|
||||
@@ -513,6 +517,17 @@ class WaveLanes(QWidget):
|
||||
p.setPen(QPen(color, 1))
|
||||
for x, a, b in lines:
|
||||
p.drawLine(QPointF(x + 0.5, a), QPointF(x + 0.5, b))
|
||||
loop = deck.loop
|
||||
if loop is not None:
|
||||
span_s = window * speed
|
||||
x0 = (loop[0] / RATE - heard) / span_s * w + w / 2
|
||||
x1 = (loop[1] / RATE - heard) / span_s * w + w / 2
|
||||
band = QColor(view.color)
|
||||
band.setAlpha(60)
|
||||
p.fillRect(QRectF(x0, lane.top(), max(2.0, x1 - x0), lane.height()), band)
|
||||
p.setPen(QPen(view.color.lighter(130), 1))
|
||||
p.drawLine(QPointF(x0, lane.top()), QPointF(x0, lane.bottom()))
|
||||
p.drawLine(QPointF(x1, lane.top()), QPointF(x1, lane.bottom()))
|
||||
if view.beat_bpm:
|
||||
beat = 60.0 / view.beat_bpm
|
||||
first = math.ceil((edges[0] - view.offset) / beat)
|
||||
@@ -807,6 +822,148 @@ class VocalSlider(SnapSlider):
|
||||
p.drawPixmap(QPointF(x, 0), pix)
|
||||
|
||||
|
||||
class OverviewWave(QWidget):
|
||||
"""A deck's whole song, start to end: the peaks, the part already
|
||||
played shaded, the loop (if any), and the playhead moving along it.
|
||||
Click to jump; drag to move the playhead through the song."""
|
||||
|
||||
def __init__(self, view: "DeckView", shelf, parent=None):
|
||||
super().__init__(parent)
|
||||
self.view = view
|
||||
self.shelf = shelf
|
||||
self._cache = None # (peaks id, width) -> values
|
||||
self._dragging = False
|
||||
self.setMinimumHeight(56)
|
||||
self.setMaximumHeight(80)
|
||||
self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
|
||||
self.setFixedHeight(64)
|
||||
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
||||
self.setToolTip(f"Deck {view.name}: the whole song — click to jump, drag to move")
|
||||
|
||||
def _values(self, w: int) -> np.ndarray:
|
||||
peaks = self.view.peaks
|
||||
key = (id(peaks), w)
|
||||
if self._cache is None or self._cache[0] != key:
|
||||
idx = np.linspace(0, len(peaks), w + 1).astype(np.int64)
|
||||
self._cache = (key, _pixel_max(peaks, idx, widest=max(1, len(peaks) // max(1, w) + 1)))
|
||||
return self._cache[1]
|
||||
|
||||
def _seconds_at(self, x: float) -> float:
|
||||
src = self.view.deck.source
|
||||
return max(0.0, min(1.0, x / max(1, self.width()))) * src.seconds
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
if event.button() == Qt.MouseButton.LeftButton and self.view.deck.source is not None:
|
||||
self._dragging = True
|
||||
self.shelf.jump(self.view, self._seconds_at(event.position().x()))
|
||||
|
||||
def mouseMoveEvent(self, event):
|
||||
if self._dragging:
|
||||
self.shelf.jump(self.view, self._seconds_at(event.position().x()))
|
||||
|
||||
def mouseReleaseEvent(self, event):
|
||||
self._dragging = False
|
||||
|
||||
def paintEvent(self, event):
|
||||
p = QPainter(self)
|
||||
rect = QRectF(self.rect())
|
||||
path = QPainterPath()
|
||||
path.addRoundedRect(rect, 6, 6)
|
||||
p.fillPath(path, QColor("#1d1e20"))
|
||||
view = self.view
|
||||
src = view.deck.source
|
||||
if src is None or view.peaks is None or len(view.peaks) == 0:
|
||||
p.setPen(QColor("#5a5a5a"))
|
||||
p.drawText(rect, int(Qt.AlignmentFlag.AlignCenter), f"Deck {view.name}")
|
||||
return
|
||||
w = max(1, self.width())
|
||||
values = self._values(w)
|
||||
mid = rect.center().y()
|
||||
half = rect.height() / 2 - 6
|
||||
heard = self.shelf.heard_seconds(view)
|
||||
at = heard / max(src.seconds, 1e-6) * w
|
||||
played, ahead = QColor(view.color), QColor(view.color).darker(150)
|
||||
for x in range(w):
|
||||
y = float(values[x]) * half
|
||||
if y <= 0.4:
|
||||
continue
|
||||
p.setPen(played if x < at else ahead)
|
||||
p.drawLine(QPointF(x + 0.5, mid - y), QPointF(x + 0.5, mid + y))
|
||||
loop = view.deck.loop
|
||||
if loop is not None:
|
||||
x0 = loop[0] / RATE / src.seconds * w
|
||||
x1 = loop[1] / RATE / src.seconds * w
|
||||
band = QColor(view.color)
|
||||
band.setAlpha(70)
|
||||
p.fillRect(QRectF(x0, 0, max(2.0, x1 - x0), rect.height()), band)
|
||||
p.setPen(QPen(QColor("white"), 2))
|
||||
p.drawLine(QPointF(at, 0), QPointF(at, rect.height()))
|
||||
p.setPen(QColor(view.color))
|
||||
p.drawText(rect.adjusted(8, 3, -8, -3),
|
||||
int(Qt.AlignmentFlag.AlignLeft | Qt.AlignmentFlag.AlignTop),
|
||||
f"{_clock(heard)}")
|
||||
p.drawText(rect.adjusted(8, 3, -8, -3),
|
||||
int(Qt.AlignmentFlag.AlignRight | Qt.AlignmentFlag.AlignTop),
|
||||
f"-{_clock(max(0.0, src.seconds - heard))}")
|
||||
|
||||
|
||||
def _clock(seconds: float) -> str:
|
||||
seconds = int(seconds)
|
||||
return f"{seconds // 60}:{seconds % 60:02d}"
|
||||
|
||||
|
||||
LOOP_SIZES = (1 / 32, 1 / 16, 1 / 8, 1 / 4, 1 / 2, 1, 2, 4, 8)
|
||||
|
||||
|
||||
def _loop_label(beats: float) -> str:
|
||||
return f"1/{round(1 / beats)}" if beats < 1 else f"{int(beats)}"
|
||||
|
||||
|
||||
class SlideOverlay(QWidget):
|
||||
"""The DJ shelf's open/close animation: a picture sliding over the real,
|
||||
already-final window. Opening, the old lists picture slides down by
|
||||
``shift``, uncovering the live decks above it. Closing, the picture's
|
||||
top ``shift`` (the shelf) stays put while the rest (the lists) slides
|
||||
up over it, uncovering the real lists below."""
|
||||
|
||||
def __init__(self, parent, picture, shift: int, opening: bool):
|
||||
super().__init__(parent)
|
||||
self.picture = picture
|
||||
self.shift = shift
|
||||
self.opening = opening
|
||||
self.progress = 0.0
|
||||
self.setAttribute(Qt.WidgetAttribute.WA_TransparentForMouseEvents)
|
||||
|
||||
def set_progress(self, value):
|
||||
self.progress = float(value)
|
||||
self.update()
|
||||
|
||||
def paintEvent(self, event):
|
||||
p = QPainter(self)
|
||||
pic = self.picture
|
||||
ratio = pic.devicePixelRatio() or 1.0
|
||||
w = pic.width() / ratio
|
||||
h = pic.height() / ratio
|
||||
if self.opening:
|
||||
y = round(self.shift * self.progress)
|
||||
p.drawPixmap(QPointF(0, y), pic)
|
||||
# the top half's shadow, cast on the decks as they appear
|
||||
if y > 0:
|
||||
shade = QLinearGradient(0, 0, 0, 12)
|
||||
shade.setColorAt(0, QColor(0, 0, 0, 140))
|
||||
shade.setColorAt(1, QColor(0, 0, 0, 0))
|
||||
p.fillRect(QRectF(0, 0, w, min(12, y)), QBrush(shade))
|
||||
else:
|
||||
top = int(self.shift * ratio)
|
||||
shelf = pic.copy(0, 0, pic.width(), top)
|
||||
rest = pic.copy(0, top, pic.width(), pic.height() - top)
|
||||
shelf.setDevicePixelRatio(ratio)
|
||||
rest.setDevicePixelRatio(ratio)
|
||||
y = round(self.shift * (1.0 - self.progress))
|
||||
p.drawPixmap(QPointF(0, 0), shelf)
|
||||
p.drawPixmap(QPointF(0, y), rest)
|
||||
|
||||
|
||||
class Grip(QWidget):
|
||||
"""The shelf's bottom edge: drag to resize, double-click for the default."""
|
||||
|
||||
@@ -939,13 +1096,15 @@ class DjShelf(QWidget):
|
||||
self.pitch_boxes = {}
|
||||
self.mult_buttons = {}
|
||||
self.start_buttons = {}
|
||||
self.loop_buttons = {}
|
||||
self.loop_sizes = {}
|
||||
self._compact_hidden = []
|
||||
self._big_records = {}
|
||||
|
||||
def fader_title(text, v):
|
||||
label = QLabel(text)
|
||||
label.setStyleSheet(f"color: {v.color.name()}; font-size: 10px;"
|
||||
" font-weight: bold; letter-spacing: 1px;")
|
||||
label.setStyleSheet(f"color: {v.color.name()}; font-size: 9px;"
|
||||
" font-weight: bold;")
|
||||
return label
|
||||
|
||||
def volume_col(v):
|
||||
@@ -975,7 +1134,7 @@ class DjShelf(QWidget):
|
||||
col.addWidget(label, alignment=Qt.AlignmentFlag.AlignHCenter)
|
||||
holder = QWidget()
|
||||
holder.setLayout(col)
|
||||
holder.setFixedWidth(64)
|
||||
holder.setFixedWidth(58)
|
||||
self.volume[v.name] = slider
|
||||
self._compact_hidden.append(holder)
|
||||
return holder
|
||||
@@ -995,7 +1154,7 @@ class DjShelf(QWidget):
|
||||
label = QLabel("+0.0%")
|
||||
label.setStyleSheet(f"color: {v.color.name()}; font-size: 11px;")
|
||||
label.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
label.setMinimumWidth(60)
|
||||
label.setMinimumWidth(54)
|
||||
for w in (top, bottom):
|
||||
w.setStyleSheet(f"color: {DIM}; font-size: 10px;")
|
||||
for w in (top, slider, bottom, label):
|
||||
@@ -1003,98 +1162,84 @@ class DjShelf(QWidget):
|
||||
col.setStretch(2, 1)
|
||||
holder = QWidget()
|
||||
holder.setLayout(col)
|
||||
holder.setFixedWidth(64)
|
||||
holder.setFixedWidth(58)
|
||||
self.speed[v.name] = slider
|
||||
self.speed_label[v.name] = label
|
||||
self._compact_hidden.append(holder)
|
||||
return holder
|
||||
|
||||
def deck_col(v):
|
||||
holder = QWidget()
|
||||
col = QVBoxLayout(holder)
|
||||
col.setContentsMargins(0, 0, 0, 0)
|
||||
col.setSpacing(8)
|
||||
def record_col(v):
|
||||
record = RecordWidget(v, self)
|
||||
record.dropped.connect(lambda tid, v=v: self._on_drop(v, tid))
|
||||
record.toggled.connect(lambda v=v: self.toggle(v))
|
||||
self.records[v.name] = record
|
||||
col.addWidget(record, stretch=1)
|
||||
controls = QWidget()
|
||||
buttons = QHBoxLayout(controls)
|
||||
buttons.setContentsMargins(0, 0, 0, 0)
|
||||
buttons.setSpacing(8)
|
||||
back = QToolButton()
|
||||
back.setIcon(QIcon(_start_icon()))
|
||||
back.setIconSize(QSize(16, 16))
|
||||
back.setFixedSize(34, 34)
|
||||
back.setToolTip(f"Deck {v.name}: back to the beginning")
|
||||
back.clicked.connect(lambda _=False, v=v: self.to_start(v))
|
||||
back.setStyleSheet(_deck_button_qss(v.name))
|
||||
back.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
buttons.addWidget(back)
|
||||
self.start_buttons[v.name] = back
|
||||
play = QToolButton()
|
||||
play.setIcon(QIcon(_play_icon(False)))
|
||||
play.setIconSize(QSize(16, 16))
|
||||
play.setFixedSize(46, 34)
|
||||
play.setToolTip(f"Play / pause Deck {v.name}")
|
||||
play.clicked.connect(lambda _=False, v=v: self.toggle(v))
|
||||
sync = QPushButton("Sync to other track")
|
||||
sync.setFixedHeight(34)
|
||||
sync.setToolTip("Match the other deck's tempo; while both play, "
|
||||
"also line up the beats (the smallest nudge)")
|
||||
sync.clicked.connect(lambda _=False, v=v: self.sync(v))
|
||||
for w in (play, sync):
|
||||
w.setStyleSheet(_deck_button_qss(v.name))
|
||||
w.setFocusPolicy(Qt.FocusPolicy.NoFocus) # Space/Return mean nothing here
|
||||
buttons.addWidget(play)
|
||||
buttons.addWidget(sync, stretch=1)
|
||||
self.play_buttons[v.name] = play
|
||||
self.sync_buttons[v.name] = sync
|
||||
col.addWidget(controls)
|
||||
vocals = QWidget()
|
||||
vcol = QVBoxLayout(vocals)
|
||||
vcol.setContentsMargins(0, 0, 0, 0)
|
||||
vcol.setSpacing(2)
|
||||
slider = VocalSlider(v.color)
|
||||
slider.valueChanged.connect(lambda value, v=v: setattr(v.deck, "vocal_mix", value / 100))
|
||||
vcol.addWidget(slider)
|
||||
note = QLabel("")
|
||||
note.setStyleSheet(f"color: {DIM}; font-size: 10px;")
|
||||
vcol.addWidget(note)
|
||||
self.vocal_sliders[v.name] = slider
|
||||
self.stem_labels[v.name] = note
|
||||
col.addWidget(vocals)
|
||||
self._compact_hidden += [controls, vocals]
|
||||
holder.setFixedWidth(DECK_WIDTH)
|
||||
self._big_records[v.name] = holder
|
||||
return holder
|
||||
record.setFixedWidth(RECORD_SIZE)
|
||||
self._big_records[v.name] = record
|
||||
return record
|
||||
|
||||
def info_row(v):
|
||||
line = QHBoxLayout()
|
||||
line.setSpacing(12)
|
||||
texts = QVBoxLayout()
|
||||
texts.setSpacing(0)
|
||||
def controls_col(v, right: bool):
|
||||
"""Everything a deck has besides its record and faders, facing
|
||||
the middle: what's loaded, its tempo, the transport, loops,
|
||||
vocals."""
|
||||
align = Qt.AlignmentFlag.AlignRight if right else Qt.AlignmentFlag.AlignLeft
|
||||
holder = QWidget()
|
||||
col = QVBoxLayout(holder)
|
||||
col.setContentsMargins(0, 0, 0, 0)
|
||||
col.setSpacing(5)
|
||||
state = QLabel(f"DECK {v.name}")
|
||||
state.setStyleSheet(f"color: {v.color.name()}; font-size: 10px; letter-spacing: 1px;")
|
||||
title = QLabel("")
|
||||
title.setStyleSheet(f"color: {TEXT}; font-size: 14px;")
|
||||
title.setTextFormat(Qt.TextFormat.RichText)
|
||||
texts.addWidget(state)
|
||||
texts.addWidget(title)
|
||||
line.addLayout(texts, stretch=1)
|
||||
nums = QVBoxLayout()
|
||||
nums.setSpacing(0)
|
||||
for w in (state, title):
|
||||
w.setAlignment(align)
|
||||
col.addWidget(w)
|
||||
nums = QHBoxLayout()
|
||||
nums.setSpacing(8)
|
||||
bpm = QLabel("–")
|
||||
bpm.setAlignment(Qt.AlignmentFlag.AlignRight)
|
||||
bpm.setStyleSheet(f"color: {v.color.name()}; font-size: 22px; font-weight: bold;")
|
||||
note = QLabel("BPM")
|
||||
note.setAlignment(Qt.AlignmentFlag.AlignRight)
|
||||
note.setStyleSheet(f"color: {DIM}; font-size: 10px;")
|
||||
nums.addWidget(bpm)
|
||||
nums.addWidget(note)
|
||||
line.addLayout(nums)
|
||||
line.addWidget(self._mult_switch(v))
|
||||
note.setAlignment(Qt.AlignmentFlag.AlignBottom)
|
||||
if right:
|
||||
nums.addStretch(1)
|
||||
nums.addWidget(note)
|
||||
nums.addWidget(bpm)
|
||||
else:
|
||||
nums.addWidget(bpm)
|
||||
nums.addWidget(note)
|
||||
nums.addStretch(1)
|
||||
col.addLayout(nums)
|
||||
|
||||
buttons = QHBoxLayout()
|
||||
buttons.setSpacing(6)
|
||||
back = QToolButton()
|
||||
back.setIcon(QIcon(_start_icon()))
|
||||
back.setIconSize(QSize(16, 16))
|
||||
back.setFixedSize(34, 32)
|
||||
back.setToolTip(f"Deck {v.name}: back to the beginning")
|
||||
back.clicked.connect(lambda _=False, v=v: self.to_start(v))
|
||||
play = QToolButton()
|
||||
play.setIcon(QIcon(_play_icon(False)))
|
||||
play.setIconSize(QSize(16, 16))
|
||||
play.setFixedSize(44, 32)
|
||||
play.setToolTip(f"Play / pause Deck {v.name}")
|
||||
play.clicked.connect(lambda _=False, v=v: self.toggle(v))
|
||||
sync = QPushButton("Sync to other track")
|
||||
sync.setFixedHeight(32)
|
||||
sync.setToolTip("Set this deck to the other deck's tempo now; while "
|
||||
"both play, line the beats up too (the smallest nudge)")
|
||||
sync.clicked.connect(lambda _=False, v=v: self.sync(v))
|
||||
for w in (back, play, sync):
|
||||
w.setStyleSheet(_deck_button_qss(v.name))
|
||||
w.setFocusPolicy(Qt.FocusPolicy.NoFocus) # Space/Return mean nothing here
|
||||
row_widgets = [back, play, sync]
|
||||
for w in (reversed(row_widgets) if right else row_widgets):
|
||||
buttons.addWidget(w, stretch=1 if w is sync else 0)
|
||||
col.addLayout(buttons)
|
||||
|
||||
extras = QHBoxLayout()
|
||||
extras.setSpacing(8)
|
||||
pitch = QCheckBox("Keep pitch")
|
||||
pitch.setChecked(True)
|
||||
pitch.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
@@ -1102,19 +1247,51 @@ class DjShelf(QWidget):
|
||||
pitch.setToolTip("On: a faster song stays in its key. Off: pitch "
|
||||
"follows speed, like a turntable")
|
||||
pitch.toggled.connect(lambda on, v=v: setattr(v.deck, "keep_pitch", on))
|
||||
line.addWidget(pitch)
|
||||
mult = self._mult_switch(v)
|
||||
loop = self._loop_controls(v)
|
||||
for line, parts in ((extras, [mult, pitch]), (QHBoxLayout(), [loop])):
|
||||
line.setSpacing(8)
|
||||
if right:
|
||||
line.addStretch(1)
|
||||
parts.reverse()
|
||||
for w in parts:
|
||||
line.addWidget(w)
|
||||
if not right:
|
||||
line.addStretch(1)
|
||||
col.addLayout(line)
|
||||
|
||||
slider = VocalSlider(v.color)
|
||||
slider.valueChanged.connect(lambda value, v=v: setattr(v.deck, "vocal_mix", value / 100))
|
||||
col.addWidget(slider)
|
||||
stem = QLabel("")
|
||||
stem.setStyleSheet(f"color: {DIM}; font-size: 10px;")
|
||||
stem.setAlignment(align)
|
||||
col.addWidget(stem)
|
||||
col.addStretch(1)
|
||||
|
||||
self.titles[v.name] = title
|
||||
self.states[v.name] = state
|
||||
self.bpm_labels[v.name] = bpm
|
||||
self.bpm_notes[v.name] = note
|
||||
self.pitch_boxes[v.name] = pitch
|
||||
self._compact_hidden += [pitch, note]
|
||||
return line
|
||||
self.start_buttons[v.name] = back
|
||||
self.play_buttons[v.name] = play
|
||||
self.sync_buttons[v.name] = sync
|
||||
self.vocal_sliders[v.name] = slider
|
||||
self.stem_labels[v.name] = stem
|
||||
holder.setFixedWidth(CONTROLS_WIDTH)
|
||||
self._compact_hidden.append(holder)
|
||||
return holder
|
||||
|
||||
a, b = self.views
|
||||
row.addWidget(volume_col(a))
|
||||
row.addWidget(speed_col(a))
|
||||
row.addWidget(deck_col(a))
|
||||
middle = QVBoxLayout()
|
||||
middle.setSpacing(10)
|
||||
top = QHBoxLayout()
|
||||
top.setSpacing(14)
|
||||
top.addWidget(record_col(a))
|
||||
top.addWidget(controls_col(a, right=False))
|
||||
centre = QVBoxLayout()
|
||||
centre.setSpacing(6)
|
||||
horn_row = QHBoxLayout()
|
||||
@@ -1124,29 +1301,36 @@ class DjShelf(QWidget):
|
||||
horn_row.addStretch(1)
|
||||
centre.addLayout(horn_row)
|
||||
self._compact_hidden.append(self.horn)
|
||||
centre.addLayout(info_row(a))
|
||||
self.lanes = WaveLanes(self)
|
||||
centre.addWidget(self.lanes, stretch=1)
|
||||
centre.addLayout(info_row(b))
|
||||
fader = QHBoxLayout()
|
||||
fader.setContentsMargins(0, 2, 0, 4)
|
||||
fader.addStretch(1)
|
||||
top.addLayout(centre, stretch=1)
|
||||
top.addWidget(controls_col(b, right=True))
|
||||
top.addWidget(record_col(b))
|
||||
middle.addLayout(top, stretch=1)
|
||||
|
||||
bottom = QHBoxLayout()
|
||||
bottom.setSpacing(14)
|
||||
self.overviews = {}
|
||||
for v in (a, b):
|
||||
ov = OverviewWave(v, self)
|
||||
self.overviews[v.name] = ov
|
||||
self._compact_hidden.append(ov)
|
||||
bottom.addWidget(self.overviews["A"], stretch=1)
|
||||
left = QLabel("A")
|
||||
left.setStyleSheet(f"color: {COLORS['A'].name()}; font-weight: bold;")
|
||||
right = QLabel("B")
|
||||
right.setStyleSheet(f"color: {COLORS['B'].name()}; font-weight: bold;")
|
||||
right_label = QLabel("B")
|
||||
right_label.setStyleSheet(f"color: {COLORS['B'].name()}; font-weight: bold;")
|
||||
self.crossfader = Crossfader()
|
||||
self.crossfader.setFixedWidth(CROSSFADER_WIDTH)
|
||||
self.crossfader.valueChanged.connect(lambda value: setattr(self.mixer, "crossfader", value / 1000))
|
||||
fader.addWidget(left)
|
||||
fader.addWidget(self.crossfader, stretch=3)
|
||||
fader.addWidget(right)
|
||||
fader.addStretch(1)
|
||||
centre.addLayout(fader)
|
||||
row.addLayout(centre, stretch=1)
|
||||
row.addWidget(deck_col(b))
|
||||
bottom.addWidget(left)
|
||||
bottom.addWidget(self.crossfader)
|
||||
bottom.addWidget(right_label)
|
||||
bottom.addWidget(self.overviews["B"], stretch=1)
|
||||
middle.addLayout(bottom)
|
||||
row.addLayout(middle, stretch=1)
|
||||
row.addWidget(speed_col(b))
|
||||
row.addWidget(volume_col(b))
|
||||
self._small_records = {}
|
||||
for v in self.views:
|
||||
self._refresh_deck(v)
|
||||
|
||||
@@ -1189,6 +1373,95 @@ class DjShelf(QWidget):
|
||||
self.mult_buttons[v.name] = group
|
||||
return box
|
||||
|
||||
def _loop_controls(self, v):
|
||||
"""Loop (on/off) and ‹ size › in beats: 1/32 … 8."""
|
||||
box = QWidget()
|
||||
row = QHBoxLayout(box)
|
||||
row.setContentsMargins(0, 0, 0, 0)
|
||||
row.setSpacing(0)
|
||||
loop = QToolButton()
|
||||
loop.setText("Loop")
|
||||
loop.setCheckable(True)
|
||||
loop.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
loop.setToolTip("Loop from the next beat, for the length beside it; "
|
||||
"click again to play on past it")
|
||||
loop.setFixedHeight(24)
|
||||
loop.setMinimumWidth(52)
|
||||
loop.clicked.connect(lambda on, v=v: self.set_loop(v, on))
|
||||
less = QToolButton()
|
||||
less.setText("‹")
|
||||
more = QToolButton()
|
||||
more.setText("›")
|
||||
size = QLabel(_loop_label(v.loop_beats))
|
||||
size.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
||||
size.setFixedWidth(30)
|
||||
size.setStyleSheet(f"color: {TEXT}; background: #1b1b1c; font-size: 11px;"
|
||||
" border-top: 1px solid #111; border-bottom: 1px solid #111;")
|
||||
size.setFixedHeight(24)
|
||||
for b, step in ((less, -1), (more, 1)):
|
||||
b.setFixedSize(18, 24)
|
||||
b.setFocusPolicy(Qt.FocusPolicy.NoFocus)
|
||||
b.clicked.connect(lambda _=False, v=v, step=step: self.step_loop(v, step))
|
||||
top, bottom = FACES[v.name]
|
||||
loop.setStyleSheet(
|
||||
f"QToolButton {{ color: #e8e8e8; border: 1px solid #111; border-radius: 5px;"
|
||||
f" background: #3a3b3d; padding: 0 8px; margin-right: 4px; }}"
|
||||
f"QToolButton:hover {{ background: #46474a; }}"
|
||||
f"QToolButton:checked {{ color: white; font-weight: bold; background: qlineargradient("
|
||||
f"x1:0,y1:0,x2:0,y2:1, stop:0 {COLORS[v.name].name()}, stop:1 {bottom});"
|
||||
f" border: 1px solid {COLORS[v.name].lighter(140).name()}; }}")
|
||||
stepper = ("QToolButton {{ color: #cfcfcf; border: 1px solid #111; background: #3a3b3d;"
|
||||
" padding: 0; {0} }} QToolButton:hover {{ background: #46474a; }}"
|
||||
" QToolButton:pressed {{ background: #2a2b2d; }}")
|
||||
less.setStyleSheet(stepper.format("border-top-left-radius: 5px; border-bottom-left-radius: 5px;"))
|
||||
more.setStyleSheet(stepper.format("border-top-right-radius: 5px; border-bottom-right-radius: 5px;"))
|
||||
for w in (loop, less, size, more):
|
||||
row.addWidget(w)
|
||||
self.loop_buttons[v.name] = loop
|
||||
self.loop_sizes[v.name] = size
|
||||
return box
|
||||
|
||||
def _beat(self, view: DeckView) -> float | None:
|
||||
return 60.0 / view.beat_bpm if view.beat_bpm else None
|
||||
|
||||
def set_loop(self, view: DeckView, on: bool):
|
||||
"""Loop on: from the next beat, ``loop_beats`` long. Off: playback
|
||||
carries on past the loop's end."""
|
||||
deck = view.deck
|
||||
beat = self._beat(view)
|
||||
if not on or deck.source is None or beat is None:
|
||||
deck.loop = None
|
||||
self.loop_buttons[view.name].setChecked(False)
|
||||
if on and beat is None and deck.source is not None:
|
||||
self.message.emit("A loop needs the song's beat, and none was found.")
|
||||
return
|
||||
now = self.heard_seconds(view)
|
||||
k = math.ceil((now - view.offset) / beat - 1e-6)
|
||||
start = view.offset + k * beat
|
||||
self._place_loop(view, start)
|
||||
self.loop_buttons[view.name].setChecked(True)
|
||||
|
||||
def _place_loop(self, view: DeckView, start_s: float):
|
||||
beat = self._beat(view)
|
||||
length = view.loop_beats * beat
|
||||
view.deck.loop = (int(round(start_s * RATE)), int(round((start_s + length) * RATE)))
|
||||
|
||||
def step_loop(self, view: DeckView, step: int):
|
||||
i = LOOP_SIZES.index(view.loop_beats) if view.loop_beats in LOOP_SIZES else 7
|
||||
view.loop_beats = LOOP_SIZES[max(0, min(len(LOOP_SIZES) - 1, i + step))]
|
||||
self.loop_sizes[view.name].setText(_loop_label(view.loop_beats))
|
||||
if view.deck.loop is not None and self._beat(view):
|
||||
# a running loop keeps its start and takes the new length
|
||||
self._place_loop(view, view.deck.loop[0] / RATE)
|
||||
|
||||
def jump(self, view: DeckView, seconds: float):
|
||||
"""Move the playhead to ``seconds`` (the overview's click/drag)."""
|
||||
deck = view.deck
|
||||
if deck.source is None:
|
||||
return
|
||||
deck.seek(seconds * RATE)
|
||||
deck.ended = False
|
||||
|
||||
def set_mult(self, view: DeckView, mult: float):
|
||||
changed = mult != view.mult
|
||||
view.mult = mult
|
||||
@@ -1222,8 +1495,8 @@ class DjShelf(QWidget):
|
||||
self._compact = compact
|
||||
for w in self._compact_hidden:
|
||||
w.setVisible(not compact)
|
||||
for holder in self._big_records.values():
|
||||
holder.setFixedWidth(max(60, height - 30) if compact else DECK_WIDTH)
|
||||
for record in self._big_records.values():
|
||||
record.setFixedWidth(max(60, height - 30) if compact else RECORD_SIZE)
|
||||
|
||||
def resizeEvent(self, event):
|
||||
super().resizeEvent(event)
|
||||
@@ -1334,6 +1607,8 @@ class DjShelf(QWidget):
|
||||
self.speed[view.name].setValue(0)
|
||||
self.vocal_sliders[view.name].setValue(0)
|
||||
self.set_mult(view, 1.0)
|
||||
if view.name in self.loop_buttons:
|
||||
self.loop_buttons[view.name].setChecked(False)
|
||||
try:
|
||||
art = tagging.read_embedded_artwork(track.location)
|
||||
except Exception: # noqa: BLE001 — art is never worth a failure
|
||||
@@ -1440,9 +1715,11 @@ class DjShelf(QWidget):
|
||||
target = other.beat_bpm * other.deck.speed
|
||||
view.deck.speed = analysis.sync_speed(view.beat_bpm, target)
|
||||
self._show_speed(view)
|
||||
# Sync stays on: this deck follows the other's tempo until its own
|
||||
# tempo fader is moved. Only one deck follows the other.
|
||||
# Sync *sets* this deck to the other's tempo, once. It stays lit
|
||||
# while that still holds; the other deck loading a new song, or
|
||||
# either tempo moving, leaves this tempo where it is, unlit.
|
||||
view.synced = True
|
||||
view.synced_to = other.track.track_id if other.track else None
|
||||
if other.synced:
|
||||
other.synced = False
|
||||
self._refresh_deck(other)
|
||||
@@ -1464,15 +1741,18 @@ class DjShelf(QWidget):
|
||||
view.synced = False # taken out of sync by hand
|
||||
self._refresh_deck(view)
|
||||
|
||||
def _follow(self, view: DeckView):
|
||||
"""A synced deck keeps the other's tempo as that one changes."""
|
||||
other = self.other(view)
|
||||
if not view.synced or not view.beat_bpm or not other.beat_bpm:
|
||||
def _check_sync(self, view: DeckView):
|
||||
"""Unlight Sync once it no longer holds: the other deck has another
|
||||
song, or the tempos have drifted apart."""
|
||||
if not view.synced:
|
||||
return
|
||||
speed = analysis.sync_speed(view.beat_bpm, other.beat_bpm * other.deck.speed)
|
||||
if abs(speed - view.deck.speed) > 1e-5:
|
||||
view.deck.speed = speed
|
||||
self._show_speed(view)
|
||||
other = self.other(view)
|
||||
same_song = other.track is not None and other.track.track_id == view.synced_to
|
||||
matches = (view.beat_bpm and other.beat_bpm and abs(
|
||||
analysis.sync_speed(view.beat_bpm, other.beat_bpm * other.deck.speed)
|
||||
- view.deck.speed) < 1e-4)
|
||||
if not (same_song and matches):
|
||||
view.synced = False
|
||||
self._refresh_deck(view)
|
||||
|
||||
def to_start(self, view: DeckView):
|
||||
@@ -1552,7 +1832,7 @@ class DjShelf(QWidget):
|
||||
viz.dj_playing_changed()
|
||||
self._sounding = sounding
|
||||
for v in self.views:
|
||||
self._follow(v)
|
||||
self._check_sync(v)
|
||||
for v in self.views:
|
||||
deck = v.deck
|
||||
if deck.ended and not v.counted and v.track is not None:
|
||||
@@ -1565,6 +1845,8 @@ class DjShelf(QWidget):
|
||||
if deck.playing or deck.scratch_rate is not None:
|
||||
self._refresh_bpm_only(v)
|
||||
self.lanes.update()
|
||||
for overview in self.overviews.values():
|
||||
overview.update()
|
||||
|
||||
def _refresh_bpm_only(self, view: DeckView):
|
||||
if view.beat_bpm:
|
||||
@@ -1593,7 +1875,7 @@ def _esc(text: str) -> str:
|
||||
return (text or "").replace("&", "&").replace("<", "<").replace(">", ">")
|
||||
|
||||
|
||||
FULL_HEIGHT = 320 # the whole layout, comfortably
|
||||
FULL_HEIGHT = 380 # the whole layout, comfortably
|
||||
|
||||
|
||||
def default_height(viewport_height: int, row_height: int, rows_below=DEFAULT_ROWS_BELOW) -> int:
|
||||
|
||||
@@ -7,7 +7,7 @@ from PyQt6.QtWidgets import (
|
||||
QPlainTextEdit, QTextEdit, QAbstractSpinBox, QComboBox, QApplication,
|
||||
QLabel, QMessageBox, QFileDialog, QProgressBar, QPushButton,
|
||||
)
|
||||
from PyQt6.QtCore import Qt, QEvent, QObject, QTimer, pyqtSignal
|
||||
from PyQt6.QtCore import QRect, Qt, QEvent, QObject, QTimer, pyqtSignal
|
||||
from PyQt6.QtGui import QAction, QKeySequence
|
||||
|
||||
from lintunes import bpm_detect, device_sync, loudness, music_folder, theme, url_import
|
||||
@@ -2399,17 +2399,21 @@ class MainWindow(QMainWindow):
|
||||
track_table.deck_tag = self._deck_tag
|
||||
shelf.set_master(self._dj_master())
|
||||
shelf.set_layout_height(target) # laid out full size, revealed
|
||||
shelf.setFixedHeight(0)
|
||||
split, before = self._snapshot_below_boxes()
|
||||
shelf.setFixedHeight(target)
|
||||
shelf.show()
|
||||
shelf.start()
|
||||
shelf.set_visualizer(self._transport._visualizer)
|
||||
self._sidebar.art.hide() # room for the lists instead
|
||||
self._animate_shelf(0, target)
|
||||
self._slide(split, before, shift=target + self._row_gap(), opening=True)
|
||||
else:
|
||||
shelf = self._dj
|
||||
track_table.deck_tag = None
|
||||
shelf.set_layout_height(shelf.height()) # covered, not squeezed
|
||||
self._animate_shelf(shelf.height(), 0, done=self._dj_closed)
|
||||
split, before = self._snapshot_below_boxes(shelf)
|
||||
shift = shelf.height() + self._row_gap()
|
||||
self._dj_closed_now()
|
||||
self._slide(split, before, shift=shift, opening=False)
|
||||
self._refresh_tables()
|
||||
|
||||
def _ensure_dj(self):
|
||||
@@ -2473,6 +2477,68 @@ class MainWindow(QMainWindow):
|
||||
self._dj_anim = anim
|
||||
anim.start()
|
||||
|
||||
# ---- the slide (Round 96) ----
|
||||
# Animating the shelf's real height re-laid-out the whole window every
|
||||
# frame — the flicker. Instead the window goes straight to its final
|
||||
# layout and a picture of what was below the transport boxes slides
|
||||
# over it: opening, the old lists slide down off the decks (which are
|
||||
# live underneath); closing, a picture of the shelf stays put while the
|
||||
# lists' picture slides up over it. Only an image moves.
|
||||
|
||||
def _row_gap(self) -> int:
|
||||
from lintunes.gui.transport import ROW_GAP
|
||||
return ROW_GAP
|
||||
|
||||
def _snapshot_below_boxes(self, shelf=None):
|
||||
"""(y in the central widget where the window parts, a picture of
|
||||
everything from there down)."""
|
||||
central = self.centralWidget()
|
||||
anchor = shelf if shelf is not None and shelf.isVisible() else \
|
||||
self._transport._header_row
|
||||
split = anchor.mapTo(central, anchor.rect().topLeft()).y()
|
||||
picture = central.grab(QRect(0, split, central.width(), central.height() - split))
|
||||
return split, picture
|
||||
|
||||
def _slide(self, split: int, picture, shift: int, opening: bool):
|
||||
from PyQt6.QtCore import QEasingCurve, QVariantAnimation
|
||||
from lintunes.gui.dj_shelf import SlideOverlay
|
||||
if self._dj_anim is not None:
|
||||
self._dj_anim.stop()
|
||||
old = getattr(self, "_dj_overlay", None)
|
||||
if old is not None:
|
||||
old.deleteLater()
|
||||
central = self.centralWidget()
|
||||
overlay = SlideOverlay(central, picture, shift, opening)
|
||||
overlay.setGeometry(0, split, central.width(), central.height() - split)
|
||||
overlay.show()
|
||||
overlay.raise_()
|
||||
self._dj_overlay = overlay
|
||||
anim = QVariantAnimation(self)
|
||||
anim.setStartValue(0.0)
|
||||
anim.setEndValue(1.0)
|
||||
anim.setDuration(self.ANIMATE_MS)
|
||||
anim.setEasingCurve(QEasingCurve.Type.OutCubic if opening
|
||||
else QEasingCurve.Type.InOutCubic)
|
||||
anim.valueChanged.connect(overlay.set_progress)
|
||||
|
||||
def finished():
|
||||
overlay.hide()
|
||||
overlay.deleteLater()
|
||||
if getattr(self, "_dj_overlay", None) is overlay:
|
||||
self._dj_overlay = None
|
||||
anim.finished.connect(finished)
|
||||
self._dj_anim = anim
|
||||
anim.start()
|
||||
|
||||
def _dj_closed_now(self):
|
||||
"""Closing, for real (the slide only shows it)."""
|
||||
self._dj.set_visualizer(None)
|
||||
self._dj.stop()
|
||||
self._dj.hide()
|
||||
self._sidebar.art.show()
|
||||
self.player.set_suspended(False)
|
||||
self._transport.set_dj_mode(False)
|
||||
|
||||
def _dj_closed(self):
|
||||
if self._dj_on:
|
||||
return # reopened mid-close
|
||||
|
||||
Reference in New Issue
Block a user