Compare commits

...
Author SHA1 Message Date
rootandClaude Opus 5.5 8c8157c489 Folded Now Playing: use the bottom space, bigger art (dev 39)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:14:49 -08:00
rootandClaude Opus 5.5 1d7576371a Play from Plex when the stem server is off or unreachable (dev 38)
Stems are used only when the stem server is online or they're fully
downloaded. A failed stem open falls back to Plex's own file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 17:10:19 -08:00
rootandClaude Opus 5.5 ac0e962105 New app icon: glowing stem-colored capsules on a night gradient (dev 37)
Generator in ios/scripts/make-icon.py renders release, dev (sash),
dark and tinted variants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 16:59:51 -08:00
rootandClaude Opus 5.5 e02428ab70 Re-pick Plex server address on network change, foreground, and stream failure (dev 36)
The address chosen at sign-in (LAN first) was kept forever, so away from
home streams hit a dead LAN address (TLS error) or the relay (503). Store
every address plex.tv lists, probe them all bypassing the offline cache,
and keep the best one that answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:56:02 -08:00
rootandClaude Opus 5.5 9f68aa588b Dev 35: Duo orientation lock, folded portrait only, unfolded landscape only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:41:59 -08:00
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 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 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 3a3a20107b 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:36 -08:00
22 changed files with 493 additions and 340 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
+8
View File
@@ -45,6 +45,14 @@ final class AppGraph {
mediaSession = URLSession(configuration: m)
plex = PlexClient(http: apiHttp, settings: settings)
let plex = plex
// Left home or joined Wi-Fi: the saved Plex address may be dead now. Give the new link a moment first.
net.onChange {
Task.detached {
try? await Task.sleep(nanoseconds: 1_500_000_000)
await plex.reroute("network changed")
}
}
reach = HomeReach(settings: settings, net: net)
let reach = reach
carHttp.forceCache = { !reach.lastKnown }
+20
View File
@@ -20,12 +20,31 @@ final class AppDelegate: NSObject, UIApplicationDelegate {
return UISceneConfiguration(name: "Phone", sessionRole: session.role)
}
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
Orientation.mask
}
/// Siri: "Play <album> on Stemify".
func application(_ application: UIApplication, handlerFor intent: INIntent) -> Any? {
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
/// Folded Duo: portrait only. Unfolded Duo: landscape only. Anything else turns freely.
@MainActor static func lock(_ m: UIInterfaceOrientationMask) {
guard m != mask else { return }
mask = m
for case let scene as UIWindowScene in UIApplication.shared.connectedScenes {
scene.keyWindow?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations()
if m != .allButUpsideDown { scene.requestGeometryUpdate(.iOS(interfaceOrientations: m)) { _ in } }
}
}
}
@main
struct StemifyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) private var delegate
@@ -39,6 +58,7 @@ struct StemifyApp: App {
AppActivity.setPhone(p != .background)
guard p == .active else { return }
AppGraph.shared.eq.refreshRoute()
Task.detached { await AppGraph.shared.plex.reroute("foreground") }
// Keep downloaded playlists in step with the server, like Plexamp.
Task { await AppGraph.shared.downloads.refresh() }
}
+3 -1
View File
@@ -109,7 +109,7 @@ final class Settings: @unchecked Sendable {
"servers", "plexUrl", "plexToken", "plexUser", "plexMachineId", "musicSection", "musicSectionTitle",
"stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumColorNowPlaying", "highRefreshRate",
"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 {
@@ -220,6 +220,8 @@ final class Settings: @unchecked Sendable {
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 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 stemQuality: StemQuality { get { readEnum(\.stemQuality, "stemQuality", .High) } set { writeEnum(\.stemQuality, "stemQuality", newValue, .High) } }
+46 -8
View File
@@ -639,7 +639,7 @@ final class PlaybackManager: StemEngineListener, @unchecked Sendable {
/// True when [track] would play without the home network: its stems (or, lacking stems, its file) are fully cached.
func playableOffline(_ track: Track) -> Bool {
if let entry = stems.find(track) {
return StemQuality.allCases.contains { q in entry.stems.allSatisfy { cache.isComplete(Self.stemKey(entry, $0.file, $0.size, q)) } }
return stemsCached(entry)
}
return track.partKey != nil && cache.isComplete(Self.plexKey(track))
}
@@ -721,19 +721,57 @@ final class PlaybackManager: StemEngineListener, @unchecked Sendable {
}
private func openDetached(_ track: Track, _ startMs: Int64) async throws -> (TrackSession, StemEntry?) {
// Plain Plex files need a playback session first, or a Remote Access upload limit fails them.
var stream: URL?
if stems.find(track) == nil, !cache.isComplete(Self.plexKey(track)) { stream = await plex.streamUrl(track) }
return try await withCheckedThrowingContinuation { [stream] cont in
// Stems when the stem server can serve them (or they're downloaded); Plex's own file otherwise.
// Stemify works as a plain Plex player: a stem server that's off or out of reach only costs the stems.
if let entry = await stemsToPlay(track) {
do {
return try await openOn(track, startMs, entry, nil)
} catch {
if Task.isCancelled { throw error }
Log.shared.error("play", "stems for \(track.title) failed (\(error.localizedDescription)), playing from Plex")
Task.detached { [stems] in await stems.refresh() }
}
}
let plain = !cache.isComplete(Self.plexKey(track))
let stream = plain ? await plex.streamUrl(track) : nil
do {
return try await openOn(track, startMs, nil, stream)
} catch {
// A dead saved address (left home, network changed): pick a working one and try once more.
guard plain, !Task.isCancelled, await plex.reroute("stream failed") else { throw error }
return try await openOn(track, startMs, nil, await plex.streamUrl(track))
}
}
/// The stem entry to play, or nil to play Plex's file: skips stems the stem server can't
/// serve right now unless they're fully downloaded.
private func stemsToPlay(_ track: Track) async -> StemEntry? {
guard let entry = stems.find(track) else { return nil }
if stemsCached(entry) { return entry }
// Right after launch the first check may still be running: give it a few seconds
// rather than sit through a long timeout on a server that isn't there.
var waited = 0
while case .unknown = stems.status, waited < 30, !Task.isCancelled {
try? await Task.sleep(nanoseconds: 100_000_000); waited += 1
}
if case .online = stems.status { return entry }
return nil
}
private func stemsCached(_ entry: StemEntry) -> Bool {
StemQuality.allCases.contains { q in entry.stems.allSatisfy { cache.isComplete(Self.stemKey(entry, $0.file, $0.size, q)) } }
}
private func openOn(_ track: Track, _ startMs: Int64, _ entry: StemEntry?, _ stream: URL?) async throws -> (TrackSession, StemEntry?) {
try await withCheckedThrowingContinuation { cont in
DispatchQueue.global(qos: .userInitiated).async { [self] in
cont.resume(with: Result { try open(track, startMs, stream: stream) })
cont.resume(with: Result { try open(track, startMs, entry: entry, stream: stream) })
}
}
}
/// Opens every stem (or the original file) and waits for the decoders to know their format.
private func open(_ track: Track, _ startMs: Int64, stream: URL? = nil) throws -> (TrackSession, StemEntry?) {
let entry = stems.find(track)
private func open(_ track: Track, _ startMs: Int64, entry: StemEntry?, stream: URL? = nil) throws -> (TrackSession, StemEntry?) {
var sources: [(name: String, key: String, url: URL?, hint: String)] = []
if let entry {
let q = qualityFor(entry)
+3
View File
@@ -17,6 +17,9 @@ struct MediaServer: Codable, Hashable, Identifiable {
var machineId = ""
var sections: [String] = []
var sectionTitles = ""
/// Every address plex.tv lists for this server, best first (local, remote, relay).
/// Optional so servers saved before it still decode.
var connections: [String]? = nil
var signedIn: Bool { !token.isEmpty }
var ready: Bool { signedIn && !sections.isEmpty }
+41
View File
@@ -21,6 +21,7 @@ final class PlexClient: @unchecked Sendable {
private let lock = NSLock()
private var builtFrom = "\u{0}"
private var built: [MediaSource] = []
private var rerouting = false
init(http: Http, settings: Settings) {
self.http = http
@@ -285,6 +286,45 @@ final class PlexClient: @unchecked Sendable {
return box.url
}
// ---- address re-picking ------------------------------------------------------------
/// Re-picks each Plex server's address. Sign-in picks one (a LAN address at home) and it
/// used to stick forever, so away from home every stream hit a dead LAN address (TLS error)
/// or a relay (503). Probes every known address and keeps the best one that answers;
/// when none answer, asks plex.tv for the current list. Returns true if any address changed.
@discardableResult
func reroute(_ why: String) async -> Bool {
lock.lock()
if rerouting { lock.unlock(); return false }
rerouting = true
lock.unlock()
defer { lock.lock(); rerouting = false; lock.unlock() }
let tv = plexTv()
var changed = false
for srv in settings.servers where srv.kind == .plex && srv.signedIn {
var uris = srv.connections ?? []
if !uris.contains(srv.base) { uris.append(srv.base) }
var best = await tv.firstAlive(uris, machineId: srv.machineId, token: srv.token)
var fresh: [String]?
if best == nil || srv.connections == nil, !srv.machineId.isEmpty,
let r = (try? await tv.resources(token: srv.token))?.first(where: { $0.clientIdentifier == srv.machineId }) {
fresh = PlexServer.ranked(r)
if best == nil, let f = fresh { best = await tv.firstAlive(f, machineId: srv.machineId, token: srv.token) }
}
var s = srv
if let fresh { s.connections = fresh }
if let best { s.url = best }
guard s != srv else { continue }
if s.url != srv.url {
changed = true
Log.shared.info("plex", "\(srv.label) (\(why)): \(srv.base) -> \(s.base)")
}
settings.save(s)
}
return changed
}
// ---- sign-in helpers --------------------------------------------------------------
/// A Plex client for plex.tv calls and for a server that isn't saved yet.
@@ -323,6 +363,7 @@ final class PlexClient: @unchecked Sendable {
?? settings.servers.first { $0.kind == .plex && $0.machineId.isEmpty && $0.base == h.url.trimmingCharacters(in: CharacterSet(charactersIn: "/")) }
var srv = known ?? MediaServer(id: settings.nextServerId(), kind: .plex)
srv.url = h.url
srv.connections = PlexServer.ranked(h.res)
srv.token = h.res.accessToken.isEmpty ? token : h.res.accessToken
srv.machineId = h.res.clientIdentifier
srv.user = user
+33 -13
View File
@@ -375,21 +375,41 @@ final class PlexServer: MediaSource, @unchecked Sendable {
/// The first address that answers /identity as the expected server, local ones first, relay last.
func reach(_ r: PlexResource, userToken: String) async -> String? {
let tok = r.accessToken.isEmpty ? userToken : r.accessToken
let ordered = r.connections.filter { !$0.uri.isEmpty }.sorted { rank($0) < rank($1) }
for c in ordered {
let base = c.uri.trimmingCharacters(in: CharacterSet(charactersIn: "/"))
guard let u = URL(string: base + "/identity") else { continue }
var req = request(u, withToken: false)
req.setValue(tok, forHTTPHeaderField: "X-Plex-Token")
req.timeoutInterval = 3.5
guard let body = try? await http.data(req),
let id = try? decode(body).machineIdentifier, id == r.clientIdentifier || r.clientIdentifier.isEmpty else { continue }
return base
}
return nil
return await firstAlive(Self.ranked(r), machineId: r.clientIdentifier, token: tok)
}
private func rank(_ c: PlexResource.Connection) -> Int { c.relay ? 2 : (c.local ? 0 : 1) }
/// A resource's addresses, local first, then remote, relay last.
static func ranked(_ r: PlexResource) -> [String] {
r.connections.filter { !$0.uri.isEmpty }
.sorted { ($0.relay ? 2 : ($0.local ? 0 : 1)) < ($1.relay ? 2 : ($1.local ? 0 : 1)) }
.map { $0.uri.trimmingCharacters(in: CharacterSet(charactersIn: "/")) }
}
/// Probes every address's /identity at once, straight to the network (the offline cache
/// would make a dead LAN address look alive), and returns the earliest one in [uris] that
/// answers as [machineId].
func firstAlive(_ uris: [String], machineId: String, token: String, timeout: TimeInterval = 4) async -> String? {
let bases = uris.map { $0.trimmingCharacters(in: CharacterSet(charactersIn: "/")) }
let alive: [Int] = await withTaskGroup(of: Int?.self) { group in
for (i, b) in bases.enumerated() {
group.addTask { [self] in
guard let u = URL(string: b + "/identity") else { return nil }
var req = request(u, withToken: false)
req.setValue(token, forHTTPHeaderField: "X-Plex-Token")
req.timeoutInterval = timeout
guard let (body, resp) = try? await http.session.data(for: req),
(resp as? HTTPURLResponse)?.statusCode == 200,
let id = try? decode(body).machineIdentifier,
machineId.isEmpty || id == machineId else { return nil }
return i
}
}
var out: [Int] = []
for await i in group { if let i { out.append(i) } }
return out
}
return alive.min().map { bases[$0] }
}
func checkPin(_ id: Int64) async throws -> PlexPin {
let req = request(URL(string: "https://plex.tv/api/v2/pins/\(id)")!, withToken: false)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 246 KiB

+14 -4
View File
@@ -298,21 +298,31 @@ 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.
struct Page<Content: View>: View {
let title: String
var large = true
@ViewBuilder let content: () -> Content
@Environment(\.palette) private var p
@Environment(Ui.self) private var ui
@AppStorage("duoSwap") private var swap = false
var body: some View {
ScrollView {
LazyVStack(alignment: .leading, spacing: 0) { content() }
.padding(.bottom, 24)
}
// Split at the iPhone Duo's hinge, rows run right up to it (no inset is real on that side).
.ignoresSafeArea(.container, edges: ui.split ? (swap ? .leading : .trailing) : [])
.modifier(HingeEdge())
.background(p.bg)
.navigationTitle(title)
.navigationBarTitleDisplayMode(large ? .large : .inline)
+27 -1
View File
@@ -52,7 +52,7 @@ enum DeckPage: String, CaseIterable, Hashable {
enum Route: Hashable {
case Artists, Albums, Songs, RecentlyAdded, Playlists, Genres, Downloads, DownloadQueue, TabBar, WebRadio
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)
}
@@ -120,9 +120,35 @@ final class Ui {
/// Split only: brings the stems and queue (or the lyrics) back beside Now Playing.
func showDeck(_ page: DeckPage? = nil) { deck = true; if let page { deckPage = page } }
/// 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")
}
lockOrientation()
}
/// Split (unfolded) goes landscape at once. Portrait waits a moment and checks again, so a
/// frame without a hinge reading mid-rotation can't throw an unfolded phone back upright.
private func lockOrientation() {
if split { Orientation.lock(.landscape); return }
guard folded else { Orientation.lock(.allButUpsideDown); return }
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(400))
if self.folded { Orientation.lock(.portrait) }
}
}
func setSplit(_ on: Bool) {
guard on != split else { return }
split = on
lockOrientation()
if on {
nowPlayingOpen = false
}
+50 -22
View File
@@ -11,28 +11,10 @@ struct RootView: View {
var body: some View {
let s = g.settings
let p = Palette.of(s.theme, s.accent)
TabView(selection: Binding(get: { ui.showsDeck ? BarItem.deck : .tab(ui.tab) },
set: { if case .tab(let t) = $0 { ui.selectTab(t) } else { ui.showDeck() } })) {
// Unfolded with something playing, Now Playing leads the bar: the deck (stems, lyrics,
// queue, EQ) on this side of the hinge, the player docked on the other.
if ui.hasDeckTab {
DuoPane { NowPlayingDeck() }
.tabItem { Label("Now Playing", systemImage: "waveform") }
.tag(BarItem.deck)
}
ForEach(ui.tabs, id: \.self) { t in
DuoPane {
NavigationStack(path: ui.path(t)) {
root(t).miniPlayerRoom()
.navigationDestination(for: Route.self) { destination($0).miniPlayerRoom() }
}
.modifier(FloatingMiniPlayer())
}
.tabItem { Label(t.rawValue, systemImage: t.icon) }
.tag(BarItem.tab(t))
}
}
bar
.modifier(GlassMiniPlayerHost())
// Folded on the Duo the app stays upright (the window's trailing inset gives the Duo away).
.onGeometryChange(for: CGFloat.self) { $0.safeAreaInsets.trailing } action: { ui.sawInsets(trailing: $0, upright: vSize == .regular) }
.background(p.bg.ignoresSafeArea())
.onChange(of: ui.tabs) { _, _ in ui.ensureValidTab() }
.fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) {
@@ -53,8 +35,53 @@ struct RootView: View {
.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 {
switch t {
case .Library: LibraryHome()
@@ -94,6 +121,7 @@ struct RootView: View {
case .Appearance: AppearanceScreen()
case .NowPlayingOptions: NowPlayingOptionsScreen()
case .StemEditor: StemEditorScreen()
case .LibraryLayout: LibraryLayoutScreen()
case .About: AboutScreen()
case .ArtistPage(let a): ArtistScreen(artist: a)
case .AlbumPage(let a): AlbumScreen(album: a)
@@ -165,7 +193,7 @@ private struct DuoPane<Content: View>: View {
var body: some View {
GeometryReader { geo in
let cut = Self.cut(geo)
let flip = swap && cut?.vertical == true
let flip = duoSwapEnabled && swap && cut?.vertical == true
let layout = cut?.vertical == false ? AnyLayout(VStackLayout(spacing: cut?.gap ?? 0)) : AnyLayout(HStackLayout(spacing: cut?.gap ?? 0))
layout {
content
+21 -57
View File
@@ -10,32 +10,33 @@ struct LibraryHome: View {
@State private var added: [Track] = []
@State private var reload = 0
@Environment(\.scenePhase) private var scenePhase
@State private var editing = false
private var g: AppGraph { .shared }
/// 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] {
let saved = g.settings.libraryOrder.split(separator: "|").map(String.init)
static func ordered<T>(_ items: [T], _ s: Settings, _ title: (T) -> String) -> [T] {
let saved = s.libraryOrder.split(separator: "|").map(String.init)
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)
}
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.
private func move(_ title: String, _ by: Int, in titles: [String]) {
guard let i = titles.firstIndex(of: title), titles.indices.contains(i + by) else { return }
var t = titles
t.swapAt(i, i + by)
let saved = g.settings.libraryOrder.split(separator: "|").map(String.init)
g.settings.libraryOrder = (t + saved.filter { !t.contains($0) }).joined(separator: "|")
/// Moves rows within one group (Settings > Library Layout) and saves the whole order.
static func reorder(_ group: [String], from: IndexSet, to: Int, _ s: Settings) {
var t = ordered(group, s) { $0 }
t.move(fromOffsets: from, toOffset: to)
let saved = s.libraryOrder.split(separator: "|").map(String.init)
s.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 hiddenSections: Set<String> { Set(g.settings.libraryHidden.split(separator: "|").map(String.init)) }
private func toggle(_ name: String) {
var h = hiddenSections
static func hidden(_ s: Settings) -> Set<String> { Set(s.libraryHidden.split(separator: "|").map(String.init)) }
static func toggle(_ name: String, _ s: Settings) {
var h = hidden(s)
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 {
@@ -88,8 +89,7 @@ struct LibraryHome: View {
]
let shown = ordered(stations) { $0.1 }
ForEach(shown, id: \.1) { st in
LibraryRow(icon: st.0, title: st.1, last: st.1 == shown.last?.1, editing: editing,
move: { move(st.1, $0, in: shown.map(\.1)) }) { play(st.2) }
LibraryRow(icon: st.0, title: st.1, last: st.1 == shown.last?.1) { play(st.2) }
}
default:
// Every tab except Settings (and this one).
@@ -101,8 +101,7 @@ struct LibraryHome: View {
]
let shownRows = ordered(rows) { $0.1 }
ForEach(shownRows, id: \.1) { r in
LibraryRow(icon: r.0, title: r.1, last: r.1 == shownRows.last?.1, editing: editing,
move: { move(r.1, $0, in: shownRows.map(\.1)) }) { ui.push(r.2) }
LibraryRow(icon: r.0, title: r.1, last: r.1 == shownRows.last?.1) { ui.push(r.2) }
}
}
}
@@ -119,24 +118,9 @@ struct LibraryHome: View {
}
}
if ready {
ForEach(shownSections, id: \.self) { name in
let off = hiddenSections.contains(name)
if editing {
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() } }
}
// Order and visibility are set in Settings > Library Layout.
let off = Self.hidden(s)
ForEach(shownSections.filter { !off.contains($0) }, id: \.self) { section($0) }
}
}
.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 {
let icon: String
+61 -33
View File
@@ -116,7 +116,9 @@ struct NowPlayingScreen: View {
/// 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
private var artInset: CGFloat { tight ? 18 : 28 }
/// 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 : folded ? 12 : 28 }
private var hPad: CGFloat { tight ? 20 : 28 }
private var g: AppGraph { .shared }
@@ -165,9 +167,12 @@ struct NowPlayingScreen: View {
// 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 : [])
// Folded, the bottom inset is empty space too: run the controls down into it, and the art grows into the room.
.ignoresSafeArea(.container, edges: !docked && vSize == .regular ? (folded ? [.trailing, .bottom] : .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(.bottom, tight ? 4 : 8)
.padding(.bottom, tight ? 4 : folded ? 2 : 8)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(c.bg.ignoresSafeArea())
.overlay(alignment: .top) {
@@ -197,14 +202,22 @@ struct NowPlayingScreen: View {
@ViewBuilder
private func panelView(_ track: Track, header: Bool) -> some View {
switch panel {
case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: header || !tight ? artInset : 12).contentShape(Rectangle())
case .Mixer: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag(header: true)) }; MixerPanel() }
case .Queue: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag(header: true)) }; QueuePanel(close: { show(.Queue) }) }
case .Lyrics: VStack(spacing: 0) { if header { MiniHeader(track: track).contentShape(Rectangle()).gesture(screenDrag(header: true)) }; LyricsPanel(track: track) }
case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: header || !tight ? artInset : 12,
leading: folded && !docked && !ui.split && g.settings.foldedArtLeft).contentShape(Rectangle())
case .Mixer: VStack(spacing: 0) { if header { mini(track) }; MixerPanel(spread: folded) }
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 {
// 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 c = tint.map { base.tinted($0) } ?? base
let pad: CGFloat = wide && tight ? 14 : hPad
@@ -223,11 +236,11 @@ struct NowPlayingScreen: View {
Spacer(minLength: 8)
EllipsisButton(items: ui.menu.track(track))
}
.padding(.top, tight ? 8 : 14)
.padding(.top, tight || snug ? 8 : 14)
.transition(.opacity.combined(with: .move(edge: .top)))
}
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) {
SideToggle(symbol: "shuffle", on: pm.shuffle, action: pm.toggleShuffle, width: narrow ? 36 : 40)
Spacer(minLength: 2)
@@ -248,8 +261,8 @@ struct NowPlayingScreen: View {
Spacer(minLength: 2)
SideToggle(symbol: pm.repeatMode == .One ? "repeat.1" : "repeat", on: pm.repeatMode != .Off, action: pm.cycleRepeat, width: narrow ? 36 : 40)
}
.frame(height: tight ? 76 : 84)
.padding(.top, tight ? 4 : 14)
.frame(height: tight || snug ? 76 : 84)
.padding(.top, tight || snug ? 4 : 14)
HStack {
let hidden = NowPlayingButton.hidden(g.settings.hiddenNowPlaying)
if !hidden.contains(.Mixer) { PanelToggle(symbol: "slider.vertical.3", on: docked ? ui.showsDeck && ui.deckPage == .Stems : panel == .Mixer) { show(.Mixer) } }
@@ -263,9 +276,9 @@ struct NowPlayingScreen: View {
if !docked { Button { show(.Queue) } label: {
VStack(spacing: 0) {
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())
.gesture(swipe(up: panel != .Queue)) }
@@ -482,14 +495,16 @@ private struct ArtPanel: View {
let thumb: String?
let playing: Bool
var inset: CGFloat = 28
/// Settings > Appearance, folded Duo only: art against the left edge.
var leading = false
var body: some View {
GeometryReader { geo in
let side = max(min(geo.size.width, geo.size.height), 1)
Artwork(thumb: thumb, size: side, corner: 12)
.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)
.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)
}
@@ -497,19 +512,21 @@ private struct ArtPanel: View {
private struct MiniHeader: View {
let track: Track
var menu = true
var compact = false
@Environment(Ui.self) private var ui
@Environment(\.palette) private var p
var body: some View {
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) {
Text(track.title).font(.headline).foregroundStyle(p.label).lineLimit(1)
Text(track.artist).font(.subheadline).foregroundStyle(p.label2).lineLimit(1)
}
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)
}
}
@@ -710,9 +727,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
/// width, with a bigger thumb for fine moves.
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(\.palette) private var p
@State private var meters = Meters()
@State private var chipsH: CGFloat = 48
private var g: AppGraph { .shared }
var body: some View {
@@ -723,8 +743,11 @@ private struct MixerPanel: View {
// Spread spare height across the stem rows instead of leaving it all at the bottom.
let count = CGFloat(max(names.count, 1))
// Rows shrink to fit every stem before anything has to scroll (the folded outer display is short).
let rowH = roomy ? min(80, max(Self.roomyMin, (geo.size.height - Self.roomyChrome) / count))
: min(62, max(Self.compactMin, (geo.size.height - Self.compactChrome) / count))
// 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 {
VStack(alignment: .leading, spacing: 0) {
if pm.source == .Original {
@@ -739,11 +762,12 @@ private struct MixerPanel: View {
HStack(spacing: 8) { saveChips(pm); presetChips(pm, names) }.padding(.horizontal, 24)
}
.scrollIndicators(.hidden)
.padding(.horizontal, -24)
.padding(.leading, -24).padding(.trailing, roomy ? -6 : -24)
.padding(.vertical, 8)
.onGeometryChange(for: CGFloat.self) { $0.size.height } action: { chipsH = $0 }
}
// Any height the rows can't use goes evenly above and below them, so the stems sit centred.
Spacer(minLength: 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.
TimelineView(.animation(minimumInterval: 1 / 30, paused: !stems || !pm.playWhenReady)) { _ in
let levels = stems ? meters.step(pm.engine, names.count) : []
@@ -755,7 +779,8 @@ private struct MixerPanel: View {
}
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)
@@ -820,9 +845,10 @@ extension MixerPanel {
static let roomyRow: CGFloat = 66
/// Shortest stacked row: name line, fader and the gap under it.
static let roomyMin: CGFloat = 60
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.
static let roomyChrome: CGFloat = 56
static let compactChrome: CGFloat = 56
@@ -895,7 +921,7 @@ struct FaderRow<Fader: View, Trailing: View>: View {
var body: some View {
if stacked {
// 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) {
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)
@@ -905,8 +931,8 @@ struct FaderRow<Fader: View, Trailing: View>: View {
.frame(height: 18)
HStack(spacing: 8) { fader; trailing }
}
.padding(.bottom, 4)
.frame(height: height, alignment: .bottom)
// Centred in its slot, so tall rows keep even gaps above and below.
.frame(height: height)
} else {
row
}
@@ -1067,12 +1093,14 @@ struct NowPlayingDeck: View {
ScrollView(.horizontal) { pages(c, spacing: 18) }.scrollIndicators(.hidden)
}
Spacer(minLength: 0)
Button { withAnimation(.spring(duration: 0.4, bounce: 0.1)) { swap.toggle() } } label: {
Image(systemName: "arrow.left.arrow.right").font(.body.weight(.semibold)).foregroundStyle(c.label2)
.frame(width: 40, height: 32).contentShape(Rectangle())
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")
}
.buttonStyle(PressFade())
.accessibilityLabel("Swap Sides")
}
.padding(.horizontal, 24).frame(height: 36)
}
+44 -1
View File
@@ -232,6 +232,7 @@ struct SettingsScreen: View {
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: "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") }
Section {
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 ----------------------------------------------------------------------------------
private struct Maintainer: Identifiable {
@@ -989,7 +1029,10 @@ struct AppearanceScreen: View {
Toggle(isOn: $s.albumColorNowPlaying) { Text("Album Colour Background").foregroundStyle(c.label) }
.tint(Color(hex: 0x34C759))
.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 {
Toggle(isOn: $s.acapella) { Text("Spell It “Acapella”").foregroundStyle(c.label) }
.tint(Color(hex: 0x34C759))
+7 -1
View File
@@ -65,9 +65,15 @@ extension View {
private struct ThemedList: ViewModifier {
@Environment(\.palette) private var p
@Environment(Ui.self) private var ui
let grouped: Bool
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)
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ settings:
# iOS needs a plain number for the bundle version; the label is what the app and releases show.
MARKETING_VERSION: "0.9.0"
VERSION_LABEL: "0.9.0"
CURRENT_PROJECT_VERSION: "29"
CURRENT_PROJECT_VERSION: "39"
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
APP_ID: org.cdnutter.stemify
APP_NAME: Stemify
+101
View File
@@ -0,0 +1,101 @@
"""Run from a venv with resvg-py and pillow: python make-icon.py OUTDIR
Stemify app icon: six stem-colored capsules (the app's stem palette) glowing on a deep night background.
Usage: make.py OUTDIR -> icon.png, icon-dev.png, icon-dev-dark.png, icon-dev-tinted.png"""
import io, sys
import resvg_py
from PIL import Image
S = 1024
# vocals, drums, bass, guitar, piano, other (PlaybackManager stem colors)
STEMS = [0xFF7AB6, 0xFFB547, 0x7C8CFF, 0xFF8A5C, 0xB48CFF, 0x4CD07D]
HEIGHTS = [300, 510, 390, 620, 455, 330]
W, GAP = 78, 30
def hx(c): return f"#{c:06X}"
def mix(c, t, k):
a = [(c >> s) & 255 for s in (16, 8, 0)]; b = [(t >> s) & 255 for s in (16, 8, 0)]
return "#" + "".join(f"{round(x + (y - x) * k):02X}" for x, y in zip(a, b))
def svg(mode="color", sash=False):
tint = mode == "tinted"
total = len(STEMS) * W + (len(STEMS) - 1) * GAP
x0 = (S - total) / 2
cy = S / 2 + 6
defs, glow, bars, shine = [], [], [], []
for i, (c, h) in enumerate(zip(STEMS, HEIGHTS)):
if tint: c = 0xFFFFFF
x, y = x0 + i * (W + GAP), cy - h / 2
defs.append(f'<linearGradient id="g{i}" x1="0" y1="0" x2="0" y2="1">'
f'<stop offset="0" stop-color="{mix(c, 0xFFFFFF, 0.38)}"/>'
f'<stop offset="0.55" stop-color="{hx(c)}"/>'
f'<stop offset="1" stop-color="{mix(c, 0x000000, 0.18 if not tint else 0.45)}"/></linearGradient>')
r = W / 2
glow.append(f'<rect x="{x}" y="{y}" width="{W}" height="{h}" rx="{r}" fill="{hx(c)}"/>')
bars.append(f'<rect x="{x}" y="{y}" width="{W}" height="{h}" rx="{r}" fill="url(#g{i})"/>')
# glassy highlight down the left edge
shine.append(f'<rect x="{x + W * 0.2}" y="{y + W * 0.32}" width="{W * 0.17}" height="{max(h * 0.42, 40)}" '
f'rx="{W * 0.085}" fill="#FFFFFF" opacity="0.22"/>')
if tint:
bg = '<rect width="1024" height="1024" fill="#000"/>'
aura = ""
else:
bg = ('<radialGradient id="bg" cx="0.5" cy="0.42" r="0.78">'
'<stop offset="0" stop-color="#211A3A"/><stop offset="0.55" stop-color="#110E1F"/>'
'<stop offset="1" stop-color="#05040A"/></radialGradient>'
'<rect width="1024" height="1024" fill="url(#bg)"/>')
# soft colored light pooling behind the bars
aura = ('<g filter="url(#aura)" opacity="0.55">'
f'<circle cx="330" cy="420" r="190" fill="{hx(STEMS[0])}"/>'
f'<circle cx="690" cy="400" r="200" fill="{hx(STEMS[4])}"/>'
f'<circle cx="520" cy="660" r="210" fill="{hx(STEMS[2])}"/>'
f'<circle cx="760" cy="640" r="150" fill="{hx(STEMS[5])}"/>'
f'<circle cx="290" cy="650" r="150" fill="{hx(STEMS[1])}"/></g>'
'<rect width="1024" height="1024" fill="#05040A" opacity="0.45"/>')
vignette = ('<radialGradient id="vig" cx="0.5" cy="0.5" r="0.72"><stop offset="0.6" stop-color="#000" stop-opacity="0"/>'
'<stop offset="1" stop-color="#000" stop-opacity="0.55"/></radialGradient>'
'<rect width="1024" height="1024" fill="url(#vig)"/>') if not tint else ""
sash_svg = ""
if sash:
sash_svg = ('<linearGradient id="sash" x1="0" y1="1" x2="1" y2="0">'
'<stop offset="0" stop-color="#FF9BD0"/><stop offset="1" stop-color="#C9A8FF"/></linearGradient>'
'<g transform="translate(222,222) rotate(-45)">'
'<rect x="-420" y="-58" width="840" height="116" fill="url(#sash)"/>'
'<line x1="-420" y1="-44" x2="420" y2="-44" stroke="#FFF" stroke-opacity="0.75" stroke-width="5" stroke-dasharray="18 14"/>'
'<line x1="-420" y1="44" x2="420" y2="44" stroke="#FFF" stroke-opacity="0.75" stroke-width="5" stroke-dasharray="18 14"/>'
'<text x="-30" y="30" text-anchor="middle" font-family="DejaVu Sans" font-weight="bold" font-size="88" '
'fill="#3A1F4D" opacity="0.45" transform="translate(4,5)">dev</text>'
'<text x="-30" y="30" text-anchor="middle" font-family="DejaVu Sans" font-weight="bold" font-size="88" fill="#FFF">dev</text>'
'<path transform="translate(118,-4) scale(2.6)" fill="#FFF" '
'd="M0 9 C-9 3 -12 -3 -8 -8 C-5 -11 -1 -10 0 -6 C1 -10 5 -11 8 -8 C12 -3 9 3 0 9 Z"/></g>')
return f'''<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<defs>{"".join(defs)}
<filter id="aura" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="110"/></filter>
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="26"/></filter>
<filter id="drop" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="10"/></filter>
</defs>
{bg}{aura}
<g filter="url(#glow)" opacity="{0.25 if tint else 0.7}">{"".join(glow)}</g>
<g filter="url(#drop)" opacity="0.5" transform="translate(0,14)">{"".join(g.replace('fill="#', 'fill="#000" data-c="') for g in glow)}</g>
<g>{"".join(bars)}</g>
<g>{"".join(shine)}</g>
{vignette}{sash_svg}
</svg>'''
def png(s, path, gray=False):
im = Image.open(io.BytesIO(bytes(resvg_py.svg_to_bytes(svg_string=s)))).convert("RGB")
(im.convert("L") if gray else im).save(path, optimize=True)
out = sys.argv[1]
png(svg(), f"{out}/icon.png")
png(svg(sash=True), f"{out}/icon-dev.png")
png(svg(sash=True), f"{out}/icon-dev-dark.png")
png(svg("tinted", sash=True), f"{out}/icon-dev-tinted.png", gray=True)
open(f"{out}/icon.svg", "w").write(svg())
+7 -197
View File
@@ -16,203 +16,13 @@
"category": "entertainment",
"versions": [
{
"version": "1.0",
"marketingVersion": "1.0 RC 4",
"buildVersion": "24",
"date": "2026-11-18T13:39:57-08:00",
"localizedDescription": "Duo layout fixes for every fold and orientation",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc4/stemify-1.0-rc4.ipa",
"size": 2650316,
"minOSVersion": "17.0"
},
{
"version": "1.0",
"marketingVersion": "1.0 RC 3",
"buildVersion": "23",
"date": "2026-11-09T08:01:30-08:00",
"localizedDescription": "iPhone Duo: unfolded, the library sits on one side of the hinge and Now Playing stays docked on the other (no mini player while split). Folded and other iPhones are unchanged. Unsigned IPA for Sideloadly, AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc3/stemify-1.0-rc3.ipa",
"size": 2596161,
"minOSVersion": "17.0"
},
{
"version": "1.0",
"marketingVersion": "1.0 RC 2",
"buildVersion": "22",
"date": "2026-11-06T08:55:28-08:00",
"localizedDescription": "Plain Plex songs play when Remote Access has an upload speed limit (no more 500s). Shuffle buttons work and top up as you go. Random Album Radio works like Plexamp: a shuffled album list played album by album, in track order. Recently Added has See All with the full list. Stem playlist covers can come from Photos. Crossfade (Off or 1-12 s, Settings > Listening) with Sweet Fades for same-album songs. Update Download on downloaded playlists, albums and artists, plus Update All Downloads. Unsigned IPA for Sideloadly, AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0-rc2/stemify-1.0-rc2.ipa",
"size": 2579022,
"minOSVersion": "17.0"
},
{
"version": "1.0.16",
"marketingVersion": "1.0.16",
"buildVersion": "17",
"date": "2026-10-20T14:39:00-07:00",
"localizedDescription": "More room between the seek bar and the time / codec row on Now Playing.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.16/stemify-1.0.16.ipa",
"size": 1626423,
"minOSVersion": "17.0"
},
{
"version": "1.0.15",
"marketingVersion": "1.0.15",
"buildVersion": "16",
"date": "2026-10-20T14:22:36-07:00",
"localizedDescription": "Mixer faders use the spare height on Now Playing, with more room above the seek bar. Unsigned IPA for Sideloadly, AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.15/stemify-1.0.15.ipa",
"size": 1626425,
"minOSVersion": "17.0"
},
{
"version": "1.0.14",
"marketingVersion": "1.0.14",
"buildVersion": "15",
"date": "2026-10-20T14:14:26-07:00",
"localizedDescription": "Reorderable tab bar (Songs, Albums, Artists, Genres, Playlists, Search, Downloads), AirPlay route picker in Now Playing, debug logging with log export in Settings, more room above the seeker. Unsigned IPA.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.14/stemify-1.0.14.ipa",
"size": 1625201,
"minOSVersion": "17.0"
},
{
"version": "1.0.13",
"marketingVersion": "1.0.13",
"buildVersion": "14",
"date": "2026-10-20T13:42:31-07:00",
"localizedDescription": "- Export and import of stem playlists and sound settings (Settings > Backup)\n- Mixer: one-line faders, every stem fits without scrolling\n- Wide and landscape now-playing layout for iPhone Duo\n\nUnsigned IPA: re-sign with Sideloadly or AltStore.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.13/stemify-1.0.13.ipa",
"size": 1559179,
"minOSVersion": "17.0"
},
{
"version": "1.0.12",
"marketingVersion": "1.0.12",
"buildVersion": "13",
"date": "2026-10-20T13:29:05-07:00",
"localizedDescription": "More space between the seek bar and the transport buttons on Now Playing. Unsigned IPA: re-sign with Sideloadly, AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.12/stemify-1.0.12.ipa",
"size": 1529939,
"minOSVersion": "17.0"
},
{
"version": "1.0.11",
"marketingVersion": "1.0.11",
"buildVersion": "12",
"date": "2026-10-20T12:24:42-07:00",
"localizedDescription": "Tapping the lock screen / Control Center player opens the app again.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.11/stemify-1.0.11.ipa",
"size": 1529241,
"minOSVersion": "17.0"
},
{
"version": "1.0.10",
"marketingVersion": "1.0.10",
"buildVersion": "11",
"date": "2026-10-20T11:21:34-07:00",
"localizedDescription": "Shuffle and repeat (list and song) on Now Playing. Playback speed from 0.5x to 2x, pitch kept.\n\nUnsigned IPA, not tested on device.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.10/stemify-1.0.10.ipa",
"size": 1529239,
"minOSVersion": "17.0"
},
{
"version": "1.0.9",
"marketingVersion": "1.0.9",
"buildVersion": "10",
"date": "2026-10-20T10:28:26-07:00",
"localizedDescription": "- Add to Playlist is now one sheet instead of a string of pop-ups: Plex and Stem tabs, type a new playlist name right in the list, playlist art, and mix chips for stem playlists.\n- Song menus have a single \"Add to Playlist\u2026\" entry for both kinds; the sheet remembers which tab you used last.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.9/stemify-1.0.9.ipa",
"size": 1518270,
"minOSVersion": "17.0"
},
{
"version": "1.0.8",
"marketingVersion": "1.0.8",
"buildVersion": "9",
"date": "2026-10-20T10:02:44-07:00",
"localizedDescription": "- Playlists tab now has Plex and Stem sections. Plex playlists are unchanged and use their custom Plex poster when there is one.\n- Stem playlists: each song keeps its own mix (instrumental, a cappella, no drums, custom...). Add songs from any menu, or copy a Plex playlist over in one go. Change one song's mix or the whole list's.\n- Softness slider under the Vocals picker in the lyrics view when vocals are set to Soft.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.8/stemify-1.0.8.ipa",
"size": 1462423,
"minOSVersion": "17.0"
},
{
"version": "1.0.7",
"marketingVersion": "1.0.7",
"buildVersion": "8",
"date": "2026-10-20T09:39:03-07:00",
"localizedDescription": "- Mini player now sits in the tab bar's Liquid Glass accessory on iOS 26.1 and later, like Music. The tab bar shrinks when you scroll down and the player collapses to title and play/pause. Older iOS keeps the floating card.\n- Settings > Sound > Karaoke Soft Vocals: set how quiet Soft vocals are (-30 to -3 dB, default -12).\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.7/stemify-1.0.7.ipa",
"size": 1390623,
"minOSVersion": "17.0"
},
{
"version": "1.0.6",
"marketingVersion": "1.0.6",
"buildVersion": "7",
"date": "2026-10-20T09:31:01-07:00",
"localizedDescription": "- Karaoke vocals option on the lyrics panel: On (full vocals), Soft (vocals about 12 dB down as a guide), Off (no vocals). Remembered between songs and launches.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.6/stemify-1.0.6.ipa",
"size": 1375443,
"minOSVersion": "17.0"
},
{
"version": "1.0.5",
"marketingVersion": "1.0.5",
"buildVersion": "6",
"date": "2026-10-20T09:23:39-07:00",
"localizedDescription": "- Sort menu on Artists, Albums, Songs and Playlists (Name, Date Added, Last Played, Plays, Rating, Year, Duration and more). Tap the current field again to flip direction (A to Z / Z to A, newest / oldest).\n- Each screen remembers its sort.\n\nUnsigned IPA: sideload with AltStore, SideStore or Feather.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.5/stemify-1.0.5.ipa",
"size": 1370686,
"minOSVersion": "17.0"
},
{
"version": "1.0.4",
"marketingVersion": "1.0.4",
"buildVersion": "5",
"date": "2026-10-20T09:18:33-07:00",
"localizedDescription": "Save a stem mix for a song (Save chip in the mixer); it comes back every time that song plays. New mic button for karaoke mode: vocals muted on every song plus synced lyrics from LRCLIB, tap a line to jump to it.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.4/stemify-1.0.4.ipa",
"size": 1355610,
"minOSVersion": "17.0"
},
{
"version": "1.0.3",
"marketingVersion": "1.0.3",
"buildVersion": "4",
"date": "2026-10-20T09:08:18-07:00",
"localizedDescription": "Bundle ID is now org.cdnutter.stemify (delete the old app first; settings won't carry over). IPA is named stemify-<version>.ipa. Adds an AltStore/SideStore/Feather source.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.3/stemify-1.0.3.ipa",
"size": 1319672,
"minOSVersion": "17.0"
},
{
"version": "1.0.2",
"marketingVersion": "1.0.2",
"buildVersion": "1.0.2",
"date": "2026-10-20T08:53:24-07:00",
"localizedDescription": "Unsigned, iOS 17 or newer. Sideload `Stemify.ipa` with Sideloadly or AltStore.\n\n- Shuffle on the Songs screen now picks from the whole library instead of only the songs loaded so far (the A's and B's)\n\nIncludes everything in 1.0.1. CarPlay and Siri still need entitlements a free Apple ID can't sign.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.2/stemify-1.0.2.ipa",
"size": 1319672,
"minOSVersion": "17.0"
},
{
"version": "1.0.1",
"marketingVersion": "1.0.1",
"buildVersion": "1.0.1",
"date": "2026-10-20T08:50:56-07:00",
"localizedDescription": "Unsigned, iOS 17 or newer. Sideload `Stemify.ipa` with Sideloadly or AltStore.\n\n- The mini player no longer covers the bottom of lists, and it is now a solid card that matches the app instead of system glass\n- More room between the title and the scrubber on Now Playing\n- The play button no longer spins forever after you change tracks\n- The stems and queue buttons now animate their panels in and out\n- Springier button presses and play/pause transitions\n\nCarPlay and Siri still need entitlements a free Apple ID can't sign.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0.1/stemify-1.0.1.ipa",
"size": 1317680,
"minOSVersion": "17.0"
},
{
"version": "1.0",
"marketingVersion": "1.0",
"buildVersion": "1.0",
"date": "2026-10-20T07:16:41-07:00",
"localizedDescription": "First iOS build. Unsigned, iOS 17 or newer.\n\nSideload `Stemify.ipa` with Sideloadly or AltStore, which sign it with your Apple ID.\n\nCarPlay and Siri need entitlements a free Apple ID can't sign, so on a free sideload they won't show up. Everything on the phone works. Not yet tested on a device.",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v1.0/stemify-1.0.ipa",
"size": 1305649,
"version": "0.9.0",
"marketingVersion": "0.9.0",
"buildVersion": "31",
"date": "2026-11-18T17:21:50-08:00",
"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-v0.9.0/stemify-0.9.0.ipa",
"size": 2710062,
"minOSVersion": "17.0"
}
],