broken changes

This commit is contained in:
Mark Gregory
2026-11-05 16:56:19 +00:00
parent 80a895febb
commit 9da6d2fdcd
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -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)
+4 -1
View File
@@ -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 {