From 9da6d2fdcdf62baaf429e6805392bf5516e5cae4 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Thu, 5 Nov 2026 16:56:19 +0000 Subject: [PATCH] broken changes --- KJamsClone/DJWorkstation.swift | 5 ++++- KJamsCloneTests/KJamsCloneTests.swift | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/KJamsClone/DJWorkstation.swift b/KJamsClone/DJWorkstation.swift index e568680..444bc9c 100644 --- a/KJamsClone/DJWorkstation.swift +++ b/KJamsClone/DJWorkstation.swift @@ -370,7 +370,10 @@ struct DJAudioDevice: Identifiable, Equatable { case "Tempo XML": let rate = 1+(value*2-1)*settings.tempoRange/100 if syncActive,d.letter == "B" { a.player.tempo = b.bpm*rate/a.bpm;maintainSync() } else { p.tempo = rate } - case "Loop 1","Loop 2","Loop 4","Loop 8","Loop 16","Loop 32": d.loopBeats = Int(parts[1].split(separator:" ").last!) ?? 8;toggleLoop(d) + case "Loop 1","Loop 2","Loop 4","Loop 8","Loop 16","Loop 32": + let beats = Int(parts[1].split(separator:" ").last!) ?? 8 + if p.loopEnabled,d.loopBeats != beats { d.loopBeats = beats;status = "Deck \(d.letter) ยท \(beats)-beat loop active" } + else { d.loopBeats = beats;toggleLoop(d) } case "Clear cue 1","Clear cue 2","Clear cue 3","Clear cue 4": p.hotCue((Int(parts[1].suffix(1)) ?? 1)-1,clear:true) case "Sync": sync(d) case "Loop": toggleLoop(d) diff --git a/KJamsCloneTests/KJamsCloneTests.swift b/KJamsCloneTests/KJamsCloneTests.swift index a062851..5a8ffdc 100644 --- a/KJamsCloneTests/KJamsCloneTests.swift +++ b/KJamsCloneTests/KJamsCloneTests.swift @@ -2249,7 +2249,7 @@ extension KJamsCloneTests { XCTAssertTrue(model.player.playing);XCTAssertTrue(model.dj.a.player.playing) XCTAssertEqual(model.player.currentSongID,id);XCTAssertEqual(model.dj.a.player.currentSongID,id) } - try await selectTab(1) + model.dj.automix.enqueue([song,song]);try await selectTab(1) if let rep = host.bitmapImageRepForCachingDisplay(in:host.bounds) { host.cacheDisplay(in:host.bounds,to:rep);try XCTUnwrap(rep.representation(using:.png,properties:[:])).write(to:URL(fileURLWithPath:"/private/tmp/kjmix-xml-mappings/dj-tab.png")) } try await selectTab(0) if let rep = host.bitmapImageRepForCachingDisplay(in:host.bounds) { host.cacheDisplay(in:host.bounds,to:rep);try XCTUnwrap(rep.representation(using:.png,properties:[:])).write(to:URL(fileURLWithPath:"/private/tmp/kjmix-xml-mappings/karaoke-tab.png")) } @@ -2277,6 +2277,9 @@ extension KJamsCloneTests { XCTAssertEqual(player.loopOut!,2.25,accuracy:0.001);XCTAssertTrue(player.playing);XCTAssertTrue(player.loopEnabled) deck.loopBeats = 2;XCTAssertEqual(player.loopOut!,0.75,accuracy:0.001) XCTAssertEqual(player.loopIn!,0.25,accuracy:0.001);XCTAssertTrue(player.playing) + system.action("A Loop 4");XCTAssertTrue(player.loopEnabled);XCTAssertEqual(player.loopOut!,1.25,accuracy:0.001) + system.action("A Loop 4");XCTAssertFalse(player.loopEnabled,"Repeating the same loop-pad size switches it off") + player.defineLoop(start:0.25,end:1.25) deck.loopBeats = 32;XCTAssertEqual(player.loopOut!,player.duration,accuracy:0.001) } @MainActor func testDJQueueOrderDuplicatesAndSettingsPersistWithoutAutoplay() throws {