Compare commits

...
8 Commits
Author SHA1 Message Date
rootandClaude Opus 5.5 bc30b43eb1 iOS Duo: system tab bar instead of the rail, lyrics in the deck, stems fit, DEV banner
Split panes live inside each tab so the system's vertical bar is never covered.
Docked Now Playing no longer opens its own queue; the deck's queue scrolls under the stems.
Meters run full colour over a dimmed fill. Folded mixer rows shrink to fit every stem,
preset chips fall back to a menu instead of being cut off. Dev builds show DEV BUILD <n>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:11:22 -08:00
root aa7cfe6c67 Merge branch 'main' into dev
# Conflicts:
#	ios/scripts/publish.sh
2026-11-18 14:08:44 -08:00
root b0d0860ca7 iOS source.json for ios-v1.0-rc4 2026-11-18 13:39:57 -08:00
rootandClaude Opus 5.5 f1d69bb9d5 iOS publish: release uploads to the personal source
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 13:38:38 -08:00
rootandClaude Opus 5.5 2d7ee03626 iOS: Duo layout fixes for every fold and orientation
- Split panes get portrait-phone traits (regular height, compact width), so unfolded
  landscape no longer stacks nav bar buttons down the pane's trailing edge, eating
  its width and sliding under the rail when swapped.
- Wide Now Playing column never drops below what the transport needs; the transport
  shrinks when narrow instead of spilling onto the art and under the rail
  (landscape folded, portrait unfolded).
- Stacked Now Playing controls match the art's width.
- Docked wide art gets a smaller inset so it fills more of the pane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 13:36:11 -08:00
rootandClaude Opus 5.5 02f8452be2 publish.sh: dev uploads go to the main admin with ?source=developer (dev-admin :8097 is gone)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 15:24:53 -08:00
rootandClaude Opus 5.5 567e557968 iOS: show stem level inside the fader track
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 17:30:45 -08:00
rootandClaude Opus 5.5 ae5eead73b iOS: drop Master fader, roomier static Duo stem rows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:36:52 -08:00
7 changed files with 308 additions and 202 deletions

No files matched your search

+7 -2
View File
@@ -1,4 +1,5 @@
import SwiftUI import SwiftUI
import UIKit
enum Tab: String, CaseIterable, Hashable { enum Tab: String, CaseIterable, Hashable {
case Library, Songs, Albums, Artists, Genres, Playlists, Search, Downloads, Settings case Library, Songs, Albums, Artists, Genres, Playlists, Search, Downloads, Settings
@@ -55,6 +56,8 @@ final class Ui {
private(set) var split = false private(set) var split = false
/// Split only: the side opposite Now Playing shows the stems and queue (true) or the selected tab. /// Split only: the side opposite Now Playing shows the stems and queue (true) or the selected tab.
var deck = true var deck = true
/// Split only: the deck shows the lyrics (karaoke) instead of the stems and queue.
var deckLyrics = false
let overlays: Overlays let overlays: Overlays
init(overlays: Overlays) { self.overlays = overlays } init(overlays: Overlays) { self.overlays = overlays }
@@ -92,8 +95,8 @@ final class Ui {
/// Docked Now Playing is already on screen, so there's nothing to open while split. /// Docked Now Playing is already on screen, so there's nothing to open while split.
func openNowPlaying() { if !split { nowPlayingOpen = true } } func openNowPlaying() { if !split { nowPlayingOpen = true } }
/// Split only: brings the stems and queue back beside Now Playing. /// Split only: brings the stems and queue (or the lyrics) back beside Now Playing.
func showDeck() { deck = true } func showDeck(lyrics: Bool = false) { deck = true; deckLyrics = lyrics }
func setSplit(_ on: Bool) { func setSplit(_ on: Bool) {
guard on != split else { return } guard on != split else { return }
@@ -103,6 +106,8 @@ final class Ui {
// Only an iPhone Duo ever splits, so from here on folded Now Playing uses its tighter layout. // Only an iPhone Duo ever splits, so from here on folded Now Playing uses its tighter layout.
UserDefaults.standard.set(true, forKey: "duoSeen") UserDefaults.standard.set(true, forKey: "duoSeen")
} }
// Karaoke left on shows its lyrics in the deck.
deckLyrics = on && AppGraph.shared.playback.karaoke
} }
/// Switches to the Library tab and pushes [r] there. /// Switches to the Library tab and pushes [r] there.
+64 -84
View File
@@ -2,41 +2,35 @@ import SwiftUI
import UIKit import UIKit
/// The tab bar, a navigation stack per tab, the mini player and the Now Playing sheet. /// The tab bar, a navigation stack per tab, the mini player and the Now Playing sheet.
/// On an unfolded iPhone Duo Now Playing takes one side of the hinge, the stems and queue (or a tab) /// On an unfolded iPhone Duo each tab splits at the hinge: Now Playing docks on one side, the tab
/// the other, and the tabs move to a rail on the right edge beside the status bar. /// (or the stems, queue and lyrics deck) on the other, and the tabs stay in the system's own bar.
struct RootView: View { struct RootView: View {
@State private var ui = Ui(overlays: Overlays()) @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 } private var g: AppGraph { .shared }
var body: some View { var body: some View {
let s = g.settings let s = g.settings
let p = Palette.of(s.theme, s.accent) let p = Palette.of(s.theme, s.accent)
DuoSplit(swap: duoSwap, showDeck: ui.deck, onSplit: { ui.setSplit($0) }) {
TabView(selection: Binding(get: { ui.tab }, set: { ui.selectTab($0) })) { TabView(selection: Binding(get: { ui.tab }, set: { ui.selectTab($0) })) {
ForEach(Tab.layout(s.tabLayout), id: \.self) { t in ForEach(Tab.layout(s.tabLayout), id: \.self) { t in
NavigationStack(path: ui.path(t)) { DuoPane {
root(t).miniPlayerRoom() NavigationStack(path: ui.path(t)) {
.navigationDestination(for: Route.self) { destination($0).miniPlayerRoom() } root(t).miniPlayerRoom()
.navigationDestination(for: Route.self) { destination($0).miniPlayerRoom() }
}
.modifier(FloatingMiniPlayer())
} }
.modifier(FloatingMiniPlayer())
.tabItem { Label(t.rawValue, systemImage: t.icon) } .tabItem { Label(t.rawValue, systemImage: t.icon) }
.tag(t) .tag(t)
} }
} }
.modifier(GlassMiniPlayerHost()) .modifier(GlassMiniPlayerHost())
} deck: {
NowPlayingDeck()
} docked: {
NowPlayingScreen(docked: true)
} rail: {
DuoRail(swap: $duoSwap)
}
.background(p.bg.ignoresSafeArea()) .background(p.bg.ignoresSafeArea())
.devBanner()
.onChange(of: s.tabLayout) { _, _ in ui.ensureValidTab() } .onChange(of: s.tabLayout) { _, _ in ui.ensureValidTab() }
.fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) { .fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) {
NowPlayingScreen() NowPlayingScreen()
.devBanner()
.overlayHost(ui.overlays, level: 1) .overlayHost(ui.overlays, level: 1)
.environment(ui) .environment(ui)
.environment(\.palette, p) .environment(\.palette, p)
@@ -142,8 +136,20 @@ private struct MiniPlayerRoom: ViewModifier {
content.safeAreaInset(edge: .bottom, spacing: 0) { content.safeAreaInset(edge: .bottom, spacing: 0) {
if !glassAccessory && !ui.split && g.playback.current != nil { Color.clear.frame(height: 66) } if !glassAccessory && !ui.split && g.playback.current != nil { Color.clear.frame(height: 66) }
} }
// Split, the rail stands in for the tab bar. .modifier(PaneToolbar())
.toolbar(ui.split ? .hidden : .automatic, for: .tabBar) }
}
/// 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
}
} }
} }
@@ -151,56 +157,44 @@ private extension View {
func miniPlayerRoom() -> some View { modifier(MiniPlayerRoom()) } func miniPlayerRoom() -> some View { modifier(MiniPlayerRoom()) }
} }
/// Splits the screen at the iPhone Duo's hinge (the system's division region). [library] (with /// One tab's content, split at the iPhone Duo's hinge (the system's division region): the tab
/// [deck] over it while [showDeck]) goes on one side and [docked] on the other, left and right /// (with the deck over it while it's showing) on one side, docked Now Playing on the other, left
/// trading places with [swap]; [rail] runs down the right edge in the status bar's strip. /// and right trading places with the deck's swap button. It measures inside the tab's safe area,
/// Anywhere without a hinge it's just [library]. The library stays put in the view tree, so its /// so the system's tab bar is never covered. Anywhere without a hinge it's just the tab, and the
/// tab and scroll state survive folding, unfolding and swapping. /// tab stays put in the view tree so its scroll state survives folding, unfolding and swapping.
private struct DuoSplit<Library: View, Deck: View, Docked: View, Rail: View>: View { private struct DuoPane<Content: View>: View {
var swap: Bool @ViewBuilder var content: Content
var showDeck: Bool @Environment(Ui.self) private var ui
var onSplit: (Bool) -> Void @AppStorage("duoSwap") private var swap = false
@ViewBuilder var library: Library private var g: AppGraph { .shared }
@ViewBuilder var deck: Deck
@ViewBuilder var docked: Docked
@ViewBuilder var rail: Rail
private static var railWidth: CGFloat { 64 }
var body: some View { var body: some View {
GeometryReader { geo in GeometryReader { geo in
let cut = Self.cut(geo) 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 flip = swap && cut?.vertical == true
let deck = cut != nil && ui.deck && g.playback.current != nil
let layout = cut?.vertical == false ? AnyLayout(VStackLayout(spacing: cut?.gap ?? 0)) : AnyLayout(HStackLayout(spacing: cut?.gap ?? 0)) let layout = cut?.vertical == false ? AnyLayout(VStackLayout(spacing: cut?.gap ?? 0)) : AnyLayout(HStackLayout(spacing: cut?.gap ?? 0))
layout { layout {
ZStack { ZStack {
library content
if cut != nil && showDeck { deck.transition(.opacity) } if deck { NowPlayingDeck().transition(.opacity) }
} }
.environment(\.layoutDirection, .leftToRight) .environment(\.layoutDirection, .leftToRight)
.frame(width: cut.map { $0.vertical ? (flip ? $0.second - steal : $0.first) : geo.size.width - steal } ?? geo.size.width, .frame(width: cut.map { $0.vertical ? (flip ? $0.second : $0.first) : geo.size.width } ?? geo.size.width,
height: cut.map { $0.vertical ? geo.size.height : $0.first } ?? geo.size.height) height: cut.map { $0.vertical ? geo.size.height : $0.first } ?? geo.size.height)
if let cut { if let cut {
docked NowPlayingScreen(docked: true)
.environment(\.layoutDirection, .leftToRight) .environment(\.layoutDirection, .leftToRight)
.frame(width: cut.vertical ? (flip ? cut.first : cut.second - steal) : geo.size.width - steal, .frame(width: cut.vertical ? (flip ? cut.first : cut.second) : geo.size.width,
height: cut.vertical ? geo.size.height : cut.second) height: cut.vertical ? geo.size.height : cut.second)
} }
} }
// Right-to-left lays the same two children out mirrored, so swapping doesn't rebuild either. // Right-to-left lays the same two children out mirrored, so swapping doesn't rebuild either.
.environment(\.layoutDirection, flip ? .rightToLeft : .leftToRight) .environment(\.layoutDirection, flip ? .rightToLeft : .leftToRight)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) .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) .animation(.spring(duration: 0.4, bounce: 0.1), value: flip)
.animation(.easeInOut(duration: 0.2), value: showDeck) .animation(.easeInOut(duration: 0.2), value: deck)
.onChange(of: cut != nil, initial: true) { _, on in onSplit(on) } .onChange(of: cut != nil, initial: true) { _, on in ui.setSplit(on) }
} }
} }
@@ -217,7 +211,7 @@ private struct DuoSplit<Library: View, Deck: View, Docked: View, Rail: View>: Vi
c = vertical c = vertical
? Cut(vertical: true, first: r.minX, gap: r.width, second: size.width - r.maxX) ? 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) : Cut(vertical: false, first: r.minY, gap: r.height, second: size.height - r.maxY)
} else if UIDevice.current.userInterfaceIdiom == .phone, size.width >= 760, size.height >= 560 { } else if UIDevice.current.userInterfaceIdiom == .phone, size.width >= 700, size.height >= 500 {
// No region reported: only an unfolded Duo gives an iPhone this much room both ways. // 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. // 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 let screenW = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds.width
@@ -230,42 +224,28 @@ private struct DuoSplit<Library: View, Deck: View, Docked: View, Rail: View>: Vi
} }
} }
/// The tab bar's stand-in on an unfolded iPhone Duo: Now Playing's stems and queue, the tabs, and /// Dev builds only: a strip over the app with the build number, so they're never mistaken for release.
/// a button that swaps which side of the hinge Now Playing sits on. private struct DevBanner: ViewModifier {
private struct DuoRail: View { private static let label: String? = {
@Binding var swap: Bool let info = Bundle.main.infoDictionary
@Environment(Ui.self) private var ui guard info?["StemifyChannel"] as? String == "dev" else { return nil }
@Environment(\.palette) private var p let v = info?["StemifyVersionLabel"] as? String ?? ""
let b = info?["CFBundleVersion"] as? String ?? ""
var body: some View { return "DEV BUILD \(b) · \(v)"
// 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. func body(content: Content) -> some View {
VStack(spacing: 4) { if let label = Self.label {
Spacer(minLength: 160) content.safeAreaInset(edge: .top, spacing: 0) {
item("Playing", "waveform", on: ui.deck) { ui.showDeck() } Text(label).font(.caption2.weight(.bold)).foregroundStyle(.black)
ForEach(ui.tabs, id: \.self) { t in .frame(maxWidth: .infinity).frame(height: 16)
item(t.rawValue, t.icon, on: !ui.deck && ui.tab == t) { ui.selectTab(t) } .background(Color.orange)
} }
Capsule().fill(p.label3.opacity(0.4)).frame(width: 24, height: 2).padding(.vertical, 8) } else {
item("Swap", "arrow.left.arrow.right", on: false) { swap.toggle() } content
} }
.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 : [])
} }
} }
extension View {
func devBanner() -> some View { modifier(DevBanner()) }
}
+216 -110
View File
@@ -112,6 +112,10 @@ struct NowPlayingScreen: View {
/// width than a regular iPhone's, so the controls pack tighter and the art gets the room. /// width than a regular iPhone's, so the controls pack tighter and the art gets the room.
@AppStorage("duoSeen") private var duoSeen = false @AppStorage("duoSeen") private var duoSeen = false
private var tight: Bool { docked || duoSeen } 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
private var artInset: CGFloat { tight ? 18 : 28 }
private var hPad: CGFloat { tight ? 20 : 28 }
private var g: AppGraph { .shared } private var g: AppGraph { .shared }
var body: some View { var body: some View {
@@ -124,20 +128,28 @@ struct NowPlayingScreen: View {
let wide = geo.size.width > geo.size.height * 0.9 let wide = geo.size.width > geo.size.height * 0.9
if let track { if let track {
if wide { if wide {
// The column never drops below what the transport row needs, so the buttons
// can't spill onto the art or under the Duo rail.
let col = tight ? min(max(geo.size.width * 0.46, 300), 420) : min(geo.size.width * 0.48, 440)
HStack(spacing: 0) { HStack(spacing: 0) {
panelView(track, header: false) panelView(track, header: false)
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
.transition(.opacity.combined(with: .scale(scale: 0.96))) .transition(.opacity.combined(with: .scale(scale: 0.96)))
controls(track, wide: true) controls(track, wide: true, width: col)
.frame(width: min(geo.size.width * 0.48, 440)) .frame(width: col)
.frame(maxHeight: .infinity) .frame(maxHeight: .infinity)
} }
} else { } else {
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)
let w = panel == .Art && art > 0 ? min(cap, max(300, art + 2 * hPad)) : cap
VStack(spacing: 0) { VStack(spacing: 0) {
panelView(track, header: true) panelView(track, header: true)
.frame(maxHeight: .infinity) .frame(maxHeight: .infinity)
.onGeometryChange(for: CGSize.self) { $0.size } action: { artBox = $0 }
.transition(.opacity.combined(with: .scale(scale: 0.96))) .transition(.opacity.combined(with: .scale(scale: 0.96)))
controls(track, wide: false).frame(maxWidth: tight ? 520 : 560) controls(track, wide: false, width: min(w, geo.size.width)).frame(maxWidth: w)
} }
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
} }
@@ -166,7 +178,7 @@ struct NowPlayingScreen: View {
.tint(c.label) .tint(c.label)
.animation(.easeInOut(duration: 0.3), value: tint) .animation(.easeInOut(duration: 0.3), value: tint)
.presentationBackground(.clear) .presentationBackground(.clear)
.onAppear { if g.playback.karaoke { panel = .Lyrics } } .onAppear { if !docked && g.playback.karaoke { panel = .Lyrics } }
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") { .task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return } guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
tint = await albumColor(thumb, dark: base.dark) tint = await albumColor(thumb, dark: base.dark)
@@ -176,16 +188,19 @@ struct NowPlayingScreen: View {
@ViewBuilder @ViewBuilder
private func panelView(_ track: Track, header: Bool) -> some View { private func panelView(_ track: Track, header: Bool) -> some View {
switch panel { switch panel {
case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: tight ? 18 : 28).contentShape(Rectangle()) 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) }; MixerPanel() } 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 .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) } case .Lyrics: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag) }; LyricsPanel(track: track) }
} }
} }
private func controls(_ track: Track, wide: Bool) -> some View { private func controls(_ track: Track, wide: Bool, width: CGFloat) -> some View {
let pm = g.playback let pm = g.playback
let c = tint.map { base.tinted($0) } ?? base let c = tint.map { base.tinted($0) } ?? base
let pad: CGFloat = wide && tight ? 14 : hPad
// Full-size transport needs 312 pt; below that the buttons shrink to fit.
let narrow = width - 2 * pad < 312
return VStack(spacing: 0) { return VStack(spacing: 0) {
if wide || panel == .Art { if wide || panel == .Art {
HStack(alignment: .center) { HStack(alignment: .center) {
@@ -204,31 +219,31 @@ struct NowPlayingScreen: View {
} }
ProgressVolumeBar(played: c.label, unplayed: c.label3, centerLabel: badge(track)) ProgressVolumeBar(played: c.label, unplayed: c.label3, centerLabel: badge(track))
.padding(.top, tight ? (wide ? 14 : 18) : wide ? 24 : panel == .Art ? 34 : 30) .padding(.top, tight ? (wide ? 14 : 18) : wide ? 24 : panel == .Art ? 34 : 30)
HStack { HStack(spacing: 0) {
SideToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle) SideToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle, width: narrow ? 36 : 40)
Spacer() Spacer(minLength: 2)
TransportButton(symbol: "backward.fill", size: 34, action: pm.previous) TransportButton(symbol: "backward.fill", size: narrow ? 28 : 34, box: narrow ? 52 : 72, action: pm.previous)
Spacer() Spacer(minLength: 2)
Button(action: pm.togglePlay) { Button(action: pm.togglePlay) {
ZStack { ZStack {
if pm.buffering && pm.playWhenReady { ProgressView().controlSize(.large).tint(c.label) } if pm.buffering && pm.playWhenReady { ProgressView().controlSize(.large).tint(c.label) }
else { Image(systemName: pm.playWhenReady ? "pause.fill" : "play.fill").font(.system(size: 48)).foregroundStyle(c.label).contentTransition(.symbolEffect(.replace)) } else { Image(systemName: pm.playWhenReady ? "pause.fill" : "play.fill").font(.system(size: narrow ? 42 : 48)).foregroundStyle(c.label).contentTransition(.symbolEffect(.replace)) }
} }
.animation(.snappy(duration: 0.25), value: pm.playWhenReady) .animation(.snappy(duration: 0.25), value: pm.playWhenReady)
.frame(width: 80, height: 80) .frame(width: narrow ? 64 : 80, height: narrow ? 64 : 80)
.contentShape(Rectangle()) .contentShape(Rectangle())
} }
.buttonStyle(PressFade()) .buttonStyle(PressFade())
Spacer() Spacer(minLength: 2)
TransportButton(symbol: "forward.fill", size: 34, action: pm.next, hold: pm.nextAlbum) TransportButton(symbol: "forward.fill", size: narrow ? 28 : 34, box: narrow ? 52 : 72, action: pm.next, hold: pm.nextAlbum)
Spacer() Spacer(minLength: 2)
SideToggle(symbol: pm.repeatMode == .One ? "repeat.1" : "repeat", on: pm.repeatMode != .Off, action: pm.cycleRepeat) SideToggle(symbol: pm.repeatMode == .One ? "repeat.1" : "repeat", on: pm.repeatMode != .Off, action: pm.cycleRepeat, width: narrow ? 36 : 40)
} }
.frame(height: tight ? 76 : 84) .frame(height: tight ? 76 : 84)
.padding(.top, tight ? 4 : 14) .padding(.top, tight ? 4 : 14)
HStack { HStack {
let hidden = NowPlayingButton.hidden(g.settings.hiddenNowPlaying) let hidden = NowPlayingButton.hidden(g.settings.hiddenNowPlaying)
if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.deck : panel == .Mixer) { show(.Mixer) } } if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.deck && !ui.deckLyrics : panel == .Mixer) { show(.Mixer) } }
if !hidden.contains(.Speed) { SpeedMenu() } if !hidden.contains(.Speed) { SpeedMenu() }
if !hidden.contains(.Route) { Button { 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(.AirPlay) { AirPlayButton(tint: UIColor(c.label2), active: UIColor(c.accent)).frame(width: 40, height: 40) }
@@ -246,13 +261,22 @@ struct NowPlayingScreen: View {
.buttonStyle(PressFade()) .buttonStyle(PressFade())
.gesture(swipe(up: panel != .Queue)) } .gesture(swipe(up: panel != .Queue)) }
} }
.padding(.horizontal, tight ? 20 : 28) .padding(.horizontal, pad)
} }
/// Opens a panel, or goes back to the art if it's already open. /// Opens a panel, or goes back to the art if it's already open.
/// Karaoke: vocals down and lyrics up. If it's on but another panel is showing, brings the lyrics back first. /// Karaoke: vocals down and lyrics up. If it's on but another panel is showing, brings the lyrics back first.
private func karaoke() { private func karaoke() {
let pm = g.playback 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.deck && ui.deckLyrics) { ui.showDeck(lyrics: true); return }
pm.setKaraoke(!pm.karaoke)
ui.showDeck(lyrics: pm.karaoke)
}
return
}
withAnimation(.spring(duration: 0.38, bounce: 0.12)) { withAnimation(.spring(duration: 0.38, bounce: 0.12)) {
if pm.karaoke && panel != .Lyrics { panel = .Lyrics; return } if pm.karaoke && panel != .Lyrics { panel = .Lyrics; return }
pm.setKaraoke(!pm.karaoke) pm.setKaraoke(!pm.karaoke)
@@ -262,7 +286,8 @@ struct NowPlayingScreen: View {
private func show(_ to: NpPanel) { private func show(_ to: NpPanel) {
// Docked, the stems and the queue have the other side of the hinge to themselves. // Docked, the stems and the queue have the other side of the hinge to themselves.
if docked && (to == .Mixer || to == .Queue) { withAnimation(.snappy) { ui.showDeck() }; return } // The queue lives only in the deck there, never a second copy beside it.
if docked { if to == .Mixer { withAnimation(.snappy) { ui.showDeck() } }; return }
withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = panel == to ? .Art : to } withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = panel == to ? .Art : to }
} }
@@ -288,7 +313,7 @@ struct NowPlayingScreen: View {
if !docked && 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 } 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. // Never from the stems: a slightly upward fader drag or scroll there kept opening the queue.
if vertical && dy < -50 && panel != .Mixer && g.settings.swipeUpQueue { if !docked && vertical && dy < -50 && panel != .Mixer && g.settings.swipeUpQueue {
withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = .Queue } withAnimation(.spring(duration: 0.38, bounce: 0.12)) { panel = .Queue }
} }
} }
@@ -333,12 +358,13 @@ struct PressFade: ButtonStyle {
private struct TransportButton: View { private struct TransportButton: View {
let symbol: String let symbol: String
let size: CGFloat let size: CGFloat
var box: CGFloat = 72
let action: () -> Void let action: () -> Void
var hold: (() -> Void)? var hold: (() -> Void)?
@Environment(\.palette) private var p @Environment(\.palette) private var p
var body: some View { var body: some View {
HoldButton(action: action, hold: hold) { HoldButton(action: action, hold: hold) {
Image(systemName: symbol).font(.system(size: size)).foregroundStyle(p.label).frame(width: 72, height: 72).contentShape(Rectangle()) Image(systemName: symbol).font(.system(size: size)).foregroundStyle(p.label).frame(width: box, height: box).contentShape(Rectangle())
} }
} }
} }
@@ -368,6 +394,7 @@ private struct SideToggle: View {
let symbol: String let symbol: String
let on: Bool let on: Bool
let action: () -> Void let action: () -> Void
var width: CGFloat = 40
@Environment(\.palette) private var p @Environment(\.palette) private var p
var body: some View { var body: some View {
Button(action: action) { Button(action: action) {
@@ -376,7 +403,7 @@ private struct SideToggle: View {
Circle().frame(width: 4, height: 4).opacity(on ? 1 : 0) Circle().frame(width: 4, height: 4).opacity(on ? 1 : 0)
} }
.foregroundStyle(on ? p.label : p.label3) .foregroundStyle(on ? p.label : p.label3)
.frame(width: 40, height: 56) .frame(width: width, height: 56)
.contentShape(Rectangle()) .contentShape(Rectangle())
} }
.buttonStyle(PressFade()) .buttonStyle(PressFade())
@@ -681,8 +708,11 @@ private struct MixerPanel: View {
let names = pm.stemNames let names = pm.stemNames
let stems = pm.source == .Stems let stems = pm.source == .Stems
GeometryReader { geo in GeometryReader { geo in
// Spread spare height across the rows (stems + master) instead of leaving it all at the bottom. // Spread spare height across the stem rows instead of leaving it all at the bottom.
let rowH = roomy ? Self.roomyRow : min(62, max(46, (geo.size.height - 80) / CGFloat(names.count + 1))) 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))
ScrollView { ScrollView {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
if pm.source == .Original { if pm.source == .Original {
@@ -692,54 +722,12 @@ private struct MixerPanel: View {
.background(p.fill, in: RoundedRectangle(cornerRadius: 12, style: .continuous)) .background(p.fill, in: RoundedRectangle(cornerRadius: 12, style: .continuous))
.padding(.vertical, 8) .padding(.vertical, 8)
} else { } else {
ScrollView(.horizontal, showsIndicators: false) { // Every chip in one row when they fit, else Save plus a Presets menu, so none is cut off.
HStack(spacing: 8) { ViewThatFits(in: .horizontal) {
let current = MixPresets.normalized(pm.mix) HStack(spacing: 8) { saveChips(pm); presetChips(pm, names) }.fixedSize()
let saved = pm.songMix.map(MixPresets.normalized) HStack(spacing: 8) { saveChips(pm); presetMenu(pm, names); Spacer(minLength: 0) }
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)
} }
.padding(.vertical, 8)
} }
// The meters' fall is timed, so 30 fps looks the same and costs a quarter of 120. // 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 TimelineView(.animation(minimumInterval: 1 / 30, paused: !stems || !pm.playWhenReady)) { _ in
@@ -750,11 +738,7 @@ private struct MixerPanel: View {
} }
} }
} }
p.separator.frame(height: 0.5).padding(.vertical, 6) Spacer(minLength: 8)
FaderRow(dot: nil, label: "Master", percent: Int(pm.master * 100), dim: false, height: rowH, stacked: roomy) {
FaderSlider(value: pm.master, fill: p.label, thumb: roomy ? 30 : 24, onChange: pm.setMaster)
} trailing: { EmptyView() }
Spacer(minLength: 16)
} }
.padding(.horizontal, 24) .padding(.horizontal, 24)
} }
@@ -766,9 +750,95 @@ private struct MixerPanel: View {
} }
extension MixerPanel { extension MixerPanel {
static let roomyRow: CGFloat = 60 @ViewBuilder func saveChips(_ pm: PlaybackManager) -> some View {
/// Height that shows the presets, every stem and the master without scrolling, roomy rows. let current = MixPresets.normalized(pm.mix)
static func roomyHeight(_ stems: Int) -> CGFloat { 48 + CGFloat(stems + 1) * roomyRow + 13 + 16 } 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) }
}
}
}
}
}
/// The presets as one menu chip, for panes too narrow for the row.
func presetMenu(_ pm: PlaybackManager, _ names: [String]) -> some View {
let current = MixPresets.normalized(pm.mix)
let s = g.settings
let presets = MixPresets.bar(s).compactMap { p in p.build(names).map { (p, $0) } }
let active = presets.first { MixPresets.normalized($0.1) == current }?.0
return Menu {
ForEach(presets, id: \.0.id) { preset, target in
let on = MixPresets.normalized(target) == current
Button { pm.applyMix(on ? [:] : target) } label: {
if on { Label(preset.label, systemImage: "checkmark") } else { Text(preset.label) }
}
}
Divider()
Button("New Preset", systemImage: "plus") { newPreset(pm) }
Button("Edit Stems", systemImage: "slider.horizontal.3") { ui.showInSettings(.StemEditor) }
} label: {
HStack(spacing: 5) {
Text(active?.label ?? "Presets").lineLimit(1)
Image(systemName: "chevron.down").font(.caption2.weight(.bold))
}
.font(.footnote.weight(.semibold)).foregroundStyle(active != nil ? p.bg : p.label)
.padding(.horizontal, 14).frame(height: 32)
.background(active != nil ? p.label : p.fill, in: Capsule())
}
}
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 }
} }
/// [Chip] in the sheet's own colours: selected is the label colour, so it reads on any tint. /// [Chip] in the sheet's own colours: selected is the label colour, so it reads on any tint.
@@ -806,20 +876,10 @@ private struct StemFader: View {
var body: some View { var body: some View {
let color = Color(hex: Stems.color(name)) 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) { FaderRow(dot: setting.muted ? p.label3 : color, label: Stems.label(name), percent: Int(stemTaper(setting.level) * 100), dim: setting.muted, height: height, stacked: roomy) {
VStack(spacing: 0) { // Live level, -48..0 dBFS, drawn bright over the dimmed fill.
FaderSlider(value: setting.level, fill: setting.muted ? p.label3 : color, detent: StemSetting.unity, enabled: enabled, thumb: roomy ? 30 : 24) { let f = CGFloat(min(1, max(0, (20 * log10(level + 1e-5) + 48) / 48)))
pm.setStemLevel(name, $0) 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)
// Live level under the fader, -48..0 dBFS.
GeometryReader { geo in
let f = CGFloat(min(1, max(0, (20 * log10(level + 1e-5) + 48) / 48)))
ZStack(alignment: .leading) {
Capsule().fill(p.fill)
Capsule().fill(color).frame(width: geo.size.width * f)
}
}
.frame(height: 3)
.padding(.horizontal, 12)
} }
} trailing: { } trailing: {
if enabled { if enabled {
@@ -845,7 +905,8 @@ struct FaderRow<Fader: View, Trailing: View>: View {
@Environment(\.palette) private var p @Environment(\.palette) private var p
var body: some View { var body: some View {
if stacked { if stacked {
VStack(alignment: .leading, spacing: 0) { // Bottom-aligned with a gap under, so each name sits clear of the meter above it.
VStack(alignment: .leading, spacing: 2) {
HStack(spacing: 6) { HStack(spacing: 6) {
if let dot { Circle().fill(dot).frame(width: 8, height: 8) } if let dot { Circle().fill(dot).frame(width: 8, height: 8) }
Text(label).font(.subheadline.weight(.semibold)).foregroundStyle(dim ? p.label2 : p.label).lineLimit(1) Text(label).font(.subheadline.weight(.semibold)).foregroundStyle(dim ? p.label2 : p.label).lineLimit(1)
@@ -855,7 +916,8 @@ struct FaderRow<Fader: View, Trailing: View>: View {
.frame(height: 18) .frame(height: 18)
HStack(spacing: 8) { fader; trailing } HStack(spacing: 8) { fader; trailing }
} }
.frame(height: height) .padding(.bottom, 4)
.frame(height: height, alignment: .bottom)
} else { } else {
row row
} }
@@ -888,7 +950,7 @@ struct ToggleBox: View {
var body: some View { var body: some View {
Button(action: action) { Button(action: action) {
Text(text).font(.footnote.bold()).foregroundStyle(on ? .black : p.label2) Text(text).font(.footnote.bold()).foregroundStyle(on ? .black : p.label2)
.frame(width: big ? 38 : 30, height: big ? 32 : 26) .frame(width: big ? 34 : 30, height: big ? 28 : 26)
.background(on ? onColor : p.fill, in: RoundedRectangle(cornerRadius: 7, style: .continuous)) .background(on ? onColor : p.fill, in: RoundedRectangle(cornerRadius: 7, style: .continuous))
} }
.buttonStyle(.plain) .buttonStyle(.plain)
@@ -903,17 +965,19 @@ struct FaderSlider: View {
var detent: Float? var detent: Float?
var enabled = true var enabled = true
var thumb: CGFloat = 24 var thumb: CGFloat = 24
/// 0...1 live level, shown in the full fill colour over the dimmed filled part of the track.
var meter: CGFloat?
let onChange: (Float) -> Void let onChange: (Float) -> Void
@Environment(\.palette) private var p @Environment(\.palette) private var p
@State private var start: Float? @State private var start: Float?
@State private var caught = false @State private var caught = false
init(value: Float, fill: Color, detent: Float? = nil, enabled: Bool = true, thumb: CGFloat = 24, onChange: @escaping (Float) -> Void) { init(value: Float, fill: Color, detent: Float? = nil, enabled: Bool = true, thumb: CGFloat = 24, meter: CGFloat? = nil, onChange: @escaping (Float) -> Void) {
self.value = value; self.fill = fill; self.detent = detent; self.enabled = enabled; self.thumb = thumb; self.onChange = onChange 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 { thumb >= 28 ? 6 : 4 } private var bar: CGFloat { meter == nil ? (thumb >= 26 ? 5 : 4) : 8 }
var body: some View { var body: some View {
GeometryReader { geo in GeometryReader { geo in
@@ -921,7 +985,15 @@ struct FaderSlider: View {
let x = CGFloat(min(max(value, 0), 1)) * track let x = CGFloat(min(max(value, 0), 1)) * track
ZStack(alignment: .leading) { ZStack(alignment: .leading) {
Capsule().fill(p.fillStrong).frame(height: bar).padding(.horizontal, thumb / 2) Capsule().fill(p.fillStrong).frame(height: bar).padding(.horizontal, thumb / 2)
Capsule().fill(fill).frame(width: x + thumb / 2, height: bar).padding(.leading, thumb / 2 - 0.01) // 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)
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)
.padding(.leading, thumb / 2 - 0.01)
.animation(.linear(duration: 1 / 30), value: meter)
}
if let detent { if let detent {
p.label3.frame(width: 2, height: 10).offset(x: CGFloat(detent) * track + thumb / 2 - 1) p.label3.frame(width: 2, height: 10).offset(x: CGFloat(detent) * track + thumb / 2 - 1)
} }
@@ -951,9 +1023,12 @@ struct FaderSlider: View {
// ---- deck ----------------------------------------------------------------------------------- // ---- deck -----------------------------------------------------------------------------------
/// Unfolded iPhone Duo: the stems over the queue, on the other side of the hinge from Now Playing. /// Unfolded iPhone Duo: the stems over the queue, or the lyrics, on the other side of the hinge
/// from Now Playing. The stems stay put and the queue scrolls in what's left under them.
struct NowPlayingDeck: View { struct NowPlayingDeck: View {
@Environment(Ui.self) private var ui
@Environment(\.palette) private var base @Environment(\.palette) private var base
@AppStorage("duoSwap") private var swap = false
@State private var tint: Color? @State private var tint: Color?
private var g: AppGraph { .shared } private var g: AppGraph { .shared }
@@ -961,32 +1036,63 @@ struct NowPlayingDeck: View {
let c = tint.map { base.tinted($0) } ?? base let c = tint.map { base.tinted($0) } ?? base
let track = g.playback.current?.track let track = g.playback.current?.track
GeometryReader { geo in GeometryReader { geo in
if track != nil { if let track {
VStack(spacing: 0) { VStack(spacing: 0) {
Text("Stems").font(.headline).foregroundStyle(c.label) header(c)
.frame(maxWidth: .infinity, alignment: .leading).padding(.horizontal, 24) if ui.deckLyrics {
// As much as the stems need to show without scrolling, leaving the queue a few rows. LyricsPanel(track: track).frame(maxHeight: .infinity)
MixerPanel(roomy: true).frame(height: min(MixerPanel.roomyHeight(max(g.playback.stemNames.count, 4)), geo.size.height * 0.68)) } else {
Rectangle().fill(c.label3.opacity(0.35)).frame(height: 0.5).padding(.horizontal, 24).padding(.bottom, 8) let n = max(g.playback.stemNames.count, 1)
QueuePanel() // Every stem without scrolling, leaving the queue at least a header and a few rows.
let fit = MixerPanel.roomyChrome + CGFloat(n) * MixerPanel.roomyMin
let mixH = max(min(MixerPanel.roomyHeight(n), geo.size.height - 230), min(fit, geo.size.height - 150))
MixerPanel(roomy: true).frame(height: max(mixH, 0))
Rectangle().fill(c.label3.opacity(0.35)).frame(height: 0.5).padding(.horizontal, 24).padding(.bottom, 4)
QueuePanel().frame(maxHeight: .infinity)
}
} }
} else { } else {
Text("Nothing Playing").font(.title3.weight(.semibold)).foregroundStyle(c.label2) Text("Nothing Playing").font(.title3.weight(.semibold)).foregroundStyle(c.label2)
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
} }
} }
.padding(.top, 12) .padding(.top, 8)
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
.background(c.bg.ignoresSafeArea()) .background(c.bg.ignoresSafeArea())
.environment(\.palette, c) .environment(\.palette, c)
.modifier(NpScheme(dark: c.dark, docked: true)) .modifier(NpScheme(dark: c.dark, docked: true))
.tint(c.label) .tint(c.label)
.animation(.easeInOut(duration: 0.3), value: tint) .animation(.easeInOut(duration: 0.3), value: tint)
.animation(.snappy(duration: 0.25), value: ui.deckLyrics)
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") { .task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return } guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
tint = await albumColor(thumb, dark: base.dark) tint = await albumColor(thumb, dark: base.dark)
} }
} }
/// Stems or Lyrics, and the button that moves Now Playing to the other side of the hinge.
private func header(_ c: Palette) -> some View {
HStack(spacing: 18) {
page("Stems", on: !ui.deckLyrics, c) { ui.showDeck(lyrics: false) }
page("Lyrics", on: ui.deckLyrics, c) { ui.showDeck(lyrics: true) }
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 page(_ title: String, on: Bool, _ c: Palette, _ action: @escaping () -> Void) -> some View {
Button(action: action) {
Text(title).font(.headline).foregroundStyle(on ? c.label : c.label3)
}
.buttonStyle(.plain)
.accessibilityAddTraits(on ? .isSelected : [])
}
} }
// ---- queue ---------------------------------------------------------------------------------- // ---- queue ----------------------------------------------------------------------------------
+4 -1
View File
@@ -9,11 +9,13 @@ settings:
# iOS needs a plain number for the bundle version; the label is what the app and releases show. # iOS needs a plain number for the bundle version; the label is what the app and releases show.
MARKETING_VERSION: "1.0" MARKETING_VERSION: "1.0"
VERSION_LABEL: "1.0 RC 4" VERSION_LABEL: "1.0 RC 4"
CURRENT_PROJECT_VERSION: "24" CURRENT_PROJECT_VERSION: "25"
# Dev builds override these (build-ipa.sh dev) so they install next to the release app. # Dev builds override these (build-ipa.sh dev) so they install next to the release app.
APP_ID: org.cdnutter.stemify APP_ID: org.cdnutter.stemify
APP_NAME: Stemify APP_NAME: Stemify
APP_ICON: AppIcon APP_ICON: AppIcon
# "dev" shows the DEV BUILD banner across the top of the app.
STEMIFY_CHANNEL: release
targets: targets:
Stemify: Stemify:
type: application type: application
@@ -41,6 +43,7 @@ targets:
CFBundleShortVersionString: $(MARKETING_VERSION) CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION) CFBundleVersion: $(CURRENT_PROJECT_VERSION)
StemifyVersionLabel: $(VERSION_LABEL) StemifyVersionLabel: $(VERSION_LABEL)
StemifyChannel: $(STEMIFY_CHANNEL)
UILaunchScreen: {} UILaunchScreen: {}
UIBackgroundModes: [audio, fetch] UIBackgroundModes: [audio, fetch]
UISupportedInterfaceOrientations: [UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight] UISupportedInterfaceOrientations: [UIInterfaceOrientationPortrait, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight]
+4 -2
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Builds one Stemify IPA on a Mac. ios/scripts/build-remote.sh runs this on WHITE-M1 from DevOps. # 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 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. # build-ipa.sh dev build/dev/stemify-<v>-dev.ipa org.cdnutter.stemify-dev, ribbon icon, DEV BUILD banner.
# Gitea pre-releases (dev branch) + Sideload Developer. # Gitea pre-releases (dev branch) + Sideload Developer.
# build-ipa.sh prov build/prov/stemify-<v>-prov.ipa org.cdnutter.stemify, signed with the # build-ipa.sh prov build/prov/stemify-<v>-prov.ipa org.cdnutter.stemify, signed with the
# personal profile (CarPlay, Siri). Never published anywhere. # personal profile (CarPlay, Siri). Never published anywhere.
@@ -20,6 +20,8 @@ case $MODE in
*) echo "usage: $0 release|dev|prov" >&2; exit 1 ;; *) echo "usage: $0 release|dev|prov" >&2; exit 1 ;;
esac esac
DD=$B/dd-$MODE DD=$B/dd-$MODE
# Dev builds carry a DEV BUILD banner with their build number.
CHANNEL=$([ "$MODE" = dev ] && echo dev || echo release)
# "1.0 RC 1" -> 1.0-rc1, used in file names and release tags. # "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') 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 IPA=$B/$MODE/stemify-$VERSION$SUFFIX.ipa
@@ -35,7 +37,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. # xcodebuild compiles the app, the widget extension, the asset catalog and the App Intents metadata.
xcodegen generate -q xcodegen generate -q
xcodebuild -project Stemify.xcodeproj -scheme Stemify -configuration Release -sdk iphoneos \ 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 CODE_SIGNING_ALLOWED=NO -quiet build -destination generic/platform=iOS -derivedDataPath $DD APP_ID=$APP_ID APP_NAME="$APP_NAME" APP_ICON=$APP_ICON STEMIFY_CHANNEL=$CHANNEL CODE_SIGNING_ALLOWED=NO -quiet build
cp -R $DD/Build/Products/Release-iphoneos/Stemify.app $APP cp -R $DD/Build/Products/Release-iphoneos/Stemify.app $APP
[ -d $EXT ] || { echo "widget extension missing" >&2; exit 1; } [ -d $EXT ] || { echo "widget extension missing" >&2; exit 1; }
+2 -2
View File
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Publishes an IPA built by build-remote.sh. Run from DevOps with everything committed. # Publishes an IPA built by build-remote.sh. Run from DevOps with everything committed.
# publish.sh dev on the dev branch: Gitea pre-release ios-v<v>-dev.<build> + Sideload Developer (WHITE-M1 :8093, ?source=developer) # publish.sh dev on the dev branch: Gitea pre-release ios-v<v>-dev.<build> + Sideload Developer (WHITE-M1 :8093, ?source=developer)
# publish.sh release on main, only when the owner says so: Gitea release ios-v<v> + Sideload (:8093), then source.json # publish.sh release on main, only when the owner says so: Gitea release ios-v<v> + Personal (:8093, ?source=personal), then source.json
# Release notes come from $NOTES, else the last commit subject. prov builds are never published. # Release notes come from $NOTES, else the last commit subject. prov builds are never published.
set -euo pipefail set -euo pipefail
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
@@ -14,7 +14,7 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
die() { echo "$*" >&2; exit 1; } die() { echo "$*" >&2; exit 1; }
case $MODE in case $MODE in
dev) WANT=dev; IPA=build/dev/$NAME-$V-dev.ipa; TAG=$TAGP$V-dev.$BUILD; PRE=true; UP=http://10.0.0.11:8093; Q='?source=developer' ;; dev) WANT=dev; IPA=build/dev/$NAME-$V-dev.ipa; TAG=$TAGP$V-dev.$BUILD; PRE=true; UP=http://10.0.0.11:8093; Q='?source=developer' ;;
release) WANT=main; IPA=build/release/$NAME-$V.ipa; TAG=$TAGP$V; PRE=false; UP=http://10.0.0.11:8093; Q= ;; release) WANT=main; IPA=build/release/$NAME-$V.ipa; TAG=$TAGP$V; PRE=false; UP=http://10.0.0.11:8093; Q='?source=personal' ;;
*) die "usage: $0 dev|release" ;; *) die "usage: $0 dev|release" ;;
esac esac
[ "$BRANCH" = "$WANT" ] || die "$MODE builds publish from $WANT (on $BRANCH)" [ "$BRANCH" = "$WANT" ] || die "$MODE builds publish from $WANT (on $BRANCH)"
+11 -1
View File
@@ -7,7 +7,7 @@
"apps": [ "apps": [
{ {
"name": "Stemify", "name": "Stemify",
"bundleIdentifier": "org.cdnutter.stemify", "bundleIdentifier": "org.cdnutter.stemify-pub",
"developerName": "cdnutter", "developerName": "cdnutter",
"subtitle": "Plex music player with live stem mixing.", "subtitle": "Plex music player with live stem mixing.",
"localizedDescription": "Plays your Plex library and lets you mute vocals or remix stems on the fly. Works offline with downloads, and in the car with CarPlay.", "localizedDescription": "Plays your Plex library and lets you mute vocals or remix stems on the fly. Works offline with downloads, and in the car with CarPlay.",
@@ -15,6 +15,16 @@
"tintColor": "#FA2D48", "tintColor": "#FA2D48",
"category": "entertainment", "category": "entertainment",
"versions": [ "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", "version": "1.0",
"marketingVersion": "1.0 RC 3", "marketingVersion": "1.0 RC 3",