broken changes

This commit is contained in:
Mark Gregory
2026-11-05 22:31:53 +00:00
parent df8cb6b17d
commit d71c823ee6
3 changed files with 75 additions and 22 deletions
+9
View File
@@ -23,6 +23,15 @@ import CoreAudio
@Published var loopEnabled = false
var isShowScreen: Bool { slideImage != nil }
var canJog: Bool { currentSongID != nil && duration > 0 }
/// Read the audio clock for display frames without publishing the entire player at 60 Hz.
var displayTime: Double {
guard playing,node.isPlaying,let file,let render = node.lastRenderTime,
let current = node.playerTime(forNodeTime:render) else { return time }
let now = mach_absolute_time()
let elapsed = render.isHostTimeValid && now >= render.hostTime ? min(0.1,AVAudioTime.seconds(forHostTime:now-render.hostTime)) : 0
let position = anchor+Double(current.sampleTime)/file.processingFormat.sampleRate+elapsed*tempo
return min(duration,max(0,position))
}
func stopDeck() {
guard canJog else { return }
pauseDeck();loopEnabled = false;seek(0)