Compare commits

..
Author SHA1 Message Date
rootandClaude Opus 5.5 406895a3f0 Dev 34: left-aligned art only when folded
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:36:54 -08:00
rootandClaude Opus 5.5 02539d72b1 Dev 33: deck stems fill the pane to the hinge and bottom, folded art view uses snug controls
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:30:17 -08:00
rootandClaude Opus 5.5 71134ff322 Fix agentic-coding disclaimer formatting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:29:17 -08:00
rootandClaude Opus 5.5 d248abf143 Dev 32: full-width unfolded stem bars, roomier rows, fixed tab bar slots across fold
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:22:03 -08:00
rootandClaude Opus 5.5 2dca5467db Update agentic-coding disclaimer to new format
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 10:13:54 -08:00
root 887c76dc04 iOS source.json for ios-v0.9.0 2026-11-18 17:21:51 -08:00
root 15ba897402 Merge dev into main for iOS 0.9.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	ios/project.yml
#	ios/scripts/build-ipa.sh
2026-11-18 17:20:47 -08:00
rootandClaude Opus 5.5 1072dde293 iOS dev 31: folded left-align art setting, folded Duo locked upright, tab bar order stable across fold/unfold
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 17:20:32 -08:00
rootandClaude Opus 5.5 150e47a305 iOS dev 30: hide Duo swap, Library Layout in Settings, Settings width on Duo, centred stem faders, folded spacing, no folded header menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 17:03:24 -08:00
rootandClaude Opus 5.5 29a1742f8d Duo: fill folded Now Playing and hinge-side panes, centre stems, fit all faders
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 16:45:44 -08:00
rootandClaude Opus 5.5 09bf1b2835 iOS Duo: same vertical tab bar on every tab, docked Now Playing keeps its size, folded Now Playing fills the window (dev 28)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 15:29:03 -08:00
rootandClaude Opus 5.5 c33079c96a iOS publish.sh: send the tag, not the title, as tag_name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 15:03:51 -08:00
rootandClaude Opus 5.5 4ae6136847 iOS source.json: no releases (restart at 0.9.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 15:03:42 -08:00
rootandClaude Opus 5.5 09d8caface iOS publish.sh: send the tag, not the title, as tag_name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 15:03:29 -08:00
rootandClaude Opus 5.5 0fbd7c848f iOS: version 0.9.0, dev title "Dev Build N", dev short version major.minor.build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 15:03:09 -08:00
rootandClaude Opus 5.5 4ddcfd7ff5 Duo deck: Now Playing tab, full-pane Stems / Lyrics / Playing Next / EQ pages
Unfolded with something playing, the tab bar leads with a Now Playing item that shows the
deck beside docked Now Playing. Each deck page gets the whole pane; the queue moved to its
own page and a vertical graphic EQ page was added. Dev build 27.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 15:00:00 -08:00
rootandClaude Opus 5.5 13f4fc5afe source.json: drop deleted 1.0.x releases
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:55:30 -08:00
root 40c72000aa publish.sh: readable release titles (Stemify iOS <label>, Dev Build <n>)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 190b793043)
2026-11-18 14:55:26 -08:00
rootandClaude Opus 5.5 190b793043 publish.sh: readable release titles (Stemify iOS <label>, Dev Build <n>)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:55:21 -08:00
rootandClaude Opus 5.5 8c06f17c05 Now Playing: close from the top strip only, stems keep the art width, sliding preset chips, docked Duo pane stacks art on top, deck fits every stem, no dev banner, dev builds versioned 1.0.<build>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:30:58 -08:00
rootandClaude Opus 5.5 dc3e8a09b5 publish.sh: dev uploads go to ?source=dev (developer 404s)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 14:12:35 -08:00
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
rootandClaude Opus 5.5 47514127d8 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:55 -08:00
15 changed files with 567 additions and 495 deletions

No files matched your search

+6 -1
View File
@@ -1,4 +1,9 @@
### ⚠️ THIS PROJECT WAS ENTIRELY VIBECODED AND IS SLOP. DO NOT PROCEED IF YOU DO NOT ALIGN WITH THESE VALUES. DO NOT COMPLAIN ABOUT IT IN PULL RELEASES, ISSUES, ETC. UNLESS THERE ARE SEVERE SECURITY RISKS. THEY WILL BE REMOVED. PROCEED AT YOUR OWN RISK! ⚠️ > [!CAUTION]
> This project heavily used agentic coding practices. It is not recommended to use this for production and should be heavily monitored prior to any implementation. If you do not align with agentic-coding values, do not use this application.
> The model(s) used: **Claude Opus 5.5, Claude Sonnet 5.5**
> AI contribution: **99%**, Human contribution: **1%**
# Stemify # Stemify
+19
View File
@@ -20,12 +20,31 @@ final class AppDelegate: NSObject, UIApplicationDelegate {
return UISceneConfiguration(name: "Phone", sessionRole: session.role) return UISceneConfiguration(name: "Phone", sessionRole: session.role)
} }
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
Orientation.mask
}
/// Siri: "Play <album> on Stemify". /// Siri: "Play <album> on Stemify".
func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? { func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? {
intent is INPlayMediaIntent ? PlayMediaHandler() : nil intent is INPlayMediaIntent ? PlayMediaHandler() : nil
} }
} }
/// Folded on the iPhone Duo the app stays upright; everywhere else it turns as usual.
enum Orientation {
nonisolated(unsafe) static var mask: UIInterfaceOrientationMask = .allButUpsideDown
@MainActor static func lock(_ upright: Bool) {
let m: UIInterfaceOrientationMask = upright ? .portrait : .allButUpsideDown
guard m != mask else { return }
mask = m
for case let scene as UIWindowScene in UIApplication.shared.connectedScenes {
scene.keyWindow?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
if upright { scene.requestGeometryUpdate(.iOS(interfaceOrientations: .portrait)) { _ in } }
}
}
}
@main @main
struct StemifyApp: App { struct StemifyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) private var delegate @UIApplicationDelegateAdaptor(AppDelegate.self) private var delegate
+3 -1
View File
@@ -109,7 +109,7 @@ final class Settings: @unchecked Sendable {
"servers", "plexUrl", "plexToken", "plexUser", "plexMachineId", "musicSection", "musicSectionTitle", "servers", "plexUrl", "plexToken", "plexUser", "plexMachineId", "musicSection", "musicSectionTitle",
"stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumColorNowPlaying", "highRefreshRate", "stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumColorNowPlaying", "highRefreshRate",
"stemQuality", "cacheLimitGb", "downloadsWifiOnly", "downloadSort", "keepStemMix", "masterVolume", "tabLayout", "stemQuality", "cacheLimitGb", "downloadsWifiOnly", "downloadSort", "keepStemMix", "masterVolume", "tabLayout",
"karaokeVocals", "karaokeSoftDb", "playbackSpeed", "stemsOnly", "noStems", "precacheCount", "hiddenNowPlaying", "presets", "presetOrder", "hiddenPresets", "lockedPreset", "webStations", "lockScreenMix", "swipeUpQueue", "acapella", "crossfadeSec", "sweetFades", "karaokeVocals", "karaokeSoftDb", "playbackSpeed", "stemsOnly", "noStems", "precacheCount", "hiddenNowPlaying", "presets", "presetOrder", "hiddenPresets", "lockedPreset", "webStations", "lockScreenMix", "swipeUpQueue", "acapella", "crossfadeSec", "sweetFades", "foldedArtLeft",
] ]
private func read<T>(_ kp: KeyPath<Settings, T>, _ key: String, _ def: T) -> T { private func read<T>(_ kp: KeyPath<Settings, T>, _ key: String, _ def: T) -> T {
@@ -220,6 +220,8 @@ final class Settings: @unchecked Sendable {
var swipeUpQueue: Bool { get { read(\.swipeUpQueue, "swipeUpQueue", true) } set { write(\.swipeUpQueue, "swipeUpQueue", newValue, true) } } var swipeUpQueue: Bool { get { read(\.swipeUpQueue, "swipeUpQueue", true) } set { write(\.swipeUpQueue, "swipeUpQueue", newValue, true) } }
var lockScreenMix: Bool { get { read(\.lockScreenMix, "lockScreenMix", false) } set { write(\.lockScreenMix, "lockScreenMix", newValue, false) } } var lockScreenMix: Bool { get { read(\.lockScreenMix, "lockScreenMix", false) } set { write(\.lockScreenMix, "lockScreenMix", newValue, false) } }
var albumColorNowPlaying: Bool { get { read(\.albumColorNowPlaying, "albumColorNowPlaying", false) } set { write(\.albumColorNowPlaying, "albumColorNowPlaying", newValue, false) } } var albumColorNowPlaying: Bool { get { read(\.albumColorNowPlaying, "albumColorNowPlaying", false) } set { write(\.albumColorNowPlaying, "albumColorNowPlaying", newValue, false) } }
/// Folded iPhone Duo: Now Playing's art sits at the left instead of centred.
var foldedArtLeft: Bool { get { read(\.foldedArtLeft, "foldedArtLeft", false) } set { write(\.foldedArtLeft, "foldedArtLeft", newValue, false) } }
var highRefreshRate: Bool { get { read(\.highRefreshRate, "highRefreshRate", true) } set { write(\.highRefreshRate, "highRefreshRate", newValue, true) } } var highRefreshRate: Bool { get { read(\.highRefreshRate, "highRefreshRate", true) } set { write(\.highRefreshRate, "highRefreshRate", newValue, true) } }
var stemQuality: StemQuality { get { readEnum(\.stemQuality, "stemQuality", .High) } set { writeEnum(\.stemQuality, "stemQuality", newValue, .High) } } var stemQuality: StemQuality { get { readEnum(\.stemQuality, "stemQuality", .High) } set { writeEnum(\.stemQuality, "stemQuality", newValue, .High) } }
+14
View File
@@ -298,6 +298,19 @@ struct Loaded<T, Content: View>: View {
} }
} }
/// Swapping Now Playing to the other side of the Duo's hinge. Off for now: no button, and a
/// saved swap is ignored.
let duoSwapEnabled = false
/// Split at the iPhone Duo's hinge, a tab's rows run right up to it (no inset is real on that side).
struct HingeEdge: ViewModifier {
@Environment(Ui.self) private var ui
@AppStorage("duoSwap") private var swap = false
func body(content: Content) -> some View {
content.ignoresSafeArea(.container, edges: ui.split ? (swap && duoSwapEnabled ? .leading : .trailing) : [])
}
}
/// A plain scrolling page with a large title, like the Android shell's Page. /// A plain scrolling page with a large title, like the Android shell's Page.
struct Page<Content: View>: View { struct Page<Content: View>: View {
let title: String let title: String
@@ -309,6 +322,7 @@ struct Page<Content: View>: View {
LazyVStack(alignment: .leading, spacing: 0) { content() } LazyVStack(alignment: .leading, spacing: 0) { content() }
.padding(.bottom, 24) .padding(.bottom, 24)
} }
.modifier(HingeEdge())
.background(p.bg) .background(p.bg)
.navigationTitle(title) .navigationTitle(title)
.navigationBarTitleDisplayMode(large ? .large : .inline) .navigationBarTitleDisplayMode(large ? .large : .inline)
+48 -21
View File
@@ -36,10 +36,23 @@ 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 { enum Route: Hashable {
case Artists, Albums, Songs, RecentlyAdded, Playlists, Genres, Downloads, DownloadQueue, TabBar, WebRadio case Artists, Albums, Songs, RecentlyAdded, Playlists, Genres, Downloads, DownloadQueue, TabBar, WebRadio
case Eq, EqFilters(profileId: String), EqFilterPage(profileId: String, filterId: String) case Eq, EqFilters(profileId: String), EqFilterPage(profileId: String, filterId: String)
case Servers, ServerList, Server(String), StemServer, Quality, Storage, Appearance, NowPlayingOptions, StemEditor, About case Servers, ServerList, Server(String), StemServer, Quality, Storage, Appearance, NowPlayingOptions, StemEditor, LibraryLayout, About
case GenrePage(String), ArtistPage(Artist), AlbumPage(Album), PlaylistPage(Playlist), StemPlaylistPage(String) case GenrePage(String), ArtistPage(Artist), AlbumPage(Album), PlaylistPage(Playlist), StemPlaylistPage(String)
} }
@@ -54,8 +67,10 @@ final class Ui {
} }
/// True while an unfolded iPhone Duo shows Now Playing docked beside the library. /// True while an unfolded iPhone Duo shows Now Playing docked beside the library.
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 Now Playing tab (the deck) is selected instead of `tab`.
var deck = true var deck = true
/// Split only: which of the deck's pages is showing.
var deckPage: DeckPage = .Stems
let overlays: Overlays let overlays: Overlays
init(overlays: Overlays) { self.overlays = overlays } init(overlays: Overlays) { self.overlays = overlays }
@@ -70,12 +85,21 @@ final class Ui {
/// Tapping the selected tab again pops it to its root. /// Tapping the selected tab again pops it to its root.
func selectTab(_ t: Tab) { func selectTab(_ t: Tab) {
if split && deck { deck = false; tab = t; return } if showsDeck { deck = false; tab = t; return }
if t == tab { paths[t] = [] } else { tab = t } if t == tab { paths[t] = [] } else { tab = t }
} }
/// The tabs currently in the bar, in order. /// Split with something playing, the bar leads with a Now Playing item that opens the deck.
var tabs: [Tab] { Tab.layout(AppGraph.shared.settings.tabLayout) } 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
}
/// Where library pages open: Library if it's in the bar, else the first tab that is. /// 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) } private var home: Tab { tabs.contains(.Library) ? .Library : (tabs.first ?? .Settings) }
@@ -93,29 +117,32 @@ 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(_ page: DeckPage? = nil) { deck = true; if let page { deckPage = page } }
/// This phone has shown the Duo's folded status column at least once (saved).
private var duo = UserDefaults.standard.bool(forKey: "duoSeen")
/// Folded iPhone Duo: the outer display, kept upright.
var folded: Bool { duo && !split }
/// Called with the window's side insets. Upright, only the folded Duo has a trailing one.
func sawInsets(trailing: CGFloat, upright: Bool) {
if !duo && upright && !split && trailing > 20 {
duo = true
UserDefaults.standard.set(true, forKey: "duoSeen")
}
Orientation.lock(folded)
}
func setSplit(_ on: Bool) { func setSplit(_ on: Bool) {
guard on != split else { return } guard on != split else { return }
split = on split = on
Orientation.lock(folded)
if on { if on {
nowPlayingOpen = false nowPlayingOpen = false
// Only an iPhone Duo ever splits, so from here on folded Now Playing uses its tighter layout.
UserDefaults.standard.set(true, forKey: "duoSeen")
}
// 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)
}
} }
// Karaoke left on shows its lyrics in the deck.
if on && AppGraph.shared.playback.karaoke { deckPage = .Lyrics } else if deckPage == .Lyrics { deckPage = .Stems }
} }
/// Switches to the Library tab and pushes [r] there. /// Switches to the Library tab and pushes [r] there.
+75 -100
View File
@@ -2,39 +2,21 @@ 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) }) { bar
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(t)
}
}
.modifier(GlassMiniPlayerHost()) .modifier(GlassMiniPlayerHost())
} deck: { // Folded on the Duo the app stays upright (the window's trailing inset gives the Duo away).
NowPlayingDeck() .onGeometryChange(for: CGFloat.self) { $0.safeAreaInsets.trailing } action: { ui.sawInsets(trailing: $0, upright: vSize == .regular) }
} docked: {
NowPlayingScreen(docked: true)
} rail: {
DuoRail(swap: $duoSwap)
}
.background(p.bg.ignoresSafeArea()) .background(p.bg.ignoresSafeArea())
.onChange(of: s.tabLayout) { _, _ in ui.ensureValidTab() } .onChange(of: ui.tabs) { _, _ 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()
.overlayHost(ui.overlays, level: 1) .overlayHost(ui.overlays, level: 1)
@@ -53,6 +35,53 @@ struct RootView: View {
.tint(p.accent) .tint(p.accent)
} }
@Environment(\.verticalSizeClass) private var vSize
private enum BarItem: Hashable { case deck, tab(Tab) }
private var selection: Binding<BarItem> {
Binding(get: { ui.showsDeck ? BarItem.deck : .tab(ui.tab) },
set: { if case .tab(let t) = $0 { ui.selectTab(t) } else { ui.showDeck() } })
}
/// The bar always holds the same slots. Unfolded with something playing, Now Playing takes
/// the place of the last tab before Settings (iOS folds a sixth item into "More"), so folding
/// and unfolding swaps one item in place and nothing else moves.
private var slots: [BarItem] {
let all = Tab.layout(g.settings.tabLayout)
var items = all.map { BarItem.tab($0) }
guard ui.hasDeckTab else { return items }
if all.count >= Tab.maxVisible, let i = all.lastIndex(where: { $0 != .Settings }) { items[i] = .deck }
else { items.insert(.deck, at: all.lastIndex(of: .Settings) ?? items.count) }
return items
}
private var bar: some View {
TabView(selection: selection) {
ForEach(Array(slots.enumerated()), id: \.offset) { _, item in
switch item {
case .deck:
DuoPane { NowPlayingDeck() }
.tabItem { Label("Now Playing", systemImage: "waveform") }
.tag(item)
case .tab(let t):
page(t).tabItem { Label(t.rawValue, systemImage: t.icon) }.tag(item)
}
}
}
.transaction { $0.animation = nil }
}
private func page(_ t: Tab) -> some View {
DuoPane {
NavigationStack(path: ui.path(t)) {
root(t).miniPlayerRoom()
.navigationDestination(for: Route.self) { destination($0).miniPlayerRoom() }
}
.modifier(FloatingMiniPlayer())
}
}
@ViewBuilder private func root(_ t: Tab) -> some View { @ViewBuilder private func root(_ t: Tab) -> some View {
switch t { switch t {
case .Library: LibraryHome() case .Library: LibraryHome()
@@ -92,6 +121,7 @@ struct RootView: View {
case .Appearance: AppearanceScreen() case .Appearance: AppearanceScreen()
case .NowPlayingOptions: NowPlayingOptionsScreen() case .NowPlayingOptions: NowPlayingOptionsScreen()
case .StemEditor: StemEditorScreen() case .StemEditor: StemEditorScreen()
case .LibraryLayout: LibraryLayoutScreen()
case .About: AboutScreen() case .About: AboutScreen()
case .ArtistPage(let a): ArtistScreen(artist: a) case .ArtistPage(let a): ArtistScreen(artist: a)
case .AlbumPage(let a): AlbumScreen(album: a) case .AlbumPage(let a): AlbumScreen(album: a)
@@ -142,8 +172,6 @@ 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.
.toolbar(ui.split ? .hidden : .automatic, for: .tabBar)
} }
} }
@@ -151,56 +179,43 @@ 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 /// (or, for the Now Playing item, the deck) 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 let flip = duoSwapEnabled && swap && cut?.vertical == true
// 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)) let layout = cut?.vertical == false ? AnyLayout(VStackLayout(spacing: cut?.gap ?? 0)) : AnyLayout(HStackLayout(spacing: cut?.gap ?? 0))
layout { layout {
ZStack { content
library
if cut != nil && showDeck { deck.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, // The tab's navigation picks up the window's right-hand inset (the status column)
// even though it ends at the hinge, so the bar and rows stopped short of it. The
// hinge side never needs an inset.
.ignoresSafeArea(.container, edges: cut?.vertical == true ? (flip ? .leading : .trailing) : [])
.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) .onChange(of: cut != nil, initial: true) { _, on in ui.setSplit(on) }
.onChange(of: cut != nil, initial: true) { _, on in onSplit(on) }
} }
} }
@@ -217,7 +232,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
@@ -229,43 +244,3 @@ private struct DuoSplit<Library: View, Deck: View, Docked: View, Rail: View>: Vi
return c.first > 200 && c.second > 200 ? c : nil 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 : [])
}
}
+80
View File
@@ -202,6 +202,86 @@ 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 ------------------------------------------------------------------------- // ---- main EQ screen -------------------------------------------------------------------------
struct EqScreen: View { struct EqScreen: View {
+21 -57
View File
@@ -10,32 +10,33 @@ struct LibraryHome: View {
@State private var added: [Track] = [] @State private var added: [Track] = []
@State private var reload = 0 @State private var reload = 0
@Environment(\.scenePhase) private var scenePhase @Environment(\.scenePhase) private var scenePhase
@State private var editing = false
private var g: AppGraph { .shared } private var g: AppGraph { .shared }
/// Rows in the saved order. Titles not saved yet keep their default order after the saved ones. /// Rows in the saved order. Titles not saved yet keep their default order after the saved ones.
private func ordered<T>(_ items: [T], _ title: (T) -> String) -> [T] { static func ordered<T>(_ items: [T], _ s: Settings, _ title: (T) -> String) -> [T] {
let saved = g.settings.libraryOrder.split(separator: "|").map(String.init) let saved = s.libraryOrder.split(separator: "|").map(String.init)
func rank(_ t: String) -> Int { saved.firstIndex(of: t) ?? saved.count } func rank(_ t: String) -> Int { saved.firstIndex(of: t) ?? saved.count }
return items.enumerated().sorted { (rank(title($0.element)), $0.offset) < (rank(title($1.element)), $1.offset) }.map(\.element) return items.enumerated().sorted { (rank(title($0.element)), $0.offset) < (rank(title($1.element)), $1.offset) }.map(\.element)
} }
private func ordered<T>(_ items: [T], _ title: (T) -> String) -> [T] { Self.ordered(items, g.settings, title) }
/// Moves a row one place within its section and saves the whole order. /// Moves rows within one group (Settings > Library Layout) and saves the whole order.
private func move(_ title: String, _ by: Int, in titles: [String]) { static func reorder(_ group: [String], from: IndexSet, to: Int, _ s: Settings) {
guard let i = titles.firstIndex(of: title), titles.indices.contains(i + by) else { return } var t = ordered(group, s) { $0 }
var t = titles t.move(fromOffsets: from, toOffset: to)
t.swapAt(i, i + by) let saved = s.libraryOrder.split(separator: "|").map(String.init)
let saved = g.settings.libraryOrder.split(separator: "|").map(String.init) s.libraryOrder = (t + saved.filter { !t.contains($0) }).joined(separator: "|")
g.settings.libraryOrder = (t + saved.filter { !t.contains($0) }).joined(separator: "|")
} }
private static let sectionNames = ["Recent Plays", "Recently Added", "On This Day", "Stations", "Browse"] static let sectionNames = ["Recent Plays", "Recently Added", "On This Day", "Stations", "Browse"]
static let stationNames = ["Library Radio", "Random Album Radio"]
static let browseNames = ["Playlists", "Artists", "Albums", "Songs", "Genres", "Downloads", "Web Radio"]
private var shownSections: [String] { ordered(Self.sectionNames) { $0 } } private var shownSections: [String] { ordered(Self.sectionNames) { $0 } }
private var hiddenSections: Set<String> { Set(g.settings.libraryHidden.split(separator: "|").map(String.init)) } static func hidden(_ s: Settings) -> Set<String> { Set(s.libraryHidden.split(separator: "|").map(String.init)) }
private func toggle(_ name: String) { static func toggle(_ name: String, _ s: Settings) {
var h = hiddenSections var h = hidden(s)
if h.contains(name) { h.remove(name) } else { h.insert(name) } if h.contains(name) { h.remove(name) } else { h.insert(name) }
g.settings.libraryHidden = Self.sectionNames.filter(h.contains).joined(separator: "|") s.libraryHidden = sectionNames.filter(h.contains).joined(separator: "|")
} }
@ViewBuilder private func section(_ name: String) -> some View { @ViewBuilder private func section(_ name: String) -> some View {
@@ -88,8 +89,7 @@ struct LibraryHome: View {
] ]
let shown = ordered(stations) { $0.1 } let shown = ordered(stations) { $0.1 }
ForEach(shown, id: \.1) { st in ForEach(shown, id: \.1) { st in
LibraryRow(icon: st.0, title: st.1, last: st.1 == shown.last?.1, editing: editing, LibraryRow(icon: st.0, title: st.1, last: st.1 == shown.last?.1) { play(st.2) }
move: { move(st.1, $0, in: shown.map(\.1)) }) { play(st.2) }
} }
default: default:
// Every tab except Settings (and this one). // Every tab except Settings (and this one).
@@ -101,8 +101,7 @@ struct LibraryHome: View {
] ]
let shownRows = ordered(rows) { $0.1 } let shownRows = ordered(rows) { $0.1 }
ForEach(shownRows, id: \.1) { r in ForEach(shownRows, id: \.1) { r in
LibraryRow(icon: r.0, title: r.1, last: r.1 == shownRows.last?.1, editing: editing, LibraryRow(icon: r.0, title: r.1, last: r.1 == shownRows.last?.1) { ui.push(r.2) }
move: { move(r.1, $0, in: shownRows.map(\.1)) }) { ui.push(r.2) }
} }
} }
} }
@@ -119,24 +118,9 @@ struct LibraryHome: View {
} }
} }
if ready { if ready {
ForEach(shownSections, id: \.self) { name in // Order and visibility are set in Settings > Library Layout.
let off = hiddenSections.contains(name) let off = Self.hidden(s)
if editing { ForEach(shownSections.filter { !off.contains($0) }, id: \.self) { section($0) }
SectionEditBar(title: name, off: off,
move: { move(name, $0, in: shownSections) },
toggle: { toggle(name) })
}
if !off || editing {
section(name).opacity(off ? 0.35 : 1).allowsHitTesting(!editing || !off)
}
}
}
}
.toolbar {
if ready {
ToolbarItem(placement: .topBarTrailing) {
Button(editing ? "Done" : "Reorder") { withAnimation { editing.toggle() } }
}
} }
} }
.onChange(of: scenePhase) { _, ph in if ph == .active { reload += 1 } } .onChange(of: scenePhase) { _, ph in if ph == .active { reload += 1 } }
@@ -226,26 +210,6 @@ private struct RecentShelf: View {
} }
} }
/// Edit-mode header for a whole section: move it or switch it on/off.
private struct SectionEditBar: View {
let title: String
let off: Bool
let move: (Int) -> Void
let toggle: () -> Void
@Environment(\.palette) private var p
var body: some View {
HStack(spacing: 18) {
Text(title).font(.headline).foregroundStyle(p.label)
Spacer()
Image(systemName: off ? "eye.slash" : "eye").onTapGesture { toggle() }
Image(systemName: "chevron.up").onTapGesture { move(-1) }
Image(systemName: "chevron.down").onTapGesture { move(1) }
}
.font(.system(size: 17, weight: .semibold)).foregroundStyle(p.accent)
.padding(.horizontal, MARGIN).padding(.vertical, 10)
.background(p.label3.opacity(0.12))
}
}
private struct LibraryRow: View { private struct LibraryRow: View {
let icon: String let icon: String
+222 -106
View File
@@ -108,12 +108,16 @@ struct NowPlayingScreen: View {
@State private var tint: Color? @State private var tint: Color?
/// How far the screen is being dragged down to close it. /// How far the screen is being dragged down to close it.
@State private var drop: CGFloat = 0 @State private var drop: CGFloat = 0
/// Set once the phone has unfolded, so it's an iPhone Duo: its screens are shorter for their /// Docked beside the hinge the pane is narrow, so the controls pack tighter. Full screen
/// width than a regular iPhone's, so the controls pack tighter and the art gets the room. /// (folded or any other iPhone) uses the roomy layout across the whole window.
@AppStorage("duoSeen") private var duoSeen = false private var tight: Bool { docked }
private var tight: Bool { docked || duoSeen }
/// Size of the art panel in the stacked layout, so the controls can match the art's width. /// Size of the art panel in the stacked layout, so the controls can match the art's width.
@State private var artBox: CGSize = .zero @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
@Environment(\.verticalSizeClass) private var vSize
/// Folded iPhone Duo: the outer display keeps a status column down the right edge.
@State private var folded = false
private var artInset: CGFloat { tight ? 18 : 28 } private var artInset: CGFloat { tight ? 18 : 28 }
private var hPad: CGFloat { tight ? 20 : 28 } private var hPad: CGFloat { tight ? 20 : 28 }
private var g: AppGraph { .shared } private var g: AppGraph { .shared }
@@ -125,7 +129,8 @@ struct NowPlayingScreen: View {
// Wide when there's no room to stack art over controls: landscape, or iPhone Duo's // 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. // outer display. Tall layouts (including the unfolded Duo) cap the controls' width.
GeometryReader { geo in GeometryReader { geo in
let wide = geo.size.width > geo.size.height * 0.9 // 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)
if let track { if let track {
if wide { if wide {
// The column never drops below what the transport row needs, so the buttons // The column never drops below what the transport row needs, so the buttons
@@ -143,11 +148,12 @@ struct NowPlayingScreen: View {
let cap: CGFloat = tight ? 520 : 560 let cap: CGFloat = tight ? 520 : 560
// Controls line up with the art's edges instead of running wider than it. // 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 art = min(artBox.width - 2 * artInset, artBox.height - 16)
let w = panel == .Art && art > 0 ? min(cap, max(300, art + 2 * hPad)) : cap // Every panel keeps the art screen's width, so switching to the stems doesn't widen it.
let w = !docked ? geo.size.width : 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(maxWidth: panel == .Art ? .infinity : min(w, geo.size.width), maxHeight: .infinity)
.onGeometryChange(for: CGSize.self) { $0.size } action: { artBox = $0 } .onGeometryChange(for: CGSize.self) { $0.size } action: { if panel == .Art { artBox = $0 } }
.transition(.opacity.combined(with: .scale(scale: 0.96))) .transition(.opacity.combined(with: .scale(scale: 0.96)))
controls(track, wide: false, width: min(w, geo.size.width)).frame(maxWidth: w) controls(track, wide: false, width: min(w, geo.size.width)).frame(maxWidth: w)
} }
@@ -158,6 +164,12 @@ struct NowPlayingScreen: View {
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
} }
} }
// Folded, the iPhone Duo keeps a status column down the right edge. Run the player under it
// (it only overlaps the sliding preset chips) instead of leaving a quarter of the screen empty.
// Upright iPhones have no side insets, so this only changes the Duo.
.ignoresSafeArea(.container, edges: !docked && vSize == .regular ? .trailing : [])
// Measured outside the line above, so it still sees the status column.
.onGeometryChange(for: Bool.self) { $0.safeAreaInsets.trailing > 20 } action: { folded = $0 && vSize == .regular }
.padding(.top, docked ? 4 : tight ? 14 : 20) .padding(.top, docked ? 4 : tight ? 14 : 20)
.padding(.bottom, tight ? 4 : 8) .padding(.bottom, tight ? 4 : 8)
.frame(maxWidth: .infinity, maxHeight: .infinity) .frame(maxWidth: .infinity, maxHeight: .infinity)
@@ -167,18 +179,19 @@ struct NowPlayingScreen: View {
if !docked { Capsule().fill(c.label3).frame(width: 36, height: 5) if !docked { Capsule().fill(c.label3).frame(width: 36, height: 5)
.frame(width: 120, height: 20).contentShape(Rectangle()) .frame(width: 120, height: 20).contentShape(Rectangle())
.onTapGesture { dismiss() } .onTapGesture { dismiss() }
.gesture(screenDrag) } .gesture(screenDrag(header: true)) }
} }
.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { screenH = $0 }
.offset(y: drop) .offset(y: drop)
// On the art and the mixer: drag down anywhere to close, swipe up anywhere for the // Drag down from the top strip (or the song header) to close, so it never fights the
// queue. The queue and lyrics scroll, so there it's the song header or the grabber. // stem faders. Swipe up anywhere on the art for the queue.
.simultaneousGesture(screenDrag, including: panel == .Art || panel == .Mixer ? .all : .subviews) .simultaneousGesture(screenDrag(), including: panel == .Art ? .all : .subviews)
.environment(\.palette, c) .environment(\.palette, c)
.modifier(NpScheme(dark: c.dark, docked: docked)) .modifier(NpScheme(dark: c.dark, docked: docked))
.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)
@@ -188,14 +201,22 @@ 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: header || !tight ? artInset : 12).contentShape(Rectangle()) case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: header || !tight ? artInset : 12,
case .Mixer: VStack(spacing: 0) { if header { MiniHeader(track: track) }; MixerPanel() } leading: folded && !docked && !ui.split && g.settings.foldedArtLeft).contentShape(Rectangle())
case .Queue: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag) }; QueuePanel(close: { show(.Queue) }) } case .Mixer: VStack(spacing: 0) { if header { mini(track) }; MixerPanel(spread: folded) }
case .Lyrics: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag) }; LyricsPanel(track: track) } case .Queue: VStack(spacing: 0) { if header { mini(track) }; QueuePanel(close: { show(.Queue) }) }
case .Lyrics: VStack(spacing: 0) { if header { mini(track) }; LyricsPanel(track: track) }
} }
} }
/// Folded on the Duo the status column sits over the header's right end, so the menu goes.
private func mini(_ track: Track) -> some View {
MiniHeader(track: track, menu: !folded, compact: folded).contentShape(Rectangle()).gesture(screenDrag(header: true))
}
private func controls(_ track: Track, wide: Bool, width: CGFloat) -> some View { private func controls(_ track: Track, wide: Bool, width: CGFloat) -> some View {
// Folded, the controls keep the tight stems-panel spacing on every panel, so the art gets the room.
let snug = folded
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 let pad: CGFloat = wide && tight ? 14 : hPad
@@ -214,11 +235,11 @@ struct NowPlayingScreen: View {
Spacer(minLength: 8) Spacer(minLength: 8)
EllipsisButton(items: ui.menu.track(track)) EllipsisButton(items: ui.menu.track(track))
} }
.padding(.top, tight ? 8 : 14) .padding(.top, tight || snug ? 8 : 14)
.transition(.opacity.combined(with: .move(edge: .top))) .transition(.opacity.combined(with: .move(edge: .top)))
} }
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) : snug ? 14 : wide ? 24 : panel == .Art ? 34 : 30)
HStack(spacing: 0) { HStack(spacing: 0) {
SideToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle, width: narrow ? 36 : 40) SideToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle, width: narrow ? 36 : 40)
Spacer(minLength: 2) Spacer(minLength: 2)
@@ -239,13 +260,13 @@ struct NowPlayingScreen: View {
Spacer(minLength: 2) Spacer(minLength: 2)
SideToggle(symbol: pm.repeatMode == .One ? "repeat.1" : "repeat", on: pm.repeatMode != .Off, action: pm.cycleRepeat, width: narrow ? 36 : 40) 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 || snug ? 76 : 84)
.padding(.top, tight ? 4 : 14) .padding(.top, tight || snug ? 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.showsDeck && ui.deckPage == .Stems : 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 { if docked { withAnimation(.snappy) { ui.showDeck(.Eq) } } else { 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) }
if !hidden.contains(.Karaoke) { PanelToggle(symbol: "music.mic", on: pm.karaoke) { karaoke() } } if !hidden.contains(.Karaoke) { PanelToggle(symbol: "music.mic", on: pm.karaoke) { karaoke() } }
} }
@@ -254,9 +275,9 @@ struct NowPlayingScreen: View {
if !docked { Button { show(.Queue) } label: { if !docked { Button { show(.Queue) } label: {
VStack(spacing: 0) { VStack(spacing: 0) {
Image(systemName: panel == .Queue ? "chevron.compact.down" : "chevron.compact.up").font(.system(size: 22, weight: .medium)) Image(systemName: panel == .Queue ? "chevron.compact.down" : "chevron.compact.up").font(.system(size: 22, weight: .medium))
if panel != .Queue && !tight { Text("Playing Next").font(.caption2.weight(.medium)) } if panel != .Queue && !tight && !snug { Text("Playing Next").font(.caption2.weight(.medium)) }
} }
.foregroundStyle(c.label3).frame(maxWidth: .infinity, minHeight: tight ? 24 : 30).contentShape(Rectangle()) .foregroundStyle(c.label3).frame(maxWidth: .infinity, minHeight: tight || snug ? 24 : 30).contentShape(Rectangle())
} }
.buttonStyle(PressFade()) .buttonStyle(PressFade())
.gesture(swipe(up: panel != .Queue)) } .gesture(swipe(up: panel != .Queue)) }
@@ -268,6 +289,15 @@ struct NowPlayingScreen: View {
/// 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.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)) { 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)
@@ -277,7 +307,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(.Stems) } }; 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 }
} }
@@ -291,19 +322,22 @@ struct NowPlayingScreen: View {
} }
} }
private var screenDrag: some Gesture { /// 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 {
DragGesture(minimumDistance: 20) DragGesture(minimumDistance: 20)
.onChanged { v in .onChanged { v in
let dy = v.translation.height let dy = v.translation.height
drop = !docked && dy > 0 && dy > abs(v.translation.width) ? dy : 0 let top = header || v.startLocation.y < max(screenH * 0.1, 56)
drop = !docked && top && dy > 0 && dy > abs(v.translation.width) ? dy : 0
} }
.onEnded { v in .onEnded { v in
let dy = v.translation.height let dy = v.translation.height
let vertical = abs(dy) > abs(v.translation.width) let vertical = abs(dy) > abs(v.translation.width)
if !docked && vertical && (dy > 120 || v.predictedEndTranslation.height > 300) { dismiss(); return } let top = header || v.startLocation.y < max(screenH * 0.1, 56)
if !docked && top && 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 }
} }
} }
@@ -460,14 +494,16 @@ private struct ArtPanel: View {
let thumb: String? let thumb: String?
let playing: Bool let playing: Bool
var inset: CGFloat = 28 var inset: CGFloat = 28
/// Settings > Appearance, folded Duo only: art against the left edge.
var leading = false
var body: some View { var body: some View {
GeometryReader { geo in GeometryReader { geo in
let side = max(min(geo.size.width, geo.size.height), 1) let side = max(min(geo.size.width, geo.size.height), 1)
Artwork(thumb: thumb, size: side, corner: 12) Artwork(thumb: thumb, size: side, corner: 12)
.shadow(color: .black.opacity(playing ? 0.35 : 0.15), radius: playing ? 24 : 10, y: 10) .shadow(color: .black.opacity(playing ? 0.35 : 0.15), radius: playing ? 24 : 10, y: 10)
.scaleEffect(playing ? 1 : 0.82) .scaleEffect(playing ? 1 : 0.82, anchor: leading ? .leading : .center)
.animation(.spring(response: 0.45, dampingFraction: 0.62), value: playing) .animation(.spring(response: 0.45, dampingFraction: 0.62), value: playing)
.frame(width: geo.size.width, height: geo.size.height) .frame(width: geo.size.width, height: geo.size.height, alignment: leading ? .leading : .center)
} }
.padding(.horizontal, inset).padding(.vertical, 8) .padding(.horizontal, inset).padding(.vertical, 8)
} }
@@ -475,19 +511,21 @@ private struct ArtPanel: View {
private struct MiniHeader: View { private struct MiniHeader: View {
let track: Track let track: Track
var menu = true
var compact = false
@Environment(Ui.self) private var ui @Environment(Ui.self) private var ui
@Environment(\.palette) private var p @Environment(\.palette) private var p
var body: some View { var body: some View {
HStack(spacing: 14) { HStack(spacing: 14) {
Artwork(thumb: track.thumb, size: 64, corner: 8) Artwork(thumb: track.thumb, size: compact ? 52 : 64, corner: 8)
VStack(alignment: .leading, spacing: 1) { VStack(alignment: .leading, spacing: 1) {
Text(track.title).font(.headline).foregroundStyle(p.label).lineLimit(1) Text(track.title).font(.headline).foregroundStyle(p.label).lineLimit(1)
Text(track.artist).font(.subheadline).foregroundStyle(p.label2).lineLimit(1) Text(track.artist).font(.subheadline).foregroundStyle(p.label2).lineLimit(1)
} }
Spacer(minLength: 8) Spacer(minLength: 8)
EllipsisButton(items: ui.menu.track(track)) if menu { EllipsisButton(items: ui.menu.track(track)) }
} }
.padding(.horizontal, 24).padding(.vertical, 10) .padding(.horizontal, 24).padding(.vertical, compact ? 6 : 10)
} }
} }
@@ -688,9 +726,12 @@ private struct MixerPanel: View {
/// The iPhone Duo deck: each stem's name sits over its fader so the fader gets the row's full /// The iPhone Duo deck: each stem's name sits over its fader so the fader gets the row's full
/// width, with a bigger thumb for fine moves. /// width, with a bigger thumb for fine moves.
var roomy = false var roomy = false
/// Folded Duo: the outer display is short, so rows get a taller floor (it scrolls sooner).
var spread = false
@Environment(Ui.self) private var ui @Environment(Ui.self) private var ui
@Environment(\.palette) private var p @Environment(\.palette) private var p
@State private var meters = Meters() @State private var meters = Meters()
@State private var chipsH: CGFloat = 48
private var g: AppGraph { .shared } private var g: AppGraph { .shared }
var body: some View { var body: some View {
@@ -700,8 +741,12 @@ private struct MixerPanel: View {
GeometryReader { geo in GeometryReader { geo in
// Spread spare height across the stem rows instead of leaving it all at the bottom. // Spread spare height across the stem rows instead of leaving it all at the bottom.
let count = CGFloat(max(names.count, 1)) let count = CGFloat(max(names.count, 1))
let rowH = roomy ? min(80, max(Self.roomyRow, (geo.size.height - Self.roomyChrome) / count)) // Rows shrink to fit every stem before anything has to scroll (the folded outer display is short).
: min(62, max(46, (geo.size.height - 64) / count)) // Roomy (the unfolded deck), the rows share every point under the chips down to the bottom.
let rowH = roomy ? max(Self.roomyMin, (geo.size.height - chipsH - 8) / count)
: min(62, max(spread ? Self.foldedMin : Self.compactMin, (geo.size.height - chipsH - 8) / count))
// Gap above the rows that centres them on the whole panel, not just the space under the chips.
let lead = max(0, (geo.size.height - rowH * count) / 2 - chipsH)
ScrollView { ScrollView {
VStack(alignment: .leading, spacing: 0) { VStack(alignment: .leading, spacing: 0) {
if pm.source == .Original { if pm.source == .Original {
@@ -711,55 +756,17 @@ 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) { // One sliding row of chips, running out to the screen edges so none looks cut off mid-pane.
HStack(spacing: 8) { ScrollView(.horizontal) {
let current = MixPresets.normalized(pm.mix) HStack(spacing: 8) { saveChips(pm); presetChips(pm, names) }.padding(.horizontal, 24)
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(.leading, -24).padding(.trailing, roomy ? -6 : -24)
.padding(.vertical, 8)
.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { chipsH = $0 }
} }
// Rows sit centred on the panel; what's left after them goes below.
Color.clear.frame(height: pm.source == .Original ? 0 : lead)
// 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
let levels = stems ? meters.step(pm.engine, names.count) : [] let levels = stems ? meters.step(pm.engine, names.count) : []
@@ -769,9 +776,11 @@ private struct MixerPanel: View {
} }
} }
} }
Spacer(minLength: roomy ? 8 : 16) Spacer(minLength: 8)
} }
.padding(.horizontal, 24) // Roomy, the faders run right up to the hinge.
.padding(.leading, 24).padding(.trailing, roomy ? 6 : 24)
.frame(minHeight: geo.size.height)
} }
.scrollIndicators(.hidden) .scrollIndicators(.hidden)
// Holds still when everything fits, so a drag down closes Now Playing instead. // Holds still when everything fits, so a drag down closes Now Playing instead.
@@ -781,9 +790,67 @@ private struct MixerPanel: View {
} }
extension MixerPanel { 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 static let roomyRow: CGFloat = 66
/// Shortest stacked row: name line, fader and the gap under it.
static let roomyMin: CGFloat = 68
/// Shortest side-by-side row, the fader's own height.
static let compactMin: CGFloat = 30
static let foldedMin: CGFloat = 40
/// Preset chips plus the bottom gap. /// Preset chips plus the bottom gap.
static let roomyChrome: CGFloat = 56 static let roomyChrome: CGFloat = 56
static let compactChrome: CGFloat = 56
/// Height that shows the presets and every stem without scrolling, roomy rows. /// Height that shows the presets and every stem without scrolling, roomy rows.
static func roomyHeight(_ stems: Int) -> CGFloat { roomyChrome + CGFloat(stems) * roomyRow } static func roomyHeight(_ stems: Int) -> CGFloat { roomyChrome + CGFloat(stems) * roomyRow }
} }
@@ -823,7 +890,7 @@ 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) {
// Live level, -48..0 dBFS, drawn as a light band inside the fader's fill. // Live level, -48..0 dBFS, drawn bright over the dimmed fill.
let f = CGFloat(min(1, max(0, (20 * log10(level + 1e-5) + 48) / 48))) 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) { 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) pm.setStemLevel(name, $0)
@@ -853,7 +920,7 @@ struct FaderRow<Fader: View, Trailing: View>: View {
var body: some View { var body: some View {
if stacked { if stacked {
// Bottom-aligned with a gap under, so each name sits clear of the meter above it. // Bottom-aligned with a gap under, so each name sits clear of the meter above it.
VStack(alignment: .leading, spacing: 2) { VStack(alignment: .leading, spacing: 6) {
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)
@@ -863,8 +930,8 @@ struct FaderRow<Fader: View, Trailing: View>: View {
.frame(height: 18) .frame(height: 18)
HStack(spacing: 8) { fader; trailing } HStack(spacing: 8) { fader; trailing }
} }
.padding(.bottom, 4) // Centred in its slot, so tall rows keep even gaps above and below.
.frame(height: height, alignment: .bottom) .frame(height: height)
} else { } else {
row row
} }
@@ -912,7 +979,7 @@ 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 as a lighter band over the filled part of the track. /// 0...1 live level, shown in the full fill colour over the dimmed filled part of the track.
var meter: CGFloat? var meter: CGFloat?
let onChange: (Float) -> Void let onChange: (Float) -> Void
@@ -924,7 +991,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 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) : 6 } 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
@@ -932,9 +999,12 @@ 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 { if let meter, meter > 0.01 {
Capsule().fill(.white.opacity(0.5)).frame(width: meter * (x + thumb / 2), height: bar) 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) .padding(.leading, thumb / 2 - 0.01)
.animation(.linear(duration: 1 / 30), value: meter) .animation(.linear(duration: 1 / 30), value: meter)
} }
@@ -967,48 +1037,94 @@ 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 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.
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 }
var body: some View { var body: some 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 { _ 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) Group {
// As much as the stems need to show without scrolling, leaving the queue a few rows. switch ui.deckPage {
MixerPanel(roomy: true).frame(height: min(MixerPanel.roomyHeight(max(g.playback.stemNames.count, 4)), geo.size.height * 0.72)) case .Stems: MixerPanel(roomy: true)
Rectangle().fill(c.label3.opacity(0.35)).frame(height: 0.5).padding(.horizontal, 24).padding(.bottom, 8) case .Lyrics: LyricsPanel(track: track)
QueuePanel() case .Queue: QueuePanel(title: false)
case .Eq: DeckEqPanel()
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
.transition(.opacity)
} }
} 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.deckPage)
.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)
} }
} }
/// 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)
if duoSwapEnabled {
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 ---------------------------------------------------------------------------------- // ---- queue ----------------------------------------------------------------------------------
private struct QueuePanel: View { private struct QueuePanel: View {
var close: () -> Void = {} 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 @Environment(\.palette) private var p
private var g: AppGraph { .shared } private var g: AppGraph { .shared }
@@ -1019,8 +1135,8 @@ private struct QueuePanel: View {
VStack(spacing: 0) { VStack(spacing: 0) {
HStack(spacing: 8) { HStack(spacing: 8) {
VStack(alignment: .leading, spacing: 1) { VStack(alignment: .leading, spacing: 1) {
Text("Playing Next").font(.headline).foregroundStyle(p.label) if title { Text("Playing Next").font(.headline).foregroundStyle(p.label) }
Text(songs(upcoming.count)).font(.footnote).foregroundStyle(p.label2) Text(songs(upcoming.count)).font(title ? .footnote : .subheadline).foregroundStyle(p.label2)
} }
Spacer() Spacer()
QueueToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle) QueueToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle)
+44 -1
View File
@@ -232,6 +232,7 @@ struct SettingsScreen: View {
Section { Section {
NavCell(title: "Equalizer", value: !g.eq.state.enabled ? "Off" : g.eq.active?.name ?? "On", icon: "slider.vertical.3", iconBg: 0x34C759, route: .Eq) NavCell(title: "Equalizer", value: !g.eq.state.enabled ? "Off" : g.eq.active?.name ?? "On", icon: "slider.vertical.3", iconBg: 0x34C759, route: .Eq)
NavCell(title: "Appearance", value: s.theme.label, icon: "paintbrush.fill", iconBg: 0x007AFF, route: .Appearance) NavCell(title: "Appearance", value: s.theme.label, icon: "paintbrush.fill", iconBg: 0x007AFF, route: .Appearance)
NavCell(title: "Library Layout", value: nil, icon: "books.vertical.fill", iconBg: 0xFF9F0A, route: .LibraryLayout)
} header: { Header(text: "Sound and look") } } header: { Header(text: "Sound and look") }
Section { Section {
StepperCell(title: "Cache Ahead", value: $s.precacheCount, icon: "arrow.down.to.line", iconBg: 0xFF9500) StepperCell(title: "Cache Ahead", value: $s.precacheCount, icon: "arrow.down.to.line", iconBg: 0xFF9500)
@@ -282,6 +283,45 @@ struct SettingsScreen: View {
} }
} }
// ---- library layout -------------------------------------------------------------------------
/// The Library tab's section order and which sections show, plus the order of its station and
/// browse rows. Always in edit mode, so the drag handles are right there.
struct LibraryLayoutScreen: View {
private var g: AppGraph { .shared }
var body: some View {
let s = g.settings
let off = LibraryHome.hidden(s)
List {
Section {
ForEach(LibraryHome.ordered(LibraryHome.sectionNames, s) { $0 }, id: \.self) { name in
Toggle(name, isOn: Binding(get: { !off.contains(name) }, set: { _ in LibraryHome.toggle(name, s) }))
.themedRow()
}
.onMove { LibraryHome.reorder(LibraryHome.sectionNames, from: $0, to: $1, s) }
} header: { Header(text: "Sections") } footer: {
Footer(text: "Drag to reorder. Switch a section off to hide it from Library.")
}
rows("Stations", LibraryHome.stationNames, s)
rows("Browse", LibraryHome.browseNames, s)
}
.listStyle(.insetGrouped)
.listSectionSpacing(22)
.environment(\.editMode, .constant(.active))
.themedList()
.navigationTitle("Library Layout")
.navigationBarTitleDisplayMode(.inline)
}
private func rows(_ title: String, _ names: [String], _ s: Settings) -> some View {
Section {
ForEach(LibraryHome.ordered(names, s) { $0 }, id: \.self) { Text($0).themedRow() }
.onMove { LibraryHome.reorder(names, from: $0, to: $1, s) }
} header: { Header(text: title) }
}
}
// ---- about ---------------------------------------------------------------------------------- // ---- about ----------------------------------------------------------------------------------
private struct Maintainer: Identifiable { private struct Maintainer: Identifiable {
@@ -989,7 +1029,10 @@ struct AppearanceScreen: View {
Toggle(isOn: $s.albumColorNowPlaying) { Text("Album Colour Background").foregroundStyle(c.label) } Toggle(isOn: $s.albumColorNowPlaying) { Text("Album Colour Background").foregroundStyle(c.label) }
.tint(Color(hex: 0x34C759)) .tint(Color(hex: 0x34C759))
.themedRow() .themedRow()
} header: { Header(text: "Now Playing") } footer: { Footer(text: "Paints the Now Playing screen in one solid colour taken from the album art.") } Toggle(isOn: $s.foldedArtLeft) { Text("Left-Align Art When Folded").foregroundStyle(c.label) }
.tint(Color(hex: 0x34C759))
.themedRow()
} header: { Header(text: "Now Playing") } footer: { Footer(text: "Album Colour paints the Now Playing screen in one solid colour taken from the album art. Left-Align moves the art to the left edge on the folded iPhone Duo.") }
Section { Section {
Toggle(isOn: $s.acapella) { Text("Spell It “Acapella”").foregroundStyle(c.label) } Toggle(isOn: $s.acapella) { Text("Spell It “Acapella”").foregroundStyle(c.label) }
.tint(Color(hex: 0x34C759)) .tint(Color(hex: 0x34C759))
+7 -1
View File
@@ -65,9 +65,15 @@ extension View {
private struct ThemedList: ViewModifier { private struct ThemedList: ViewModifier {
@Environment(\.palette) private var p @Environment(\.palette) private var p
@Environment(Ui.self) private var ui
let grouped: Bool let grouped: Bool
func body(content: Content) -> some View { func body(content: Content) -> some View {
content.scrollContentBackground(.hidden).background(grouped ? p.groupedBg : p.bg) content.scrollContentBackground(.hidden)
// Split on the Duo the window is wide enough to count as regular, so inset lists took
// iPad-sized margins. Each pane is phone-sized, so lay lists out like a phone.
.transformEnvironment(\.horizontalSizeClass) { if ui.split { $0 = .compact } }
.modifier(HingeEdge())
.background(grouped ? p.groupedBg : p.bg)
} }
} }
+6 -3
View File
@@ -7,13 +7,15 @@ settings:
base: base:
SWIFT_VERSION: "5.0" SWIFT_VERSION: "5.0"
# 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: "0.9.0"
VERSION_LABEL: "1.0 RC 4" VERSION_LABEL: "0.9.0"
CURRENT_PROJECT_VERSION: "24" CURRENT_PROJECT_VERSION: "34"
# 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
# Info key StemifyChannel: "dev" on dev builds (build-ipa.sh dev).
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]
+10 -3
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,7 +20,14 @@ 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
# "1.0 RC 1" -> 1.0-rc1, used in file names and release tags. # 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') 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 +42,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 MARKETING_VERSION=$MV 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; }
+5 -4
View File
@@ -10,11 +10,12 @@ API=https://git.iamchrisama.com/api/v1/repos/cdnutter/stemify
T=$(sed -n 's#.*://cdnutter:\([^@]*\)@.*#\1#p' ~/.config/gitea/cdnutter.credentials | head -1) T=$(sed -n 's#.*://cdnutter:\([^@]*\)@.*#\1#p' ~/.config/gitea/cdnutter.credentials | head -1)
V=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml | tr 'A-Z' 'a-z' | sed -E 's/ (rc|beta) /-\1/; s/ /-/g') V=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml | tr 'A-Z' 'a-z' | sed -E 's/ (rc|beta) /-\1/; s/ /-/g')
BUILD=$(sed -nE 's/^ *CURRENT_PROJECT_VERSION: "(.*)"/\1/p' project.yml) BUILD=$(sed -nE 's/^ *CURRENT_PROJECT_VERSION: "(.*)"/\1/p' project.yml)
LABEL=$(sed -nE 's/^ *VERSION_LABEL: "(.*)"/\1/p' project.yml)
BRANCH=$(git rev-parse --abbrev-ref HEAD) 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=dev' ;; dev) WANT=dev; IPA=build/dev/$NAME-$V-dev.ipa; TAG=$TAGP$V-dev.$BUILD; TITLE="Stemify iOS $LABEL Dev Build $BUILD"; PRE=true; UP=http://10.0.0.11:8093; Q='?source=dev' ;;
release) WANT=main; IPA=build/release/$NAME-$V.ipa; TAG=$TAGP$V; PRE=false; UP=http://10.0.0.11:8093; Q='?source=personal' ;; release) WANT=main; IPA=build/release/$NAME-$V.ipa; TAG=$TAGP$V; TITLE="Stemify iOS $LABEL"; 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)"
@@ -24,8 +25,8 @@ git diff --quiet HEAD || die "uncommitted changes"
|| die "$TAG already exists, bump CURRENT_PROJECT_VERSION (dev) or VERSION_LABEL (release)" || die "$TAG already exists, bump CURRENT_PROJECT_VERSION (dev) or VERSION_LABEL (release)"
git push -q -u origin $BRANCH git push -q -u origin $BRANCH
BODY=${NOTES:-$(git log -1 --format=%s)} BODY=${NOTES:-$(git log -1 --format=%s)}
ID=$(jq -n --arg t "$TAG" --arg c "$(git rev-parse HEAD)" --arg b "$BODY" --argjson p $PRE \ ID=$(jq -n --arg t "$TAG" --arg n "$TITLE" --arg c "$(git rev-parse HEAD)" --arg b "$BODY" --argjson p $PRE \
'{tag_name:$t, target_commitish:$c, name:$t, body:$b, prerelease:$p}' | '{tag_name:$t, target_commitish:$c, name:$n, body:$b, prerelease:$p}' |
curl -fsS -H "Authorization: token $T" -H 'Content-Type: application/json' -d @- $API/releases | jq -r .id) curl -fsS -H "Authorization: token $T" -H 'Content-Type: application/json' -d @- $API/releases | jq -r .id)
curl -fsS -o /dev/null -H "Authorization: token $T" -F "attachment=@$IPA" "$API/releases/$ID/assets?name=$(basename $IPA)" curl -fsS -o /dev/null -H "Authorization: token $T" -F "attachment=@$IPA" "$API/releases/$ID/assets?name=$(basename $IPA)"
curl -fsS -o /dev/null -X POST --data-binary @$IPA "$UP/api/upload/ipa$Q" curl -fsS -o /dev/null -X POST --data-binary @$IPA "$UP/api/upload/ipa$Q"
+7 -197
View File
@@ -16,203 +16,13 @@
"category": "entertainment", "category": "entertainment",
"versions": [ "versions": [
{ {
"version": "1.0", "version": "0.9.0",
"marketingVersion": "1.0 RC 4", "marketingVersion": "0.9.0",
"buildVersion": "24", "buildVersion": "31",
"date": "2026-11-18T13:39:57-08:00", "date": "2026-11-18T17:21:50-08:00",
"localizedDescription": "Duo layout fixes for every fold and orientation", "localizedDescription": "Stemify iOS 0.9.0: Duo split layout, Library Layout in Settings, folded Duo fixes.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc4/stemify-1.0-rc4.ipa", "downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v0.9.0/stemify-0.9.0.ipa",
"size": 2650316, "size": 2710062,
"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" "minOSVersion": "17.0"
} }
], ],