removed unwanted bar now with waveforms, major updates and enhancements
This commit is contained in:
@@ -365,6 +365,11 @@ struct DJAudioDevice: Identifiable, Equatable {
|
||||
@Published var error: String?
|
||||
let root: URL
|
||||
private(set) var library: Library?
|
||||
private var appleMusicStorage: AnyObject?
|
||||
@available(macOS 14.0, *) var appleMusic: AppleMusicSession {
|
||||
if let session = appleMusicStorage as? AppleMusicSession { return session }
|
||||
let session = AppleMusicSession();appleMusicStorage = session;return session
|
||||
}
|
||||
let dragSession = UUID().uuidString
|
||||
@Published var songs = [Song]()
|
||||
@Published var playlists = [PersonPlace]()
|
||||
@@ -379,6 +384,12 @@ struct DJAudioDevice: Identifiable, Equatable {
|
||||
mediaDirectory = root.appendingPathComponent("Media");waveformDirectory = root.appendingPathComponent("Waveforms")
|
||||
a = DJChannel("A",waveformCache:root.appendingPathComponent("Waveforms"));b = DJChannel("B",waveformCache:root.appendingPathComponent("Waveforms"))
|
||||
preview.autoFade = false;preview.volume = cueLevel;refreshDevices();applyMix()
|
||||
for deck in [a,b] {
|
||||
deck.player.onWillStartPlayback = { [weak self] in
|
||||
if #available(macOS 14.0, *),let session = self?.appleMusicStorage as? AppleMusicSession { session.pause() }
|
||||
return 0
|
||||
}
|
||||
}
|
||||
Publishers.CombineLatest4(a.$bpm,b.$bpm,a.player.$tempo,b.player.$tempo).dropFirst().sink { [weak self] _ in
|
||||
Task { @MainActor [weak self] in self?.maintainSync() }
|
||||
}.store(in:&syncObservers)
|
||||
@@ -1007,6 +1018,7 @@ struct DJConsole: View {
|
||||
@State private var reinterpreting = false
|
||||
@State private var reinterpretIDs = Set<Int64>()
|
||||
@State private var editingTrack: Song?
|
||||
@State private var appleMusicVisible = false
|
||||
@State private var graphicEQVisible = false
|
||||
@State private var waveformDetails = false
|
||||
@State private var favouritesOnly = false
|
||||
@@ -1052,7 +1064,13 @@ struct DJConsole: View {
|
||||
VStack(spacing:10) {
|
||||
header
|
||||
DJContinuousConsole(system:system,loadA:{loadSelected("A")},loadB:{loadSelected("B")}).fixedSize(horizontal:false,vertical:true)
|
||||
if appleMusicVisible {
|
||||
if #available(macOS 14.0, *) {
|
||||
AppleMusicBrowser(session:system.appleMusic,hasPlayingDeck:{system.a.player.playing || system.b.player.playing},stopDecks:{system.automix.stop();if system.a.player.playing { system.a.player.toggle() };if system.b.player.playing { system.b.player.toggle() }})
|
||||
} else { Text("Apple Music playback requires macOS 14 or later.").frame(maxWidth:.infinity,maxHeight:.infinity) }
|
||||
} else {
|
||||
DJLibrarySnapshot(revision:libraryRevision,selection:selection,selected:selected,page:page,busy:system.generatingWaveforms || system.importing,font:system.settings.libraryFont,height:system.settings.libraryRowHeight) { browser }.equatable().frame(maxWidth:.infinity,maxHeight:.infinity)
|
||||
}
|
||||
if let progress = system.automaticWaveformProgress {
|
||||
BackgroundWaveformStatus(progress:progress,cancel:{system.automaticWaveforms.cancel()},dismiss:{system.automaticWaveformProgress = nil})
|
||||
}
|
||||
@@ -1130,6 +1148,7 @@ struct DJConsole: View {
|
||||
Image(systemName:"waveform.path").foregroundStyle(DJStyle.a)
|
||||
Text("DJ WORKSTATION").font(.system(size:12,weight:.bold,design:.rounded))
|
||||
Text("TWO DECKS").font(.system(size:9,weight:.medium)).foregroundStyle(.secondary)
|
||||
Picker("Music source",selection:$appleMusicVisible) { Text("DJ Library").tag(false);Text("Apple Music").tag(true) }.pickerStyle(.segmented).frame(width:230)
|
||||
Spacer()
|
||||
Button { graphicEQVisible = true } label: { Label("Equaliser",systemImage:"slider.vertical.3") }.tint(system.graphicEQ.enabled ? .cyan : .accentColor)
|
||||
DJQueueButton(automix:system.automix,open:{queueVisible = true})
|
||||
|
||||
Reference in New Issue
Block a user