Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c33079c96a | ||
|
|
4ae6136847 | ||
|
|
13f4fc5afe | ||
|
|
40c72000aa | ||
|
|
3a3a20107b |
No files matched your search
+18
-32
@@ -36,19 +36,6 @@ enum Tab: String, CaseIterable, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
/// The pages of the deck beside docked Now Playing on an unfolded iPhone Duo.
|
||||
enum DeckPage: String, CaseIterable, Hashable {
|
||||
case Stems, Lyrics, Queue, Eq
|
||||
var title: String {
|
||||
switch self {
|
||||
case .Stems: "Stems"
|
||||
case .Lyrics: "Lyrics"
|
||||
case .Queue: "Playing Next"
|
||||
case .Eq: "EQ"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum Route: Hashable {
|
||||
case Artists, Albums, Songs, RecentlyAdded, Playlists, Genres, Downloads, DownloadQueue, TabBar, WebRadio
|
||||
case Eq, EqFilters(profileId: String), EqFilterPage(profileId: String, filterId: String)
|
||||
@@ -67,10 +54,8 @@ final class Ui {
|
||||
}
|
||||
/// True while an unfolded iPhone Duo shows Now Playing docked beside the library.
|
||||
private(set) var split = false
|
||||
/// Split only: the Now Playing tab (the deck) is selected instead of `tab`.
|
||||
/// Split only: the side opposite Now Playing shows the stems and queue (true) or the selected tab.
|
||||
var deck = true
|
||||
/// Split only: which of the deck's pages is showing.
|
||||
var deckPage: DeckPage = .Stems
|
||||
let overlays: Overlays
|
||||
|
||||
init(overlays: Overlays) { self.overlays = overlays }
|
||||
@@ -85,21 +70,12 @@ final class Ui {
|
||||
|
||||
/// Tapping the selected tab again pops it to its root.
|
||||
func selectTab(_ t: Tab) {
|
||||
if showsDeck { deck = false; tab = t; return }
|
||||
if split && deck { deck = false; tab = t; return }
|
||||
if t == tab { paths[t] = [] } else { tab = t }
|
||||
}
|
||||
|
||||
/// Split with something playing, the bar leads with a Now Playing item that opens the deck.
|
||||
var hasDeckTab: Bool { split && AppGraph.shared.playback.current != nil }
|
||||
var showsDeck: Bool { hasDeckTab && deck }
|
||||
|
||||
/// The tabs currently in the bar, in order. The Now Playing item takes one of the five places
|
||||
/// (iOS folds a sixth into "More"), so the last one before Settings steps aside for it.
|
||||
var tabs: [Tab] {
|
||||
var t = Tab.layout(AppGraph.shared.settings.tabLayout)
|
||||
if hasDeckTab && t.count >= Tab.maxVisible, let i = t.lastIndex(where: { $0 != .Settings }) { t.remove(at: i) }
|
||||
return t
|
||||
}
|
||||
/// The tabs currently in the bar, in order.
|
||||
var tabs: [Tab] { Tab.layout(AppGraph.shared.settings.tabLayout) }
|
||||
|
||||
/// Where library pages open: Library if it's in the bar, else the first tab that is.
|
||||
private var home: Tab { tabs.contains(.Library) ? .Library : (tabs.first ?? .Settings) }
|
||||
@@ -117,8 +93,8 @@ final class Ui {
|
||||
/// Docked Now Playing is already on screen, so there's nothing to open while split.
|
||||
func openNowPlaying() { if !split { nowPlayingOpen = true } }
|
||||
|
||||
/// Split only: brings the stems and queue (or the lyrics) back beside Now Playing.
|
||||
func showDeck(_ page: DeckPage? = nil) { deck = true; if let page { deckPage = page } }
|
||||
/// Split only: brings the stems and queue back beside Now Playing.
|
||||
func showDeck() { deck = true }
|
||||
|
||||
func setSplit(_ on: Bool) {
|
||||
guard on != split else { return }
|
||||
@@ -128,8 +104,18 @@ final class Ui {
|
||||
// Only an iPhone Duo ever splits, so from here on folded Now Playing uses its tighter layout.
|
||||
UserDefaults.standard.set(true, forKey: "duoSeen")
|
||||
}
|
||||
// Karaoke left on shows its lyrics in the deck.
|
||||
if on && AppGraph.shared.playback.karaoke { deckPage = .Lyrics } else if deckPage == .Lyrics { deckPage = .Stems }
|
||||
// Each pane is phone-sized, so give it portrait-phone traits. Unfolded landscape is
|
||||
// otherwise compact-height, which moves nav bar buttons into a column down the pane's
|
||||
// trailing edge (eating its width, and landing under the rail on the right pane).
|
||||
for case let scene as UIWindowScene in UIApplication.shared.connectedScenes {
|
||||
if on {
|
||||
scene.traitOverrides.verticalSizeClass = .regular
|
||||
scene.traitOverrides.horizontalSizeClass = .compact
|
||||
} else {
|
||||
scene.traitOverrides.remove(UITraitVerticalSizeClass.self)
|
||||
scene.traitOverrides.remove(UITraitHorizontalSizeClass.self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Switches to the Library tab and pushes [r] there.
|
||||
|
||||
@@ -2,39 +2,39 @@ import SwiftUI
|
||||
import UIKit
|
||||
|
||||
/// The tab bar, a navigation stack per tab, the mini player and the Now Playing sheet.
|
||||
/// On an unfolded iPhone Duo each tab splits at the hinge: Now Playing docks on one side, the tab
|
||||
/// (or the stems, queue and lyrics deck) on the other, and the tabs stay in the system's own bar.
|
||||
/// On an unfolded iPhone Duo Now Playing takes one side of the hinge, the stems and queue (or a tab)
|
||||
/// the other, and the tabs move to a rail on the right edge beside the status bar.
|
||||
struct RootView: View {
|
||||
@State private var ui = Ui(overlays: Overlays())
|
||||
/// Unfolded iPhone Duo: Now Playing on the left of the hinge instead of the right.
|
||||
@AppStorage("duoSwap") private var duoSwap = false
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
let s = g.settings
|
||||
let p = Palette.of(s.theme, s.accent)
|
||||
TabView(selection: Binding(get: { ui.showsDeck ? BarItem.deck : .tab(ui.tab) },
|
||||
set: { if case .tab(let t) = $0 { ui.selectTab(t) } else { ui.showDeck() } })) {
|
||||
// Unfolded with something playing, Now Playing leads the bar: the deck (stems, lyrics,
|
||||
// queue, EQ) on this side of the hinge, the player docked on the other.
|
||||
if ui.hasDeckTab {
|
||||
DuoPane { NowPlayingDeck() }
|
||||
.tabItem { Label("Now Playing", systemImage: "waveform") }
|
||||
.tag(BarItem.deck)
|
||||
}
|
||||
ForEach(ui.tabs, id: \.self) { t in
|
||||
DuoPane {
|
||||
NavigationStack(path: ui.path(t)) {
|
||||
root(t).miniPlayerRoom()
|
||||
.navigationDestination(for: Route.self) { destination($0).miniPlayerRoom() }
|
||||
}
|
||||
.modifier(FloatingMiniPlayer())
|
||||
DuoSplit(swap: duoSwap, showDeck: ui.deck, onSplit: { ui.setSplit($0) }) {
|
||||
TabView(selection: Binding(get: { ui.tab }, set: { ui.selectTab($0) })) {
|
||||
ForEach(Tab.layout(s.tabLayout), id: \.self) { t in
|
||||
NavigationStack(path: ui.path(t)) {
|
||||
root(t).miniPlayerRoom()
|
||||
.navigationDestination(for: Route.self) { destination($0).miniPlayerRoom() }
|
||||
}
|
||||
.modifier(FloatingMiniPlayer())
|
||||
.tabItem { Label(t.rawValue, systemImage: t.icon) }
|
||||
.tag(BarItem.tab(t))
|
||||
.tag(t)
|
||||
}
|
||||
}
|
||||
.modifier(GlassMiniPlayerHost())
|
||||
} deck: {
|
||||
NowPlayingDeck()
|
||||
} docked: {
|
||||
NowPlayingScreen(docked: true)
|
||||
} rail: {
|
||||
DuoRail(swap: $duoSwap)
|
||||
}
|
||||
.background(p.bg.ignoresSafeArea())
|
||||
.onChange(of: ui.tabs) { _, _ in ui.ensureValidTab() }
|
||||
.onChange(of: s.tabLayout) { _, _ in ui.ensureValidTab() }
|
||||
.fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) {
|
||||
NowPlayingScreen()
|
||||
.overlayHost(ui.overlays, level: 1)
|
||||
@@ -53,8 +53,6 @@ struct RootView: View {
|
||||
.tint(p.accent)
|
||||
}
|
||||
|
||||
private enum BarItem: Hashable { case deck, tab(Tab) }
|
||||
|
||||
@ViewBuilder private func root(_ t: Tab) -> some View {
|
||||
switch t {
|
||||
case .Library: LibraryHome()
|
||||
@@ -144,20 +142,8 @@ private struct MiniPlayerRoom: ViewModifier {
|
||||
content.safeAreaInset(edge: .bottom, spacing: 0) {
|
||||
if !glassAccessory && !ui.split && g.playback.current != nil { Color.clear.frame(height: 66) }
|
||||
}
|
||||
.modifier(PaneToolbar())
|
||||
}
|
||||
}
|
||||
|
||||
/// Split, each pane is phone-sized, so its nav bar stays across the top instead of moving into
|
||||
/// the Duo's vertical bar (the tab bar still goes there).
|
||||
private struct PaneToolbar: ViewModifier {
|
||||
@Environment(Ui.self) private var ui
|
||||
func body(content: Content) -> some View {
|
||||
if #available(iOS 27.1, *) {
|
||||
content.toolbarVerticalBehavior(ui.split ? .disabled : .automatic)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
// Split, the rail stands in for the tab bar.
|
||||
.toolbar(ui.split ? .hidden : .automatic, for: .tabBar)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,39 +151,56 @@ private extension View {
|
||||
func miniPlayerRoom() -> some View { modifier(MiniPlayerRoom()) }
|
||||
}
|
||||
|
||||
/// One tab's content, split at the iPhone Duo's hinge (the system's division region): the tab
|
||||
/// (or, for the Now Playing item, the deck) on one side, docked Now Playing on the other, left
|
||||
/// and right trading places with the deck's swap button. It measures inside the tab's safe area,
|
||||
/// so the system's tab bar is never covered. Anywhere without a hinge it's just the tab, and the
|
||||
/// tab stays put in the view tree so its scroll state survives folding, unfolding and swapping.
|
||||
private struct DuoPane<Content: View>: View {
|
||||
@ViewBuilder var content: Content
|
||||
@Environment(Ui.self) private var ui
|
||||
@AppStorage("duoSwap") private var swap = false
|
||||
private var g: AppGraph { .shared }
|
||||
/// Splits the screen at the iPhone Duo's hinge (the system's division region). [library] (with
|
||||
/// [deck] over it while [showDeck]) goes on one side and [docked] on the other, left and right
|
||||
/// trading places with [swap]; [rail] runs down the right edge in the status bar's strip.
|
||||
/// Anywhere without a hinge it's just [library]. The library stays put in the view tree, so its
|
||||
/// tab and scroll state survive folding, unfolding and swapping.
|
||||
private struct DuoSplit<Library: View, Deck: View, Docked: View, Rail: View>: View {
|
||||
var swap: Bool
|
||||
var showDeck: Bool
|
||||
var onSplit: (Bool) -> Void
|
||||
@ViewBuilder var library: Library
|
||||
@ViewBuilder var deck: Deck
|
||||
@ViewBuilder var docked: Docked
|
||||
@ViewBuilder var rail: Rail
|
||||
|
||||
private static var railWidth: CGFloat { 64 }
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geo in
|
||||
let cut = Self.cut(geo)
|
||||
let inset = geo.safeAreaInsets.trailing
|
||||
// The rail lives in the status bar's strip; if that's too thin it borrows from the right pane.
|
||||
let steal = cut == nil ? 0 : max(0, Self.railWidth - inset)
|
||||
let flip = swap && cut?.vertical == true
|
||||
let layout = cut?.vertical == false ? AnyLayout(VStackLayout(spacing: cut?.gap ?? 0)) : AnyLayout(HStackLayout(spacing: cut?.gap ?? 0))
|
||||
layout {
|
||||
content
|
||||
ZStack {
|
||||
library
|
||||
if cut != nil && showDeck { deck.transition(.opacity) }
|
||||
}
|
||||
.environment(\.layoutDirection, .leftToRight)
|
||||
.frame(width: cut.map { $0.vertical ? (flip ? $0.second : $0.first) : geo.size.width } ?? geo.size.width,
|
||||
.frame(width: cut.map { $0.vertical ? (flip ? $0.second - steal : $0.first) : geo.size.width - steal } ?? geo.size.width,
|
||||
height: cut.map { $0.vertical ? geo.size.height : $0.first } ?? geo.size.height)
|
||||
if let cut {
|
||||
NowPlayingScreen(docked: true)
|
||||
docked
|
||||
.environment(\.layoutDirection, .leftToRight)
|
||||
.frame(width: cut.vertical ? (flip ? cut.first : cut.second) : geo.size.width,
|
||||
.frame(width: cut.vertical ? (flip ? cut.first : cut.second - steal) : geo.size.width - steal,
|
||||
height: cut.vertical ? geo.size.height : cut.second)
|
||||
}
|
||||
}
|
||||
// Right-to-left lays the same two children out mirrored, so swapping doesn't rebuild either.
|
||||
.environment(\.layoutDirection, flip ? .rightToLeft : .leftToRight)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
if cut != nil {
|
||||
rail.frame(width: max(inset, Self.railWidth), height: geo.size.height).offset(x: inset)
|
||||
}
|
||||
}
|
||||
.animation(.spring(duration: 0.4, bounce: 0.1), value: flip)
|
||||
.onChange(of: cut != nil, initial: true) { _, on in ui.setSplit(on) }
|
||||
.animation(.easeInOut(duration: 0.2), value: showDeck)
|
||||
.onChange(of: cut != nil, initial: true) { _, on in onSplit(on) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +217,7 @@ private struct DuoPane<Content: View>: View {
|
||||
c = vertical
|
||||
? Cut(vertical: true, first: r.minX, gap: r.width, second: size.width - r.maxX)
|
||||
: Cut(vertical: false, first: r.minY, gap: r.height, second: size.height - r.maxY)
|
||||
} else if UIDevice.current.userInterfaceIdiom == .phone, size.width >= 700, size.height >= 500 {
|
||||
} else if UIDevice.current.userInterfaceIdiom == .phone, size.width >= 760, size.height >= 560 {
|
||||
// No region reported: only an unfolded Duo gives an iPhone this much room both ways.
|
||||
// The hinge sits at the middle of the screen, not of the safe area, so place it from there.
|
||||
let screenW = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds.width
|
||||
@@ -226,3 +229,43 @@ private struct DuoPane<Content: View>: View {
|
||||
return c.first > 200 && c.second > 200 ? c : nil
|
||||
}
|
||||
}
|
||||
|
||||
/// The tab bar's stand-in on an unfolded iPhone Duo: Now Playing's stems and queue, the tabs, and
|
||||
/// a button that swaps which side of the hinge Now Playing sits on.
|
||||
private struct DuoRail: View {
|
||||
@Binding var swap: Bool
|
||||
@Environment(Ui.self) private var ui
|
||||
@Environment(\.palette) private var p
|
||||
|
||||
var body: some View {
|
||||
// Sits at the bottom of the strip: the top is where the panes' back buttons and the
|
||||
// status bar live, and the tabs used to land right on them.
|
||||
VStack(spacing: 4) {
|
||||
Spacer(minLength: 160)
|
||||
item("Playing", "waveform", on: ui.deck) { ui.showDeck() }
|
||||
ForEach(ui.tabs, id: \.self) { t in
|
||||
item(t.rawValue, t.icon, on: !ui.deck && ui.tab == t) { ui.selectTab(t) }
|
||||
}
|
||||
Capsule().fill(p.label3.opacity(0.4)).frame(width: 24, height: 2).padding(.vertical, 8)
|
||||
item("Swap", "arrow.left.arrow.right", on: false) { swap.toggle() }
|
||||
}
|
||||
.padding(.bottom, 20)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
|
||||
private func item(_ title: String, _ icon: String, on: Bool, _ action: @escaping () -> Void) -> some View {
|
||||
Button { withAnimation(.snappy(duration: 0.25)) { action() } } label: {
|
||||
VStack(spacing: 3) {
|
||||
Image(systemName: icon).font(.system(size: 19, weight: on ? .semibold : .regular)).frame(height: 24)
|
||||
Text(title).font(.system(size: 10, weight: .medium)).lineLimit(1).minimumScaleFactor(0.7)
|
||||
}
|
||||
.foregroundStyle(on ? p.accent : p.label2)
|
||||
.frame(width: 56, height: 52)
|
||||
.background(on ? p.accent.opacity(0.14) : .clear, in: RoundedRectangle(cornerRadius: 12, style: .continuous))
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(PressFade())
|
||||
.accessibilityLabel(title)
|
||||
.accessibilityAddTraits(on ? .isSelected : [])
|
||||
}
|
||||
}
|
||||
@@ -202,86 +202,6 @@ struct VerticalBandSlider: View {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- deck EQ (unfolded iPhone Duo) ---------------------------------------------------------
|
||||
|
||||
/// The graphic EQ as a deck page: tall vertical bands that use the pane's height, with the
|
||||
/// on/off switch, profile and presets above them. Filters and devices stay in Settings.
|
||||
struct DeckEqPanel: View {
|
||||
@Environment(Ui.self) private var ui
|
||||
@Environment(\.palette) private var p
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
let eq = g.eq
|
||||
let state = eq.state
|
||||
VStack(spacing: 14) {
|
||||
HStack(spacing: 10) {
|
||||
Toggle("Equalizer", isOn: Binding(get: { state.enabled }, set: { eq.setEnabled($0) }))
|
||||
.labelsHidden().tint(Color(hex: 0x34C759))
|
||||
if let pr = eq.active {
|
||||
Menu {
|
||||
Section("Profile") {
|
||||
ForEach(state.profiles, id: \.id) { x in
|
||||
Button { eq.select(x.id) } label: {
|
||||
if x.id == pr.id { Label(x.name, systemImage: "checkmark") } else { Text(x.name) }
|
||||
}
|
||||
}
|
||||
}
|
||||
Section("Load Preset") {
|
||||
ForEach(EQ_PRESETS, id: \.0) { name, gains in Button(name) { eq.setGains(pr.id, gains) } }
|
||||
}
|
||||
} label: {
|
||||
HStack(spacing: 4) {
|
||||
Text(pr.name).lineLimit(1)
|
||||
Image(systemName: "chevron.up.chevron.down").font(.caption.weight(.semibold))
|
||||
}
|
||||
.font(.subheadline.weight(.semibold)).foregroundStyle(p.label)
|
||||
.padding(.horizontal, 12).frame(height: 32)
|
||||
.background(p.fill, in: Capsule())
|
||||
}
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
Button { ui.showInSettings(.Eq) } label: {
|
||||
Text("More").font(.subheadline.weight(.semibold)).foregroundStyle(p.label2)
|
||||
.padding(.horizontal, 12).frame(height: 32).background(p.fill, in: Capsule())
|
||||
}
|
||||
.buttonStyle(PressFade())
|
||||
}
|
||||
if let pr = eq.active {
|
||||
let preamp = effectivePreamp(pr)
|
||||
EqCurve(chain: pr.chain, preampDb: preamp, enabled: state.enabled, range: EQ_MAX_DB + 3, bandMarkers: true)
|
||||
.frame(height: 72)
|
||||
HStack(spacing: 0) {
|
||||
ForEach(EQ_BANDS.indices, id: \.self) { i in
|
||||
let v = pr.gains[i]
|
||||
VStack(spacing: 6) {
|
||||
Text(db(v)).font(.caption2.monospacedDigit()).foregroundStyle(abs(v) > 0.05 ? p.accent : p.label2)
|
||||
.lineLimit(1).fixedSize()
|
||||
VerticalBandSlider(value: v / EQ_MAX_DB) { eq.setGain(pr.id, band: i, db: round1($0 * EQ_MAX_DB)) }
|
||||
.frame(maxHeight: .infinity)
|
||||
Text(EQ_LABELS[i]).font(.caption2).foregroundStyle(p.label2)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
}
|
||||
.frame(maxHeight: .infinity)
|
||||
.opacity(state.enabled ? 1 : 0.5)
|
||||
HStack {
|
||||
Text("Preamp").foregroundStyle(p.label2)
|
||||
Spacer()
|
||||
Text(abs(preamp) < 0.05 ? "off" : "\(db(preamp)) dB").monospacedDigit().foregroundStyle(p.label2)
|
||||
}
|
||||
.font(.subheadline)
|
||||
} else {
|
||||
Text("No EQ profile yet. Make one in Settings.").font(.subheadline).foregroundStyle(p.label2)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 24).padding(.top, 8).padding(.bottom, 12)
|
||||
.onAppear { eq.refreshRoute() }
|
||||
}
|
||||
}
|
||||
|
||||
// ---- main EQ screen -------------------------------------------------------------------------
|
||||
|
||||
struct EqScreen: View {
|
||||
|
||||
@@ -114,8 +114,6 @@ struct NowPlayingScreen: View {
|
||||
private var tight: Bool { docked || duoSeen }
|
||||
/// Size of the art panel in the stacked layout, so the controls can match the art's width.
|
||||
@State private var artBox: CGSize = .zero
|
||||
/// The screen's height, for the strip at the top that a drag down closes from.
|
||||
@State private var screenH: CGFloat = 0
|
||||
private var artInset: CGFloat { tight ? 18 : 28 }
|
||||
private var hPad: CGFloat { tight ? 20 : 28 }
|
||||
private var g: AppGraph { .shared }
|
||||
@@ -127,8 +125,7 @@ struct NowPlayingScreen: View {
|
||||
// Wide when there's no room to stack art over controls: landscape, or iPhone Duo's
|
||||
// outer display. Tall layouts (including the unfolded Duo) cap the controls' width.
|
||||
GeometryReader { geo in
|
||||
// Docked beside the hinge, the pane is phone-shaped: art stays on top unless it's truly wide.
|
||||
let wide = geo.size.width > geo.size.height * (docked ? 1.2 : 0.9)
|
||||
let wide = geo.size.width > geo.size.height * 0.9
|
||||
if let track {
|
||||
if wide {
|
||||
// The column never drops below what the transport row needs, so the buttons
|
||||
@@ -146,12 +143,11 @@ struct NowPlayingScreen: View {
|
||||
let cap: CGFloat = tight ? 520 : 560
|
||||
// Controls line up with the art's edges instead of running wider than it.
|
||||
let art = min(artBox.width - 2 * artInset, artBox.height - 16)
|
||||
// Every panel keeps the art screen's width, so switching to the stems doesn't widen it.
|
||||
let w = art > 0 ? min(cap, max(300, art + 2 * hPad)) : cap
|
||||
let w = panel == .Art && art > 0 ? min(cap, max(300, art + 2 * hPad)) : cap
|
||||
VStack(spacing: 0) {
|
||||
panelView(track, header: true)
|
||||
.frame(maxWidth: panel == .Art ? .infinity : min(w, geo.size.width), maxHeight: .infinity)
|
||||
.onGeometryChange(for: CGSize.self) { $0.size } action: { if panel == .Art { artBox = $0 } }
|
||||
.frame(maxHeight: .infinity)
|
||||
.onGeometryChange(for: CGSize.self) { $0.size } action: { artBox = $0 }
|
||||
.transition(.opacity.combined(with: .scale(scale: 0.96)))
|
||||
controls(track, wide: false, width: min(w, geo.size.width)).frame(maxWidth: w)
|
||||
}
|
||||
@@ -171,19 +167,18 @@ struct NowPlayingScreen: View {
|
||||
if !docked { Capsule().fill(c.label3).frame(width: 36, height: 5)
|
||||
.frame(width: 120, height: 20).contentShape(Rectangle())
|
||||
.onTapGesture { dismiss() }
|
||||
.gesture(screenDrag(header: true)) }
|
||||
.gesture(screenDrag) }
|
||||
}
|
||||
.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { screenH = $0 }
|
||||
.offset(y: drop)
|
||||
// Drag down from the top strip (or the song header) to close, so it never fights the
|
||||
// stem faders. Swipe up anywhere on the art for the queue.
|
||||
.simultaneousGesture(screenDrag(), including: panel == .Art ? .all : .subviews)
|
||||
// On the art and the mixer: drag down anywhere to close, swipe up anywhere for the
|
||||
// queue. The queue and lyrics scroll, so there it's the song header or the grabber.
|
||||
.simultaneousGesture(screenDrag, including: panel == .Art || panel == .Mixer ? .all : .subviews)
|
||||
.environment(\.palette, c)
|
||||
.modifier(NpScheme(dark: c.dark, docked: docked))
|
||||
.tint(c.label)
|
||||
.animation(.easeInOut(duration: 0.3), value: tint)
|
||||
.presentationBackground(.clear)
|
||||
.onAppear { if !docked && g.playback.karaoke { panel = .Lyrics } }
|
||||
.onAppear { if g.playback.karaoke { panel = .Lyrics } }
|
||||
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
|
||||
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
|
||||
tint = await albumColor(thumb, dark: base.dark)
|
||||
@@ -194,9 +189,9 @@ struct NowPlayingScreen: View {
|
||||
private func panelView(_ track: Track, header: Bool) -> some View {
|
||||
switch panel {
|
||||
case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: header || !tight ? artInset : 12).contentShape(Rectangle())
|
||||
case .Mixer: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag(header: true)) }; MixerPanel() }
|
||||
case .Queue: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag(header: true)) }; QueuePanel(close: { show(.Queue) }) }
|
||||
case .Lyrics: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag(header: true)) }; LyricsPanel(track: track) }
|
||||
case .Mixer: VStack(spacing: 0) { if header { MiniHeader(track: track) }; MixerPanel() }
|
||||
case .Queue: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag) }; QueuePanel(close: { show(.Queue) }) }
|
||||
case .Lyrics: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag) }; LyricsPanel(track: track) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,9 +243,9 @@ struct NowPlayingScreen: View {
|
||||
.padding(.top, tight ? 4 : 14)
|
||||
HStack {
|
||||
let hidden = NowPlayingButton.hidden(g.settings.hiddenNowPlaying)
|
||||
if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.showsDeck && ui.deckPage == .Stems : panel == .Mixer) { show(.Mixer) } }
|
||||
if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.deck : panel == .Mixer) { show(.Mixer) } }
|
||||
if !hidden.contains(.Speed) { SpeedMenu() }
|
||||
if !hidden.contains(.Route) { Button { if docked { withAnimation(.snappy) { ui.showDeck(.Eq) } } else { ui.showInSettings(.Eq) } } label: { routeLabel(c) }.buttonStyle(PressFade()).frame(maxWidth: .infinity) } else { Spacer() }
|
||||
if !hidden.contains(.Route) { Button { ui.showInSettings(.Eq) } label: { routeLabel(c) }.buttonStyle(PressFade()).frame(maxWidth: .infinity) } else { Spacer() }
|
||||
if !hidden.contains(.AirPlay) { AirPlayButton(tint: UIColor(c.label2), active: UIColor(c.accent)).frame(width: 40, height: 40) }
|
||||
if !hidden.contains(.Karaoke) { PanelToggle(symbol: "music.mic", on: pm.karaoke) { karaoke() } }
|
||||
}
|
||||
@@ -273,15 +268,6 @@ struct NowPlayingScreen: View {
|
||||
/// Karaoke: vocals down and lyrics up. If it's on but another panel is showing, brings the lyrics back first.
|
||||
private func karaoke() {
|
||||
let pm = g.playback
|
||||
// Docked, the lyrics get the deck's whole side of the hinge.
|
||||
if docked {
|
||||
withAnimation(.snappy(duration: 0.25)) {
|
||||
if pm.karaoke && !(ui.showsDeck && ui.deckPage == .Lyrics) { ui.showDeck(.Lyrics); return }
|
||||
pm.setKaraoke(!pm.karaoke)
|
||||
ui.showDeck(pm.karaoke ? .Lyrics : .Stems)
|
||||
}
|
||||
return
|
||||
}
|
||||
withAnimation(.spring(duration: 0.38, bounce: 0.12)) {
|
||||
if pm.karaoke && panel != .Lyrics { panel = .Lyrics; return }
|
||||
pm.setKaraoke(!pm.karaoke)
|
||||
@@ -291,8 +277,7 @@ struct NowPlayingScreen: View {
|
||||
|
||||
private func show(_ to: NpPanel) {
|
||||
// Docked, the stems and the queue have the other side of the hinge to themselves.
|
||||
// The queue lives only in the deck there, never a second copy beside it.
|
||||
if docked { if to == .Mixer { withAnimation(.snappy) { ui.showDeck(.Stems) } }; return }
|
||||
if docked && (to == .Mixer || to == .Queue) { withAnimation(.snappy) { ui.showDeck() }; return }
|
||||
withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = panel == to ? .Art : to }
|
||||
}
|
||||
|
||||
@@ -306,22 +291,19 @@ struct NowPlayingScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Drag down to close: from the grabber or song header, or anywhere in the top tenth of the screen.
|
||||
private func screenDrag(header: Bool = false) -> some Gesture {
|
||||
private var screenDrag: some Gesture {
|
||||
DragGesture(minimumDistance: 20)
|
||||
.onChanged { v in
|
||||
let dy = v.translation.height
|
||||
let top = header || v.startLocation.y < max(screenH * 0.1, 56)
|
||||
drop = !docked && top && dy > 0 && dy > abs(v.translation.width) ? dy : 0
|
||||
drop = !docked && dy > 0 && dy > abs(v.translation.width) ? dy : 0
|
||||
}
|
||||
.onEnded { v in
|
||||
let dy = v.translation.height
|
||||
let vertical = abs(dy) > abs(v.translation.width)
|
||||
let top = header || v.startLocation.y < max(screenH * 0.1, 56)
|
||||
if !docked && top && vertical && (dy > 120 || v.predictedEndTranslation.height > 300) { dismiss(); return }
|
||||
if !docked && vertical && (dy > 120 || v.predictedEndTranslation.height > 300) { dismiss(); return }
|
||||
withAnimation(.spring(duration: 0.3, bounce: 0.1)) { drop = 0 }
|
||||
// Never from the stems: a slightly upward fader drag or scroll there kept opening the queue.
|
||||
if !docked && vertical && dy < -50 && panel != .Mixer && g.settings.swipeUpQueue {
|
||||
if vertical && dy < -50 && panel != .Mixer && g.settings.swipeUpQueue {
|
||||
withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = .Queue }
|
||||
}
|
||||
}
|
||||
@@ -718,9 +700,8 @@ private struct MixerPanel: View {
|
||||
GeometryReader { geo in
|
||||
// Spread spare height across the stem rows instead of leaving it all at the bottom.
|
||||
let count = CGFloat(max(names.count, 1))
|
||||
// Rows shrink to fit every stem before anything has to scroll (the folded outer display is short).
|
||||
let rowH = roomy ? min(80, max(Self.roomyMin, (geo.size.height - Self.roomyChrome) / count))
|
||||
: min(62, max(Self.compactMin, (geo.size.height - Self.compactChrome) / count))
|
||||
let rowH = roomy ? min(80, max(Self.roomyRow, (geo.size.height - Self.roomyChrome) / count))
|
||||
: min(62, max(46, (geo.size.height - 64) / count))
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
if pm.source == .Original {
|
||||
@@ -730,13 +711,54 @@ private struct MixerPanel: View {
|
||||
.background(p.fill, in: RoundedRectangle(cornerRadius: 12, style: .continuous))
|
||||
.padding(.vertical, 8)
|
||||
} else {
|
||||
// One sliding row of chips, running out to the screen edges so none looks cut off mid-pane.
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: 8) { saveChips(pm); presetChips(pm, names) }.padding(.horizontal, 24)
|
||||
ScrollView(.horizontal, showsIndicators: false) {
|
||||
HStack(spacing: 8) {
|
||||
let current = MixPresets.normalized(pm.mix)
|
||||
let saved = pm.songMix.map(MixPresets.normalized)
|
||||
let isSaved = saved == current
|
||||
PresetChip(text: isSaved ? "Saved" : "Save", icon: isSaved ? "bookmark.fill" : "bookmark", selected: isSaved) {
|
||||
if isSaved {
|
||||
pm.forgetSongMix()
|
||||
ui.overlays.hud("Removed this song's mix", "bookmark.slash")
|
||||
} else {
|
||||
pm.saveSongMix()
|
||||
ui.overlays.hud("Mix saved for this song", "bookmark.fill")
|
||||
}
|
||||
}
|
||||
if let saved, !isSaved {
|
||||
PresetChip(text: "This Song", selected: false) { pm.applyMix(saved) }
|
||||
}
|
||||
PresetChip(text: "New Preset", icon: "plus", selected: false) {
|
||||
ui.overlays.prompt("Save Preset", "Saves this mix for every song.", "Save", placeholder: "Preset name") { name in
|
||||
let n = name.trimmingCharacters(in: .whitespaces)
|
||||
guard !n.isEmpty else { return }
|
||||
CustomPreset.add(n, pm.mix)
|
||||
ui.overlays.hud("Preset saved", "slider.horizontal.3")
|
||||
}
|
||||
}
|
||||
let s = g.settings
|
||||
ForEach(MixPresets.bar(s)) { preset in
|
||||
if let target = preset.build(names) {
|
||||
let on = MixPresets.normalized(target) == current
|
||||
let locked = s.lockedPreset == preset.id
|
||||
// Tapping the mix that's on goes back to the full song.
|
||||
PresetChip(text: preset.label, icon: locked ? "lock.fill" : nil, selected: on) { pm.applyMix(on ? [:] : target) }
|
||||
.contextMenu {
|
||||
if locked {
|
||||
Button("Unlock", systemImage: "lock.open") { s.lockedPreset = "" }
|
||||
} else {
|
||||
Button("Lock for All Songs", systemImage: "lock") { s.lockedPreset = preset.id; pm.applyMix(target) }
|
||||
}
|
||||
Button("Edit Stems", systemImage: "slider.horizontal.3") { ui.showInSettings(.StemEditor) }
|
||||
if preset.custom {
|
||||
Button("Delete Preset", systemImage: "trash", role: .destructive) { CustomPreset.remove(preset.label) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding(.vertical, 8)
|
||||
}
|
||||
.scrollIndicators(.hidden)
|
||||
.padding(.horizontal, -24)
|
||||
.padding(.vertical, 8)
|
||||
}
|
||||
// The meters' fall is timed, so 30 fps looks the same and costs a quarter of 120.
|
||||
TimelineView(.animation(minimumInterval: 1 / 30, paused: !stems || !pm.playWhenReady)) { _ in
|
||||
@@ -747,7 +769,7 @@ private struct MixerPanel: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(minLength: 8)
|
||||
Spacer(minLength: roomy ? 8 : 16)
|
||||
}
|
||||
.padding(.horizontal, 24)
|
||||
}
|
||||
@@ -759,66 +781,9 @@ private struct MixerPanel: View {
|
||||
}
|
||||
|
||||
extension MixerPanel {
|
||||
@ViewBuilder func saveChips(_ pm: PlaybackManager) -> some View {
|
||||
let current = MixPresets.normalized(pm.mix)
|
||||
let saved = pm.songMix.map(MixPresets.normalized)
|
||||
let isSaved = saved == current
|
||||
PresetChip(text: isSaved ? "Saved" : "Save", icon: isSaved ? "bookmark.fill" : "bookmark", selected: isSaved) {
|
||||
if isSaved {
|
||||
pm.forgetSongMix()
|
||||
ui.overlays.hud("Removed this song's mix", "bookmark.slash")
|
||||
} else {
|
||||
pm.saveSongMix()
|
||||
ui.overlays.hud("Mix saved for this song", "bookmark.fill")
|
||||
}
|
||||
}
|
||||
if let saved, !isSaved {
|
||||
PresetChip(text: "This Song", selected: false) { pm.applyMix(saved) }
|
||||
}
|
||||
}
|
||||
|
||||
private func newPreset(_ pm: PlaybackManager) {
|
||||
ui.overlays.prompt("Save Preset", "Saves this mix for every song.", "Save", placeholder: "Preset name") { name in
|
||||
let n = name.trimmingCharacters(in: .whitespaces)
|
||||
guard !n.isEmpty else { return }
|
||||
CustomPreset.add(n, pm.mix)
|
||||
ui.overlays.hud("Preset saved", "slider.horizontal.3")
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder func presetChips(_ pm: PlaybackManager, _ names: [String]) -> some View {
|
||||
let current = MixPresets.normalized(pm.mix)
|
||||
PresetChip(text: "New Preset", icon: "plus", selected: false) { newPreset(pm) }
|
||||
let s = g.settings
|
||||
ForEach(MixPresets.bar(s)) { preset in
|
||||
if let target = preset.build(names) {
|
||||
let on = MixPresets.normalized(target) == current
|
||||
let locked = s.lockedPreset == preset.id
|
||||
// Tapping the mix that's on goes back to the full song.
|
||||
PresetChip(text: preset.label, icon: locked ? "lock.fill" : nil, selected: on) { pm.applyMix(on ? [:] : target) }
|
||||
.contextMenu {
|
||||
if locked {
|
||||
Button("Unlock", systemImage: "lock.open") { s.lockedPreset = "" }
|
||||
} else {
|
||||
Button("Lock for All Songs", systemImage: "lock") { s.lockedPreset = preset.id; pm.applyMix(target) }
|
||||
}
|
||||
Button("Edit Stems", systemImage: "slider.horizontal.3") { ui.showInSettings(.StemEditor) }
|
||||
if preset.custom {
|
||||
Button("Delete Preset", systemImage: "trash", role: .destructive) { CustomPreset.remove(preset.label) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static let roomyRow: CGFloat = 66
|
||||
/// Shortest stacked row: name line, fader and the gap under it.
|
||||
static let roomyMin: CGFloat = 60
|
||||
/// Shortest side-by-side row, the fader's own height.
|
||||
static let compactMin: CGFloat = 36
|
||||
/// Preset chips plus the bottom gap.
|
||||
static let roomyChrome: CGFloat = 56
|
||||
static let compactChrome: CGFloat = 56
|
||||
/// Height that shows the presets and every stem without scrolling, roomy rows.
|
||||
static func roomyHeight(_ stems: Int) -> CGFloat { roomyChrome + CGFloat(stems) * roomyRow }
|
||||
}
|
||||
@@ -858,7 +823,7 @@ private struct StemFader: View {
|
||||
var body: some View {
|
||||
let color = Color(hex: Stems.color(name))
|
||||
FaderRow(dot: setting.muted ? p.label3 : color, label: Stems.label(name), percent: Int(stemTaper(setting.level) * 100), dim: setting.muted, height: height, stacked: roomy) {
|
||||
// Live level, -48..0 dBFS, drawn bright over the dimmed fill.
|
||||
// Live level, -48..0 dBFS, drawn as a light band inside the fader's fill.
|
||||
let f = CGFloat(min(1, max(0, (20 * log10(level + 1e-5) + 48) / 48)))
|
||||
FaderSlider(value: setting.level, fill: setting.muted ? p.label3 : color, detent: StemSetting.unity, enabled: enabled, thumb: roomy ? 26 : 24, meter: enabled && !setting.muted ? f : nil) {
|
||||
pm.setStemLevel(name, $0)
|
||||
@@ -947,7 +912,7 @@ struct FaderSlider: View {
|
||||
var detent: Float?
|
||||
var enabled = true
|
||||
var thumb: CGFloat = 24
|
||||
/// 0...1 live level, shown in the full fill colour over the dimmed filled part of the track.
|
||||
/// 0...1 live level, shown as a lighter band over the filled part of the track.
|
||||
var meter: CGFloat?
|
||||
let onChange: (Float) -> Void
|
||||
|
||||
@@ -959,7 +924,7 @@ struct FaderSlider: View {
|
||||
self.value = value; self.fill = fill; self.detent = detent; self.enabled = enabled; self.thumb = thumb; self.meter = meter; self.onChange = onChange
|
||||
}
|
||||
|
||||
private var bar: CGFloat { meter == nil ? (thumb >= 26 ? 5 : 4) : 8 }
|
||||
private var bar: CGFloat { meter == nil ? (thumb >= 26 ? 5 : 4) : 6 }
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geo in
|
||||
@@ -967,12 +932,9 @@ struct FaderSlider: View {
|
||||
let x = CGFloat(min(max(value, 0), 1)) * track
|
||||
ZStack(alignment: .leading) {
|
||||
Capsule().fill(p.fillStrong).frame(height: bar).padding(.horizontal, thumb / 2)
|
||||
// With a meter the set level is a dim band of the stem's colour and the live level
|
||||
// runs over it in the full colour, so the two never blend.
|
||||
Capsule().fill(meter == nil ? fill : fill.opacity(0.32)).frame(width: x + thumb / 2, height: bar).padding(.leading, thumb / 2 - 0.01)
|
||||
Capsule().fill(fill).frame(width: x + thumb / 2, height: bar).padding(.leading, thumb / 2 - 0.01)
|
||||
if let meter, meter > 0.01 {
|
||||
Capsule().fill(fill).frame(width: meter * (x + thumb / 2), height: bar)
|
||||
.shadow(color: fill.opacity(0.6), radius: 3)
|
||||
Capsule().fill(.white.opacity(0.5)).frame(width: meter * (x + thumb / 2), height: bar)
|
||||
.padding(.leading, thumb / 2 - 0.01)
|
||||
.animation(.linear(duration: 1 / 30), value: meter)
|
||||
}
|
||||
@@ -1005,92 +967,48 @@ struct FaderSlider: View {
|
||||
|
||||
// ---- deck -----------------------------------------------------------------------------------
|
||||
|
||||
/// Unfolded iPhone Duo: the Now Playing tab's side of the hinge, across from docked Now Playing.
|
||||
/// One page at a time (stems, lyrics, the queue or the EQ), each with the whole pane to itself.
|
||||
/// Unfolded iPhone Duo: the stems over the queue, on the other side of the hinge from Now Playing.
|
||||
struct NowPlayingDeck: View {
|
||||
@Environment(Ui.self) private var ui
|
||||
@Environment(\.palette) private var base
|
||||
@AppStorage("duoSwap") private var swap = false
|
||||
@State private var tint: Color?
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
let c = tint.map { base.tinted($0) } ?? base
|
||||
let track = g.playback.current?.track
|
||||
GeometryReader { _ in
|
||||
if let track {
|
||||
GeometryReader { geo in
|
||||
if track != nil {
|
||||
VStack(spacing: 0) {
|
||||
header(c)
|
||||
Group {
|
||||
switch ui.deckPage {
|
||||
case .Stems: MixerPanel(roomy: true)
|
||||
case .Lyrics: LyricsPanel(track: track)
|
||||
case .Queue: QueuePanel(title: false)
|
||||
case .Eq: DeckEqPanel()
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
|
||||
.transition(.opacity)
|
||||
Text("Stems").font(.headline).foregroundStyle(c.label)
|
||||
.frame(maxWidth: .infinity, alignment: .leading).padding(.horizontal, 24)
|
||||
// As much as the stems need to show without scrolling, leaving the queue a few rows.
|
||||
MixerPanel(roomy: true).frame(height: min(MixerPanel.roomyHeight(max(g.playback.stemNames.count, 4)), geo.size.height * 0.72))
|
||||
Rectangle().fill(c.label3.opacity(0.35)).frame(height: 0.5).padding(.horizontal, 24).padding(.bottom, 8)
|
||||
QueuePanel()
|
||||
}
|
||||
} else {
|
||||
Text("Nothing Playing").font(.title3.weight(.semibold)).foregroundStyle(c.label2)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
.padding(.top, 8)
|
||||
.padding(.top, 12)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(c.bg.ignoresSafeArea())
|
||||
.environment(\.palette, c)
|
||||
.modifier(NpScheme(dark: c.dark, docked: true))
|
||||
.tint(c.label)
|
||||
.animation(.easeInOut(duration: 0.3), value: tint)
|
||||
.animation(.snappy(duration: 0.25), value: ui.deckPage)
|
||||
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
|
||||
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
|
||||
tint = await albumColor(thumb, dark: base.dark)
|
||||
}
|
||||
}
|
||||
|
||||
/// The page names, and the button that moves Now Playing to the other side of the hinge.
|
||||
private func header(_ c: Palette) -> some View {
|
||||
HStack(spacing: 18) {
|
||||
ViewThatFits(in: .horizontal) {
|
||||
pages(c, spacing: 22)
|
||||
pages(c, spacing: 14)
|
||||
ScrollView(.horizontal) { pages(c, spacing: 18) }.scrollIndicators(.hidden)
|
||||
}
|
||||
Spacer(minLength: 0)
|
||||
Button { withAnimation(.spring(duration: 0.4, bounce: 0.1)) { swap.toggle() } } label: {
|
||||
Image(systemName: "arrow.left.arrow.right").font(.body.weight(.semibold)).foregroundStyle(c.label2)
|
||||
.frame(width: 40, height: 32).contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(PressFade())
|
||||
.accessibilityLabel("Swap Sides")
|
||||
}
|
||||
.padding(.horizontal, 24).frame(height: 36)
|
||||
}
|
||||
|
||||
private func pages(_ c: Palette, spacing: CGFloat) -> some View {
|
||||
HStack(spacing: spacing) {
|
||||
ForEach(DeckPage.allCases, id: \.self) { pg in
|
||||
let on = ui.deckPage == pg
|
||||
Button { withAnimation(.snappy(duration: 0.25)) { ui.showDeck(pg) } } label: {
|
||||
Text(pg.title).font(.headline).foregroundStyle(on ? c.label : c.label3)
|
||||
.lineLimit(1).fixedSize().frame(minHeight: 36).contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityAddTraits(on ? .isSelected : [])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- queue ----------------------------------------------------------------------------------
|
||||
|
||||
private struct QueuePanel: View {
|
||||
var close: () -> Void = {}
|
||||
/// The deck's header already says "Playing Next", so there it shows just the count.
|
||||
var title = true
|
||||
@Environment(\.palette) private var p
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
@@ -1101,8 +1019,8 @@ private struct QueuePanel: View {
|
||||
VStack(spacing: 0) {
|
||||
HStack(spacing: 8) {
|
||||
VStack(alignment: .leading, spacing: 1) {
|
||||
if title { Text("Playing Next").font(.headline).foregroundStyle(p.label) }
|
||||
Text(songs(upcoming.count)).font(title ? .footnote : .subheadline).foregroundStyle(p.label2)
|
||||
Text("Playing Next").font(.headline).foregroundStyle(p.label)
|
||||
Text(songs(upcoming.count)).font(.footnote).foregroundStyle(p.label2)
|
||||
}
|
||||
Spacer()
|
||||
QueueToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle)
|
||||
|
||||
+1
-4
@@ -9,13 +9,11 @@ settings:
|
||||
# iOS needs a plain number for the bundle version; the label is what the app and releases show.
|
||||
MARKETING_VERSION: "0.9.0"
|
||||
VERSION_LABEL: "0.9.0"
|
||||
CURRENT_PROJECT_VERSION: "27"
|
||||
CURRENT_PROJECT_VERSION: "24"
|
||||
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
|
||||
APP_ID: org.cdnutter.stemify
|
||||
APP_NAME: Stemify
|
||||
APP_ICON: AppIcon
|
||||
# Info key StemifyChannel: "dev" on dev builds (build-ipa.sh dev).
|
||||
STEMIFY_CHANNEL: release
|
||||
targets:
|
||||
Stemify:
|
||||
type: application
|
||||
@@ -43,7 +41,6 @@ targets:
|
||||
CFBundleShortVersionString: $(MARKETING_VERSION)
|
||||
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
|
||||
StemifyVersionLabel: $(VERSION_LABEL)
|
||||
StemifyChannel: $(STEMIFY_CHANNEL)
|
||||
UILaunchScreen: {}
|
||||
UIBackgroundModes: [audio, fetch]
|
||||
UISupportedInterfaceOrientations: [UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Builds one Stemify IPA on a Mac. ios/scripts/build-remote.sh runs this on WHITE-M1 from DevOps.
|
||||
# build-ipa.sh release build/release/stemify-<v>.ipa org.cdnutter.stemify-pub, ad-hoc signed. Gitea releases (main) + Sideload.
|
||||
# build-ipa.sh dev build/dev/stemify-<v>-dev.ipa org.cdnutter.stemify-dev, ribbon icon, DEV BUILD banner.
|
||||
# build-ipa.sh dev build/dev/stemify-<v>-dev.ipa org.cdnutter.stemify-dev, ribbon icon.
|
||||
# Gitea pre-releases (dev branch) + Sideload Developer.
|
||||
# build-ipa.sh prov build/prov/stemify-<v>-prov.ipa org.cdnutter.stemify, signed with the
|
||||
# personal profile (CarPlay, Siri). Never published anywhere.
|
||||
@@ -20,13 +20,6 @@ case $MODE in
|
||||
*) echo "usage: $0 release|dev|prov" >&2; exit 1 ;;
|
||||
esac
|
||||
DD=$B/dd-$MODE
|
||||
# Dev builds are marked as such (Info key StemifyChannel) and put the build number in the
|
||||
# version string (1.0 -> 1.0.26), so SideStore sees every dev upload as an update.
|
||||
CHANNEL=$([ "$MODE" = dev ] && echo dev || echo release)
|
||||
MV=$(sed -nE 's/^ *MARKETING_VERSION: "(.*)"/\1/p' project.yml)
|
||||
BN=$(sed -nE 's/^ *CURRENT_PROJECT_VERSION: "(.*)"/\1/p' project.yml)
|
||||
# iOS allows at most three numbers, so dev keeps major.minor and puts the build last (0.9.0 build 27 -> 0.9.27).
|
||||
[ "$MODE" = dev ] && MV=$(echo "$MV" | cut -d. -f1-2).$BN
|
||||
# "0.9.0" -> 0.9.0, "1.0 RC 1" -> 1.0-rc1, used in file names and release tags.
|
||||
VERSION=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml | tr 'A-Z' 'a-z' | sed -E 's/ (rc|beta) /-\1/; s/ /-/g')
|
||||
IPA=$B/$MODE/stemify-$VERSION$SUFFIX.ipa
|
||||
@@ -42,7 +35,7 @@ rm -rf $OUT && mkdir -p $OUT/Payload $B/$MODE
|
||||
# xcodebuild compiles the app, the widget extension, the asset catalog and the App Intents metadata.
|
||||
xcodegen generate -q
|
||||
xcodebuild -project Stemify.xcodeproj -scheme Stemify -configuration Release -sdk iphoneos \
|
||||
-destination generic/platform=iOS -derivedDataPath $DD APP_ID=$APP_ID APP_NAME="$APP_NAME" APP_ICON=$APP_ICON STEMIFY_CHANNEL=$CHANNEL MARKETING_VERSION=$MV CODE_SIGNING_ALLOWED=NO -quiet build
|
||||
-destination generic/platform=iOS -derivedDataPath $DD APP_ID=$APP_ID APP_NAME="$APP_NAME" APP_ICON=$APP_ICON CODE_SIGNING_ALLOWED=NO -quiet build
|
||||
cp -R $DD/Build/Products/Release-iphoneos/Stemify.app $APP
|
||||
[ -d $EXT ] || { echo "widget extension missing" >&2; exit 1; }
|
||||
|
||||
|
||||
+1
-202
@@ -14,208 +14,7 @@
|
||||
"iconURL": "https://git.iamchrisama.com/cdnutter/stemify/raw/branch/main/ios/Stemify/Resources/Assets.xcassets/AppIcon.appiconset/icon.png",
|
||||
"tintColor": "#FA2D48",
|
||||
"category": "entertainment",
|
||||
"versions": [
|
||||
{
|
||||
"version": "1.0",
|
||||
"marketingVersion": "1.0 RC 4",
|
||||
"buildVersion": "24",
|
||||
"date": "2026-11-18T13:39:57-08:00",
|
||||
"localizedDescription": "Duo layout fixes for every fold and orientation",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc4/stemify-1.0-rc4.ipa",
|
||||
"size": 2650316,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0",
|
||||
"marketingVersion": "1.0 RC 3",
|
||||
"buildVersion": "23",
|
||||
"date": "2026-11-09T08:01:30-08:00",
|
||||
"localizedDescription": "iPhone Duo: unfolded, the library sits on one side of the hinge and Now Playing stays docked on the other (no mini player while split). Folded and other iPhones are unchanged. Unsigned IPA for Sideloadly, AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc3/stemify-1.0-rc3.ipa",
|
||||
"size": 2596161,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0",
|
||||
"marketingVersion": "1.0 RC 2",
|
||||
"buildVersion": "22",
|
||||
"date": "2026-11-06T08:55:28-08:00",
|
||||
"localizedDescription": "Plain Plex songs play when Remote Access has an upload speed limit (no more 500s). Shuffle buttons work and top up as you go. Random Album Radio works like Plexamp: a shuffled album list played album by album, in track order. Recently Added has See All with the full list. Stem playlist covers can come from Photos. Crossfade (Off or 1-12 s, Settings > Listening) with Sweet Fades for same-album songs. Update Download on downloaded playlists, albums and artists, plus Update All Downloads. Unsigned IPA for Sideloadly, AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc2/stemify-1.0-rc2.ipa",
|
||||
"size": 2579022,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.16",
|
||||
"marketingVersion": "1.0.16",
|
||||
"buildVersion": "17",
|
||||
"date": "2026-10-20T14:39:00-07:00",
|
||||
"localizedDescription": "More room between the seek bar and the time / codec row on Now Playing.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.16/stemify-1.0.16.ipa",
|
||||
"size": 1626423,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.15",
|
||||
"marketingVersion": "1.0.15",
|
||||
"buildVersion": "16",
|
||||
"date": "2026-10-20T14:22:36-07:00",
|
||||
"localizedDescription": "Mixer faders use the spare height on Now Playing, with more room above the seek bar. Unsigned IPA for Sideloadly, AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.15/stemify-1.0.15.ipa",
|
||||
"size": 1626425,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.14",
|
||||
"marketingVersion": "1.0.14",
|
||||
"buildVersion": "15",
|
||||
"date": "2026-10-20T14:14:26-07:00",
|
||||
"localizedDescription": "Reorderable tab bar (Songs, Albums, Artists, Genres, Playlists, Search, Downloads), AirPlay route picker in Now Playing, debug logging with log export in Settings, more room above the seeker. Unsigned IPA.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.14/stemify-1.0.14.ipa",
|
||||
"size": 1625201,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.13",
|
||||
"marketingVersion": "1.0.13",
|
||||
"buildVersion": "14",
|
||||
"date": "2026-10-20T13:42:31-07:00",
|
||||
"localizedDescription": "- Export and import of stem playlists and sound settings (Settings > Backup)\n- Mixer: one-line faders, every stem fits without scrolling\n- Wide and landscape now-playing layout for iPhone Duo\n\nUnsigned IPA: re-sign with Sideloadly or AltStore.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.13/stemify-1.0.13.ipa",
|
||||
"size": 1559179,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.12",
|
||||
"marketingVersion": "1.0.12",
|
||||
"buildVersion": "13",
|
||||
"date": "2026-10-20T13:29:05-07:00",
|
||||
"localizedDescription": "More space between the seek bar and the transport buttons on Now Playing. Unsigned IPA: re-sign with Sideloadly, AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.12/stemify-1.0.12.ipa",
|
||||
"size": 1529939,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.11",
|
||||
"marketingVersion": "1.0.11",
|
||||
"buildVersion": "12",
|
||||
"date": "2026-10-20T12:24:42-07:00",
|
||||
"localizedDescription": "Tapping the lock screen / Control Center player opens the app again.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.11/stemify-1.0.11.ipa",
|
||||
"size": 1529241,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.10",
|
||||
"marketingVersion": "1.0.10",
|
||||
"buildVersion": "11",
|
||||
"date": "2026-10-20T11:21:34-07:00",
|
||||
"localizedDescription": "Shuffle and repeat (list and song) on Now Playing. Playback speed from 0.5x to 2x, pitch kept.\n\nUnsigned IPA, not tested on device.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.10/stemify-1.0.10.ipa",
|
||||
"size": 1529239,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.9",
|
||||
"marketingVersion": "1.0.9",
|
||||
"buildVersion": "10",
|
||||
"date": "2026-10-20T10:28:26-07:00",
|
||||
"localizedDescription": "- Add to Playlist is now one sheet instead of a string of pop-ups: Plex and Stem tabs, type a new playlist name right in the list, playlist art, and mix chips for stem playlists.\n- Song menus have a single \"Add to Playlist\u2026\" entry for both kinds; the sheet remembers which tab you used last.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.9/stemify-1.0.9.ipa",
|
||||
"size": 1518270,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.8",
|
||||
"marketingVersion": "1.0.8",
|
||||
"buildVersion": "9",
|
||||
"date": "2026-10-20T10:02:44-07:00",
|
||||
"localizedDescription": "- Playlists tab now has Plex and Stem sections. Plex playlists are unchanged and use their custom Plex poster when there is one.\n- Stem playlists: each song keeps its own mix (instrumental, a cappella, no drums, custom...). Add songs from any menu, or copy a Plex playlist over in one go. Change one song's mix or the whole list's.\n- Softness slider under the Vocals picker in the lyrics view when vocals are set to Soft.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.8/stemify-1.0.8.ipa",
|
||||
"size": 1462423,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.7",
|
||||
"marketingVersion": "1.0.7",
|
||||
"buildVersion": "8",
|
||||
"date": "2026-10-20T09:39:03-07:00",
|
||||
"localizedDescription": "- Mini player now sits in the tab bar's Liquid Glass accessory on iOS 26.1 and later, like Music. The tab bar shrinks when you scroll down and the player collapses to title and play/pause. Older iOS keeps the floating card.\n- Settings > Sound > Karaoke Soft Vocals: set how quiet Soft vocals are (-30 to -3 dB, default -12).\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.7/stemify-1.0.7.ipa",
|
||||
"size": 1390623,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.6",
|
||||
"marketingVersion": "1.0.6",
|
||||
"buildVersion": "7",
|
||||
"date": "2026-10-20T09:31:01-07:00",
|
||||
"localizedDescription": "- Karaoke vocals option on the lyrics panel: On (full vocals), Soft (vocals about 12 dB down as a guide), Off (no vocals). Remembered between songs and launches.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.6/stemify-1.0.6.ipa",
|
||||
"size": 1375443,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.5",
|
||||
"marketingVersion": "1.0.5",
|
||||
"buildVersion": "6",
|
||||
"date": "2026-10-20T09:23:39-07:00",
|
||||
"localizedDescription": "- Sort menu on Artists, Albums, Songs and Playlists (Name, Date Added, Last Played, Plays, Rating, Year, Duration and more). Tap the current field again to flip direction (A to Z / Z to A, newest / oldest).\n- Each screen remembers its sort.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.5/stemify-1.0.5.ipa",
|
||||
"size": 1370686,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.4",
|
||||
"marketingVersion": "1.0.4",
|
||||
"buildVersion": "5",
|
||||
"date": "2026-10-20T09:18:33-07:00",
|
||||
"localizedDescription": "Save a stem mix for a song (Save chip in the mixer); it comes back every time that song plays. New mic button for karaoke mode: vocals muted on every song plus synced lyrics from LRCLIB, tap a line to jump to it.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.4/stemify-1.0.4.ipa",
|
||||
"size": 1355610,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.3",
|
||||
"marketingVersion": "1.0.3",
|
||||
"buildVersion": "4",
|
||||
"date": "2026-10-20T09:08:18-07:00",
|
||||
"localizedDescription": "Bundle ID is now org.cdnutter.stemify (delete the old app first; settings won't carry over). IPA is named stemify-<version>.ipa. Adds an AltStore/SideStore/Feather source.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.3/stemify-1.0.3.ipa",
|
||||
"size": 1319672,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.2",
|
||||
"marketingVersion": "1.0.2",
|
||||
"buildVersion": "1.0.2",
|
||||
"date": "2026-10-20T08:53:24-07:00",
|
||||
"localizedDescription": "Unsigned, iOS 17 or newer. Sideload `Stemify.ipa` with Sideloadly or AltStore.\n\n- Shuffle on the Songs screen now picks from the whole library instead of only the songs loaded so far (the A's and B's)\n\nIncludes everything in 1.0.1. CarPlay and Siri still need entitlements a free Apple ID can't sign.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.2/stemify-1.0.2.ipa",
|
||||
"size": 1319672,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0.1",
|
||||
"marketingVersion": "1.0.1",
|
||||
"buildVersion": "1.0.1",
|
||||
"date": "2026-10-20T08:50:56-07:00",
|
||||
"localizedDescription": "Unsigned, iOS 17 or newer. Sideload `Stemify.ipa` with Sideloadly or AltStore.\n\n- The mini player no longer covers the bottom of lists, and it is now a solid card that matches the app instead of system glass\n- More room between the title and the scrubber on Now Playing\n- The play button no longer spins forever after you change tracks\n- The stems and queue buttons now animate their panels in and out\n- Springier button presses and play/pause transitions\n\nCarPlay and Siri still need entitlements a free Apple ID can't sign.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.1/stemify-1.0.1.ipa",
|
||||
"size": 1317680,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "1.0",
|
||||
"marketingVersion": "1.0",
|
||||
"buildVersion": "1.0",
|
||||
"date": "2026-10-20T07:16:41-07:00",
|
||||
"localizedDescription": "First iOS build. Unsigned, iOS 17 or newer.\n\nSideload `Stemify.ipa` with Sideloadly or AltStore, which sign it with your Apple ID.\n\nCarPlay and Siri need entitlements a free Apple ID can't sign, so on a free sideload they won't show up. Everything on the phone works. Not yet tested on a device.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0/stemify-1.0.ipa",
|
||||
"size": 1305649,
|
||||
"minOSVersion": "17.0"
|
||||
}
|
||||
],
|
||||
"versions": [],
|
||||
"appPermissions": {
|
||||
"entitlements": [
|
||||
"com.apple.developer.carplay-audio",
|
||||
|
||||
Reference in new issue
Block a user