v0.63.1: nothing starts the main player in DJ mode; sync always clickable

Return or a double-click on a song started the regular player behind the
decks, with its controls greyed out and no way to stop it. DJ mode now
suspends the player. Sync to other track was only re-enabled when its own
deck changed, so loading the other deck afterwards left it grey; it's now
enabled whenever its deck has a song and explains what it can't do.
This commit is contained in:
2026-10-17 02:19:02 -07:00
parent 57cc5d5289
commit 8298450814
6 changed files with 91 additions and 12 deletions
+48
View File
@@ -295,3 +295,51 @@ def test_dj_mode_greys_the_transport_and_ignores_space(qapp, tmp_path, monkeypat
assert track_table.deck_tag is None
finally:
window.close()
# ---- Round 93 fixes: nothing starts the main player; sync always clickable ----
def test_a_suspended_player_cannot_be_started(qapp, tmp_path):
from tests.test_round29 import _FakeSink, _local_track, _player
tracks = [_local_track(tmp_path, i) for i in range(1, 4)]
player = _player(qapp, tracks)
sink = _FakeSink()
player.set_sink(sink)
player.set_suspended(True)
player.play_queue([1, 2, 3], 0)
player.toggle_play()
player.next()
assert player.current_track is None and not sink.loads
player.set_suspended(False)
player.play_queue([1, 2, 3], 0)
assert player.current_track.track_id == 1
def test_return_on_a_song_does_nothing_in_dj_mode(qapp, tmp_path, monkeypatch):
from lintunes.gui.main_window import MainWindow
from lintunes.library_manager import LibraryManager
from lintunes.models.library import Library
from lintunes.preferences import Preferences
monkeypatch.setattr("lintunes.gui.main_window.load_config", lambda: {})
monkeypatch.setattr("lintunes.gui.main_window.save_config", lambda c: None)
window = MainWindow(LibraryManager(Library(), tmp_path), Preferences(tmp_path))
try:
window.set_dj_mode(True)
assert window.player.suspended
window.set_dj_mode(False)
window._dj_anim.stop()
window._dj_closed()
assert not window.player.suspended
finally:
window.close()
def test_sync_is_clickable_with_one_deck_and_says_why(shelf):
a, _ = shelf.views
_loaded(shelf, a, shelf.tracks[0], _clicks(124, 0.1, 5), 124.0, 0.1)
assert shelf.sync_buttons["A"].isEnabled()
said = []
shelf.message.connect(said.append)
shelf.sync(a)
assert said and "Deck B" in said[0]
assert a.deck.speed == 1.0