broken changes
This commit is contained in:
@@ -209,26 +209,24 @@ struct BackgroundDeckStrip: View {
|
||||
@ObservedObject var deck: BackgroundDeck
|
||||
private func stamp(_ seconds: Double) -> String { let value = Int(max(0,seconds));return String(format:"%d:%02d",value/60,value%60) }
|
||||
var body: some View {
|
||||
HStack(spacing:12) {
|
||||
Image(systemName:"music.note").font(.title3).foregroundStyle(deck.playing ? .green : .secondary)
|
||||
VStack(alignment:.leading,spacing:3) {
|
||||
Text(deck.loaded ? deck.title : "Background Music").font(.system(size:12,weight:.semibold)).lineLimit(1)
|
||||
Text(deck.status).font(.system(size:10)).foregroundStyle(.secondary).lineLimit(1)
|
||||
if deck.loaded {
|
||||
HStack(spacing:6) {
|
||||
Text(stamp(deck.time)).monospacedDigit()
|
||||
Slider(value:Binding(get:{deck.time},set:{deck.seek($0)}),in:0...max(0.001,deck.duration)).controlSize(.small).accessibilityLabel("Background track position").help("Drag to find the background track’s starting point; paused music stays paused")
|
||||
Text(stamp(deck.duration)).monospacedDigit()
|
||||
}.font(.system(size:10)).foregroundStyle(.secondary)
|
||||
}
|
||||
}.frame(maxWidth:.infinity,alignment:.leading)
|
||||
Toggle("Auto",isOn:Binding(get:{model.studio.backgroundAutoEnabled},set:{model.studio.automaticBackground = $0})).toggleStyle(.checkbox).help("Start background music between singers; pause it before singer audio starts")
|
||||
Button("Choose…") { model.chooseBackground() }.controlSize(.small)
|
||||
Button { if deck.playing { model.pauseBackground() } else { model.playBackground() } } label: { Image(systemName:deck.playing ? "pause.fill" : "play.fill").frame(width:23) }.disabled(!deck.loaded).help(deck.playing ? "Pause background music" : "DJ: start or resume background music")
|
||||
Button { model.stopBackground() } label: { Image(systemName:"stop.fill") }.disabled(!deck.loaded).help("Stop background and return to start")
|
||||
Slider(value:$model.studio.backgroundTrim,in:0...1).frame(width:85).controlSize(.small).help("Background level relative to global master").accessibilityLabel("Background level")
|
||||
Text("\(Int(model.studio.backgroundTrim*100))%").font(.caption.monospacedDigit()).foregroundStyle(.secondary).frame(width:30)
|
||||
}.padding(.horizontal,12).padding(.vertical,8).background(Color.primary.opacity(0.035),in:RoundedRectangle(cornerRadius:9))
|
||||
HStack(spacing:10) {
|
||||
Image(systemName:"music.note.list").foregroundStyle(deck.playing ? .green : .secondary)
|
||||
VStack(alignment:.leading,spacing:1) {
|
||||
Text("BACKGROUND MUSIC").font(.system(size:8,weight:.semibold)).foregroundStyle(.secondary)
|
||||
Text(deck.loaded ? deck.title : "Choose background music").font(.system(size:10,weight:.medium)).lineLimit(1).help(deck.title+" · "+deck.status)
|
||||
}.frame(width:175,alignment:.leading)
|
||||
if deck.loaded {
|
||||
Text(stamp(deck.time)).font(.system(size:9).monospacedDigit()).foregroundStyle(.secondary)
|
||||
Slider(value:Binding(get:{deck.time},set:{deck.seek($0)}),in:0...max(0.001,deck.duration)).controlSize(.mini).accessibilityLabel("Background track position").frame(minWidth:70)
|
||||
Text(stamp(deck.duration)).font(.system(size:9).monospacedDigit()).foregroundStyle(.secondary)
|
||||
} else { Spacer(minLength:0) }
|
||||
Toggle("Auto",isOn:Binding(get:{model.studio.backgroundAutoEnabled},set:{model.studio.automaticBackground = $0})).toggleStyle(.checkbox).font(.system(size:10)).help("Start between singers and pause before singer audio")
|
||||
Button("Choose…") { model.chooseBackground() }
|
||||
Button { if deck.playing { model.pauseBackground() } else { model.playBackground() } } label: { Image(systemName:deck.playing ? "pause.fill" : "play.fill") }.disabled(!deck.loaded).accessibilityLabel("Background play pause")
|
||||
Button { model.stopBackground() } label: { Image(systemName:"stop.fill") }.disabled(!deck.loaded).accessibilityLabel("Stop background music")
|
||||
Slider(value:$model.studio.backgroundTrim,in:0...1).frame(width:65).accessibilityLabel("Background music level")
|
||||
Text("\(Int(model.studio.backgroundTrim*100))%").font(.system(size:9).monospacedDigit()).foregroundStyle(.secondary).frame(width:26)
|
||||
}.controlSize(.mini).padding(.horizontal,10).padding(.vertical,6).background(Color.primary.opacity(0.035),in:RoundedRectangle(cornerRadius:6))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user