Compare commits

...
Author SHA1 Message Date
rootandClaude Opus 5.5 d6da47db9d iOS: only the on-screen Duo pane reports split/unfolded; build 48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:20:09 -08:00
root 4dfcfbf434 iOS source.json for ios-v0.10.1 2026-11-20 10:17:11 -08:00
rootandClaude Opus 5.5 56c92e8b93 iOS: free orientation in background, re-lock after resume settles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:14:59 -08:00
root 639b5368ff iOS source.json for ios-v0.10.1 2026-11-20 10:10:17 -08:00
rootandClaude Opus 5.5 cfaedd06cf iOS 0.10.1 (build 47)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:08:08 -08:00
rootandClaude Opus 5.5 8f3a10df2f iOS: more room between art and title on the folded screen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 10:00:51 -08:00
rootandClaude Opus 5.5 5868430f8a iOS: unfolded upright never splits, always turns to landscape; orientation request re-checked until it takes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 09:58:48 -08:00
rootandClaude Opus 5.5 566c5f7e8f iOS: folded Now Playing runs into the bottom strip, orientation lock re-asserts on resume
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 09:50:23 -08:00
rootandClaude Opus 5.5 e833af2704 iOS: vocals controls only when playing stems with a vocals stem
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 09:31:10 -08:00
rootandClaude Opus 5.5 c9fa90a840 iOS: hide vocals controls without stems, paint Duo hinge gap, playlist bar per drawing, drop Album Color Background, Colour to Color
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 09:20:18 -08:00
rootandClaude Opus 5.5 0516362461 iOS: Use Stem Server switch for Plex-only playback, build 42
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 08:59:13 -08:00
rootandClaude Opus 5.5 7843ff562b iOS build 41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:23:02 -08:00
rootandClaude Opus 5.5 9e0d7236c2 iOS: seek bar uses the album art accent when Match Album Art is on
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:22:42 -08:00
27 changed files with 206 additions and 161 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ A Plex music player for the OnePlus 15 that plays the stems stemd separates on y
unraid server: per-stem faders, mute/solo, karaoke-style presets, a master volume drawn
over a Plexamp-style waveform seek bar, a 10-band graphic EQ plus Equalizer APO-style
parametric filters with per-device profiles, and an
iOS look in Black, Dark or White (flat colours, no gradients).
iOS look in Black, Dark or White (flat colors, no gradients).
## Install
@@ -48,7 +48,7 @@ import java.io.IOException
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicBoolean
/** Display order and colours for stems, matching the desktop app. */
/** Display order and colors for stems, matching the desktop app. */
object Stems {
val ORDER = listOf("vocals", "drums", "bass", "guitar", "piano", "other", "instrumental", "mix")
private val COLORS = mapOf(
@@ -276,7 +276,7 @@ fun Cell(
}
}
/** Settings.app-style coloured rounded-square icon. */
/** Settings.app-style colored rounded-square icon. */
@Composable
fun SettingsIcon(vector: ImageVector, bg: Color) {
Box(Modifier.size(30.dp).clip(RoundedCornerShape(7.dp)).background(bg), contentAlignment = Alignment.Center) {
@@ -113,7 +113,7 @@ private fun newFilter(type: FilterType) = EqFilter(EqController.newFilterId(), t
/**
* The EQ's response, log frequency across, dB up. Left and right are drawn separately when
* some filter applies to only one of them (right in orange). [nodes] are drawn as numbered
* handles; [highlight] gets its own curve in the accent colour.
* handles; [highlight] gets its own curve in the accent color.
*/
@Composable
fun EqCurve(
@@ -102,8 +102,8 @@ import kotlin.math.min
enum class NpPanel { Art, Mixer, Queue }
/**
* A solid colour from the album art, pushed dark (or light for the White theme) so text
* stays readable. One flat colour: no gradients.
* A solid color from the album art, pushed dark (or light for the White theme) so text
* stays readable. One flat color: no gradients.
*/
@Composable
private fun albumColor(thumb: String?, enabled: Boolean, dark: Boolean): Color? {
@@ -400,8 +400,8 @@ fun AppearanceScreen() {
}
}
})
section("np", header = "Now Playing", footer = "Paints the Now Playing screen in one solid colour taken from the album art.", rows = listOf {
Cell("Album Colour Background", trailing = { IosSwitch(albumColor, { s.albumColorNowPlaying.value = it }) })
section("np", header = "Now Playing", footer = "Paints the Now Playing screen in one solid color taken from the album art.", rows = listOf {
Cell("Album Color Background", trailing = { IosSwitch(albumColor, { s.albumColorNowPlaying.value = it }) })
})
}
}
@@ -24,7 +24,7 @@ import com.stemify.mobile.core.Accent
import com.stemify.mobile.core.ThemeMode
import kotlin.math.exp
/** iOS semantic colours, flattened to solid values for each scheme. */
/** iOS semantic colors, flattened to solid values for each scheme. */
@Immutable
data class Palette(
val dark: Boolean,
@@ -130,7 +130,7 @@ fun IosTheme(mode: ThemeMode, accent: Accent, content: @Composable () -> Unit) {
CompositionLocalProvider(LocalPalette provides p, content = content)
}
/** BasicText with iOS defaults: label colour, single line, tail ellipsis. */
/** BasicText with iOS defaults: label color, single line, tail ellipsis. */
@Composable
fun Txt(
text: String,
+2 -2
View File
@@ -1,6 +1,6 @@
"""Office-style ribbon icons: flat, two-tone, drawn from SVG at whatever size QML asks for.
image://icon/<name>[/<hex colour>] — the colour overrides the dark-gray ink (for white-on-green chrome).
image://icon/<name>[/<hex color>] — the color overrides the dark-gray ink (for white-on-green chrome).
"""
from PySide6.QtCore import QByteArray, QRectF, Qt
@@ -15,7 +15,7 @@ RED = "#D13438"
ORANGE = "#E8912D"
LIGHT = "#FFFFFF"
# Each icon is SVG body markup on a 32×32 grid; {ink} is the main colour.
# Each icon is SVG body markup on a 32×32 grid; {ink} is the main color.
ICONS = {
"play": f'<path fill="{GREEN}" d="M9 5v22l18-11z"/>',
"pause": '<path fill="{ink}" d="M8 5h6v22H8zM18 5h6v22h-6z"/>',
+1 -1
View File
@@ -7,7 +7,7 @@ import urllib.error
import urllib.parse
import urllib.request
# Display order and colours, matching the desktop separator and the phone.
# Display order and colors, matching the desktop separator and the phone.
ORDER = ["vocals", "drums", "bass", "guitar", "piano", "other", "instrumental", "mix"]
COLORS = {
"vocals": "#FF7AB6", "drums": "#FFB547", "bass": "#7C8CFF", "other": "#4CD07D",
+1 -1
View File
@@ -93,7 +93,7 @@ class IconProvider(QQuickImageProvider):
BG = _hex("1D1E21")
GLASS_TINT = _hex("242529")
# (color, cx, cy, sigma as fraction of the larger side, strength)
# Kept faint so the window reads as neutral dark gray with a hint of Aero colour.
# Kept faint so the window reads as neutral dark gray with a hint of Aero color.
BLOBS = [
(_hex("3BA8FF"), 0.10, 0.05, 0.30, 0.14),
(_hex("7C8CFF"), 0.62, 0.18, 0.22, 0.06),
+15 -5
View File
@@ -35,12 +35,22 @@ 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 }
/// Also re-checks the window when the mask is unchanged: a request made while the app was
/// in the background can be refused, which left the folded screen stuck sideways on return.
@MainActor static func lock(_ m: UIInterfaceOrientationMask, retry: Int = 6) {
let changed = m != mask
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 } }
for case let scene as UIWindowScene in UIApplication.shared.connectedScenes where scene.session.role == .windowApplication {
if changed { scene.keyWindow?.rootViewController?.setNeedsUpdateOfSupportedInterfaceOrientations() }
let now = UIInterfaceOrientationMask(rawValue: 1 << scene.effectiveGeometry.interfaceOrientation.rawValue)
guard m != .allButUpsideDown, !m.contains(now) else { continue }
scene.requestGeometryUpdate(.iOS(interfaceOrientations: m)) { _ in }
// The request can be dropped silently (mid-unfold, just back from the background), so check it took.
guard retry > 0 else { continue }
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(500))
if mask == m { lock(m, retry: retry - 1) }
}
}
}
}
+1 -1
View File
@@ -50,7 +50,7 @@ final class HomeReach: @unchecked Sendable {
let (at, last) = stamp.with { (checkedAt, _last) }
if at != 0 && now - at < Self.ttl { return last }
let urls = settings.servers.map { $0.base + ($0.kind == .plex ? "/identity" : "/System/Info/Public") }
+ [settings.stemUrl.trimmingCharacters(in: CharacterSet(charactersIn: "/")) + "/api/info"]
+ (settings.stemServerOff ? [] : [settings.stemUrl.trimmingCharacters(in: CharacterSet(charactersIn: "/")) + "/api/info"])
let ok = await withTaskGroup(of: Bool.self) { g in
for u in urls { g.addTask { await self.answers(u) } }
for await r in g where r { g.cancelAll(); return true }
+3 -2
View File
@@ -107,7 +107,7 @@ final class Settings: @unchecked Sendable {
private static let keys = [
"servers", "plexUrl", "plexToken", "plexUser", "plexMachineId", "musicSection", "musicSectionTitle",
"stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumTheme", "albumColorNowPlaying", "highRefreshRate",
"stemUrl", "stemToken", "stemServerOff", "plexAccountToken", "stemRoots", "theme", "accent", "albumTheme", "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", "foldedArtLeft",
]
@@ -205,6 +205,8 @@ final class Settings: @unchecked Sendable {
/// The id a new server gets: empty (bare keys) when no server holds it yet.
func nextServerId() -> String { servers.contains { $0.id.isEmpty } ? MediaServer.newId() : "" }
/// Plex only: no stem index, no stemserve traffic.
var stemServerOff: Bool { get { read(\.stemServerOff, "stemServerOff", false) } set { write(\.stemServerOff, "stemServerOff", newValue, false) } }
var stemUrl: String { get { read(\.stemUrl, "stemUrl", "http://192.168.86.2:8765") } set { write(\.stemUrl, "stemUrl", newValue, "http://192.168.86.2:8765") } }
var stemToken: String { get { read(\.stemToken, "stemToken", "") } set { write(\.stemToken, "stemToken", newValue, "") } }
var plexAccountToken: String { get { read(\.plexAccountToken, "plexAccountToken", "") } set { write(\.plexAccountToken, "plexAccountToken", newValue, "") } }
@@ -221,7 +223,6 @@ final class Settings: @unchecked Sendable {
var lockScreenMix: Bool { get { read(\.lockScreenMix, "lockScreenMix", false) } set { write(\.lockScreenMix, "lockScreenMix", newValue, false) } }
/// The whole app takes its accent and surface tint from the playing track's art.
var albumTheme: Bool { get { read(\.albumTheme, "albumTheme", false) } set { write(\.albumTheme, "albumTheme", 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) } }
+1 -1
View File
@@ -1,7 +1,7 @@
import AVFoundation
import Foundation
/// Display order and colours for stems, matching the desktop app.
/// Display order and colors for stems, matching the desktop app.
enum Stems {
static let order = ["vocals", "drums", "bass", "guitar", "piano", "other", "instrumental", "mix"]
private static let colors: [String: UInt32] = [
+15 -2
View File
@@ -5,6 +5,7 @@ enum StemServerStatus: Equatable {
case unknown
case online(tracks: Int, transcode: Bool)
case offline(reason: String, cachedTracks: Int)
case off
var isOnline: Bool { if case .online = self { true } else { false } }
}
@@ -65,7 +66,8 @@ final class StemServer: @unchecked Sendable {
self.settings = settings
indexFile = dir.appendingPathComponent("stem_index.json")
etagFile = dir.appendingPathComponent("stem_index.etag")
if let data = try? Data(contentsOf: indexFile),
if settings.stemServerOff { status = .off }
else if let data = try? Data(contentsOf: indexFile),
let parsed = try? JSONDecoder().decode(StemIndexFile.self, from: data) {
index = StemIndex(parsed.tracks, roots: roots())
}
@@ -111,7 +113,7 @@ final class StemServer: @unchecked Sendable {
/// Reads /api/queue. A change in the finished count pulls the new index straight away.
func pollQueue() async {
guard !base.isEmpty,
guard !settings.stemServerOff, !base.isEmpty,
let u = try? url("/api/queue"),
let data = try? await http.data(req(u)),
let q = try? JSONDecoder().decode(QueueInfo.self, from: data) else { return }
@@ -146,6 +148,16 @@ final class StemServer: @unchecked Sendable {
func refresh(force: Bool = false) async {
await refreshLock.run {
if settings.stemServerOff {
await MainActor.run {
let had = self.index.size > 0
self.index = StemIndex([])
self.current = nil; self.pending = []; self.failed = []
self.status = .off
if had { self.indexListeners.forEach { $0() } }
}
return
}
do {
let info = try JSONDecoder().decode(ServerInfo.self, from: try await http.data(req(try url("/api/info"))))
transcode = info.ffmpeg
@@ -185,6 +197,7 @@ final class StemServer: @unchecked Sendable {
}
func find(_ track: Track) -> StemEntry? {
if settings.stemServerOff { return nil }
let idx = index
if let k = track.stemKey { return idx.entries.first { $0.key == k } }
let hit = idx.find(track.partFile, durationMs: track.durationMs)
+1 -1
View File
@@ -60,7 +60,7 @@ struct Artwork: View {
}
}
/// A settings icon: the glyph in its colour on a faint wash of the same colour.
/// A settings icon: the glyph in its color on a faint wash of the same color.
struct SettingsIcon: View {
let symbol: String
let bg: UInt32
+23 -2
View File
@@ -67,6 +67,8 @@ final class Ui {
}
/// True while an unfolded iPhone Duo shows Now Playing docked beside the library.
private(set) var split = false
/// Unfolded Duo in any orientation (a hinge is showing), even before it has turned to landscape.
private(set) var unfolded = false
/// Split only: the Now Playing tab (the deck) is selected instead of `tab`.
var deck = true
/// Split only: which of the deck's pages is showing.
@@ -123,7 +125,7 @@ final class Ui {
/// 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 }
var folded: Bool { duo && !split && !unfolded }
/// Called with the window's side insets. Upright, only the folded Duo has a trailing one.
func sawInsets(trailing: CGFloat, upright: Bool) {
@@ -136,8 +138,21 @@ final class Ui {
/// 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.
/// Back in the foreground: the phone may have been folded or unfolded meanwhile.
/// The split/unfolded flags are from before the app left, so locking on them at once can force
/// landscape on a phone folded meanwhile. Free the rotation while away and decide again once
/// the window has settled to the screen it came back on.
func resumed() {
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(300))
self.lockOrientation()
}
}
func backgrounded() { Orientation.lock(.allButUpsideDown) }
private func lockOrientation() {
if split { Orientation.lock(.landscape); return }
if split || unfolded { Orientation.lock(.landscape); return }
guard folded else { Orientation.lock(.allButUpsideDown); return }
Task { @MainActor in
try? await Task.sleep(for: .milliseconds(400))
@@ -145,6 +160,12 @@ final class Ui {
}
}
func setUnfolded(_ on: Bool) {
guard on != unfolded else { return }
unfolded = on
lockOrientation()
}
func setSplit(_ on: Bool) {
guard on != split else { return }
split = on
+21 -2
View File
@@ -19,6 +19,9 @@ struct RootView: View {
.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() }
.onChange(of: phase) { _, ph in
if ph == .active { ui.resumed() } else if ph == .background { ui.backgrounded() }
}
.fullScreenCover(isPresented: Binding(get: { ui.nowPlayingOpen }, set: { ui.nowPlayingOpen = $0 })) {
NowPlayingScreen()
.overlayHost(ui.overlays, level: 1)
@@ -43,6 +46,7 @@ struct RootView: View {
}
@Environment(\.verticalSizeClass) private var vSize
@Environment(\.scenePhase) private var phase
private enum BarItem: Hashable { case deck, tab(Tab) }
@@ -195,11 +199,15 @@ private struct DuoPane<Content: View>: View {
@ViewBuilder var content: Content
@Environment(Ui.self) private var ui
@AppStorage("duoSwap") private var swap = false
@Environment(\.palette) private var p
@State private var shown = false
private var g: AppGraph { .shared }
var body: some View {
GeometryReader { geo in
let cut = Self.cut(geo)
let hinge = Self.cut(geo)
// Unfolded upright (hinge across) never splits: the app turns to landscape instead.
let cut = hinge?.vertical == true ? hinge : nil
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 {
@@ -221,8 +229,15 @@ private struct DuoPane<Content: View>: View {
// Right-to-left lays the same two children out mirrored, so swapping doesn't rebuild either.
.environment(\.layoutDirection, flip ? .rightToLeft : .leftToRight)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
// The hinge gap shows whatever is behind; paint it so the two sides read as one.
.background(p.bg.ignoresSafeArea())
.animation(.spring(duration: 0.4, bounce: 0.1), value: flip)
.onChange(of: cut != nil, initial: true) { _, on in ui.setSplit(on) }
// Every tab has its own pane and TabView keeps hidden ones alive, so only the one on
// screen reports; a hidden one's stale size used to turn split off under the visible one.
.onChange(of: hinge != nil) { _, on in if shown { ui.setUnfolded(on) } }
.onChange(of: cut != nil) { _, on in if shown { ui.setSplit(on) } }
.onAppear { shown = true; ui.setUnfolded(hinge != nil); ui.setSplit(cut != nil) }
.onDisappear { shown = false }
}
}
@@ -245,6 +260,10 @@ private struct DuoPane<Content: View>: View {
let screenW = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.screen.bounds.width
let half = ((screenW ?? size.width) / 2 - geo.frame(in: .global).minX).rounded()
c = Cut(vertical: true, first: half - 12, gap: 24, second: size.width - half - 12)
} else if UIDevice.current.userInterfaceIdiom == .phone, size.width >= 500, size.height >= 700 {
// Unfolded but still upright: only marks the phone as unfolded so it turns to landscape.
let half = (size.height / 2).rounded()
c = Cut(vertical: false, first: half - 12, gap: 24, second: size.height - half - 12)
}
guard let c else { return nil }
// A region that doesn't leave usable room on both sides isn't a hinge worth splitting at.
+1 -1
View File
@@ -82,7 +82,7 @@ private func effectivePreamp(_ p: EqProfile) -> Float {
/// The EQ's response, log frequency across, dB up. Left and right are drawn separately when
/// some filter applies to only one of them (right in orange). [nodes] are drawn as numbered
/// handles; [highlight] gets its own curve in the accent colour.
/// handles; [highlight] gets its own curve in the accent color.
struct EqCurve: View {
let chain: [EqFilter]
let preampDb: Float
+31 -81
View File
@@ -15,23 +15,6 @@ func deviceIcon(_ d: OutputDevice) -> (String, UInt32) {
}
}
// ---- album colour ---------------------------------------------------------------------------
/// A solid colour from the album art, pushed dark (or light for the White theme) so text
/// stays readable. One flat colour: no gradients.
@MainActor
private func albumColor(_ thumb: String?, dark: Bool) async -> Color? {
guard let url = AppGraph.shared.plex.artUrl(thumb, px: 120) else { return nil }
let img: UIImage? = if let c = ArtLoader.shared.cached(url) { c } else { await ArtLoader.shared.image(url) }
guard let cg = img?.cgImage else { return nil }
return await Task.detached { () -> Color? in
guard let (h, s0, v0) = vibrant(cg) else { return nil }
let s = dark ? min(s0, 0.65) : min(s0, 0.22)
let v = dark ? min(max(v0, 0.18), 0.30) : 0.96
return Color(hue: h, saturation: s, brightness: v)
}.value
}
/// Roughly Palette's vibrant swatch: the average hue of the most saturated, mid-bright pixels.
func vibrant(_ cg: CGImage) -> (CGFloat, CGFloat, CGFloat)? {
let n = 24
@@ -44,7 +27,7 @@ func vibrant(_ cg: CGImage) -> (CGFloat, CGFloat, CGFloat)? {
let c = UIColor(red: CGFloat(px[i * 4]) / 255, green: CGFloat(px[i * 4 + 1]) / 255, blue: CGFloat(px[i * 4 + 2]) / 255, alpha: 1)
var h: CGFloat = 0, s: CGFloat = 0, v: CGFloat = 0, a: CGFloat = 0
c.getHue(&h, saturation: &s, brightness: &v, alpha: &a)
// Favour colourful pixels that aren't near black or white.
// Favour colorful pixels that aren't near black or white.
let score = s * (1 - abs(v - 0.55) * 1.4)
all.append((h, s, v, score))
}
@@ -58,32 +41,6 @@ func vibrant(_ cg: CGImage) -> (CGFloat, CGFloat, CGFloat)? {
return (h, s / k, v / k)
}
private extension Palette {
func tinted(_ bg: Color) -> Palette {
let dark = UIColor(bg).luminance < 0.5
var c = self
c.dark = dark
c.bg = bg
c.groupedBg = bg
c.fill = dark ? .white.opacity(0.12) : .black.opacity(0.06)
c.fillStrong = dark ? .white.opacity(0.22) : .black.opacity(0.12)
c.label = dark ? .white : .black
c.label2 = dark ? .white.opacity(0.62) : .black.opacity(0.55)
c.label3 = dark ? .white.opacity(0.25) : .black.opacity(0.2)
c.separator = dark ? .white.opacity(0.14) : .black.opacity(0.1)
c.placeholder = c.fill
return c
}
}
private extension UIColor {
var luminance: CGFloat {
var r: CGFloat = 0, g: CGFloat = 0, b: CGFloat = 0, a: CGFloat = 0
getRed(&r, green: &g, blue: &b, alpha: &a)
return 0.2126 * r + 0.7152 * g + 0.0722 * b
}
}
// ---- now playing ----------------------------------------------------------------------------
/// Full screen, Now Playing owns the window's color scheme. Docked beside the library it only
@@ -105,7 +62,6 @@ struct NowPlayingScreen: View {
@Environment(\.palette) private var base
@Environment(\.dismiss) private var dismiss
@State private var panel = NpPanel.Art
@State private var tint: Color?
/// How far the screen is being dragged down to close it.
@State private var drop: CGFloat = 0
/// Docked beside the hinge the pane is narrow, so the controls pack tighter. Full screen
@@ -124,7 +80,7 @@ struct NowPlayingScreen: View {
var body: some View {
let pm = g.playback
let c = tint.map { base.tinted($0) } ?? base
let c = base
let track = pm.current?.track
// 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.
@@ -168,11 +124,14 @@ struct NowPlayingScreen: View {
// (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.
// Folded, the bottom inset is empty space too: run the controls down into it, and the art grows into the room.
// The room under the controls has to be inside this view: padding outside it would keep
// the view off the bottom edge, and then it can't run into the home indicator strip.
.padding(.bottom, folded && !docked ? 6 : 0)
.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 : folded ? 2 : 8)
.padding(.bottom, folded && !docked ? 0 : tight ? 4 : 8)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(c.bg.ignoresSafeArea())
.overlay(alignment: .top) {
@@ -190,13 +149,8 @@ struct NowPlayingScreen: View {
.environment(\.palette, c)
.modifier(NpScheme(dark: c.dark, docked: docked))
.tint(c.label)
.animation(.easeInOut(duration: 0.3), value: tint)
.presentationBackground(.clear)
.onAppear { if !docked && g.playback.karaoke { panel = .Lyrics } }
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
tint = await albumColor(thumb, dark: base.dark)
}
}
@ViewBuilder
@@ -219,7 +173,7 @@ struct NowPlayingScreen: 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 c = base
let pad: CGFloat = wide && tight ? 14 : hPad
// Full-size transport needs 312 pt; below that the buttons shrink to fit.
let narrow = width - 2 * pad < 312
@@ -236,10 +190,10 @@ struct NowPlayingScreen: View {
Spacer(minLength: 8)
EllipsisButton(items: ui.menu.track(track))
}
.padding(.top, tight || snug ? 8 : 14)
.padding(.top, snug && !docked ? 20 : tight ? 8 : 14)
.transition(.opacity.combined(with: .move(edge: .top)))
}
ProgressVolumeBar(played: c.label, unplayed: c.label3, centerLabel: badge(track))
ProgressVolumeBar(played: g.settings.albumTheme ? c.accent : c.label, unplayed: c.label3, centerLabel: badge(track))
.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)
@@ -856,7 +810,7 @@ extension MixerPanel {
static func roomyHeight(_ stems: Int) -> CGFloat { roomyChrome + CGFloat(stems) * roomyRow }
}
/// [Chip] in the sheet's own colours: selected is the label colour, so it reads on any tint.
/// [Chip] in the sheet's own colors: selected is the label color, so it reads on any tint.
private struct PresetChip: View {
let text: String
var icon: String? = nil
@@ -972,7 +926,7 @@ struct ToggleBox: View {
}
}
/// An iOS-style slider with a coloured fill and, optionally, a detent that catches the thumb
/// An iOS-style slider with a colored fill and, optionally, a detent that catches the thumb
/// near one value (unity gain) with a tick.
struct FaderSlider: View {
let value: Float
@@ -980,7 +934,7 @@ struct FaderSlider: View {
var detent: Float?
var enabled = true
var thumb: CGFloat = 24
/// 0...1 live level, shown in the full fill colour over the dimmed filled part of the track.
/// 0...1 live level, shown in the full fill color over the dimmed filled part of the track.
var meter: CGFloat?
let onChange: (Float) -> Void
@@ -1000,8 +954,8 @@ struct FaderSlider: View {
let x = CGFloat(min(max(value, 0), 1)) * track
ZStack(alignment: .leading) {
Capsule().fill(p.fillStrong).frame(height: bar).padding(.horizontal, thumb / 2)
// With a meter the set level is a dim band of the stem's colour and the live level
// runs over it in the full colour, so the two never blend.
// With a meter the set level is a dim band of the stem's color and the live level
// runs over it in the full color, so the two never blend.
Capsule().fill(meter == nil ? fill : fill.opacity(0.32)).frame(width: x + thumb / 2, height: bar).padding(.leading, thumb / 2 - 0.01)
if let meter, meter > 0.01 {
Capsule().fill(fill).frame(width: meter * (x + thumb / 2), height: bar)
@@ -1044,11 +998,10 @@ struct NowPlayingDeck: View {
@Environment(Ui.self) private var ui
@Environment(\.palette) private var base
@AppStorage("duoSwap") private var swap = false
@State private var tint: Color?
private var g: AppGraph { .shared }
var body: some View {
let c = tint.map { base.tinted($0) } ?? base
let c = base
let track = g.playback.current?.track
GeometryReader { _ in
if let track {
@@ -1076,12 +1029,7 @@ struct NowPlayingDeck: View {
.environment(\.palette, c)
.modifier(NpScheme(dark: c.dark, docked: true))
.tint(c.label)
.animation(.easeInOut(duration: 0.3), value: tint)
.animation(.snappy(duration: 0.25), value: ui.deckPage)
.task(id: "\(track?.thumb ?? "")|\(g.settings.albumColorNowPlaying)|\(base.dark)") {
guard g.settings.albumColorNowPlaying, let thumb = track?.thumb else { tint = nil; return }
tint = await albumColor(thumb, dark: base.dark)
}
}
/// The page names, and the button that moves Now Playing to the other side of the hinge.
@@ -1233,7 +1181,7 @@ struct MiniPlayer: View {
.padding(.leading, 8).padding(.trailing, 6)
.frame(height: 60)
.background {
// A solid card in the app's own colours instead of system glass.
// A solid card in the app's own colors instead of system glass.
let shape = RoundedRectangle(cornerRadius: 14, style: .continuous)
ZStack {
shape.fill(p.cell)
@@ -1322,22 +1270,24 @@ private struct LyricsPanel: View {
var body: some View {
VStack(spacing: 0) {
// Soft leaves the singer in quietly as a guide.
HStack(spacing: 12) {
Text("Vocals").font(.subheadline.weight(.semibold)).foregroundStyle(p.label2)
Picker("Vocals", selection: Binding(get: { g.playback.karaokeVocals }, set: { g.playback.setKaraokeVocals($0) })) {
ForEach(KaraokeVocals.allCases, id: \.self) { Text(String(describing: $0)).tag($0) }
}
.pickerStyle(.segmented)
}
.padding(.horizontal, 28).padding(.top, 8)
if g.playback.karaokeVocals == .Soft {
let db = g.settings.karaokeSoftDb
if g.playback.source == .Stems && g.playback.stemNames.contains("vocals") {
HStack(spacing: 12) {
Text("Softness").font(.subheadline.weight(.semibold)).foregroundStyle(p.label2)
Slider(value: Binding(get: { Double(db) }, set: { g.playback.setKaraokeSoftDb(Int($0.rounded())) }), in: -30...(-3), step: 1)
Text("\(db) dB").font(.caption).monospacedDigit().foregroundStyle(p.label2).frame(width: 46, alignment: .trailing)
Text("Vocals").font(.subheadline.weight(.semibold)).foregroundStyle(p.label2)
Picker("Vocals", selection: Binding(get: { g.playback.karaokeVocals }, set: { g.playback.setKaraokeVocals($0) })) {
ForEach(KaraokeVocals.allCases, id: \.self) { Text(String(describing: $0)).tag($0) }
}
.pickerStyle(.segmented)
}
.padding(.horizontal, 28).padding(.top, 8)
if g.playback.karaokeVocals == .Soft {
let db = g.settings.karaokeSoftDb
HStack(spacing: 12) {
Text("Softness").font(.subheadline.weight(.semibold)).foregroundStyle(p.label2)
Slider(value: Binding(get: { Double(db) }, set: { g.playback.setKaraokeSoftDb(Int($0.rounded())) }), in: -30...(-3), step: 1)
Text("\(db) dB").font(.caption).monospacedDigit().foregroundStyle(p.label2).frame(width: 46, alignment: .trailing)
}
.padding(.horizontal, 28).padding(.top, 8)
}
}
content
}
+14 -2
View File
@@ -159,11 +159,12 @@ struct StemPlaylistScreen: View {
}
.toolbar {
ToolbarItemGroup(placement: .topBarTrailing) {
if !editing { MoreMenu(items: moreItems(pl)) }
if editing { Button("Done") { g.stemPlaylists.setItems(pl.id, items); editing = false }.bold() }
else if !pl.items.isEmpty { Button("Edit") { items = pl.items; editing = true } }
if !editing { MoreMenu(items: moreItems(pl)) }
}
}
.modifier(SplitHidesTitle())
}
private func header(_ pl: StemPlaylist) -> some View {
@@ -267,14 +268,15 @@ struct PlaylistScreen: View {
}
.toolbar {
ToolbarItemGroup(placement: .topBarTrailing) {
if !editing { MoreMenu(items: moreItems(list)) }
if !playlist.smart && !list.isEmpty {
if saving { ProgressView() }
else if editing { Button("Done") { commit(list) }.bold() }
else { Button("Edit") { items = list; removed = []; editing = true } }
}
if !editing { MoreMenu(items: moreItems(list)) }
}
}
.modifier(SplitHidesTitle())
.task(id: reload) {
await LoadState.load($tracks) { try await g.plex.playlistTracks(playlist.ratingKey) }
}
@@ -413,3 +415,13 @@ struct SearchScreen: View {
}
}
}
/// Split at the Duo's hinge the pane's own header already names the playlist, so the bar drops the title.
private struct SplitHidesTitle: ViewModifier {
@Environment(Ui.self) private var ui
func body(content: Content) -> some View {
content.toolbar {
if ui.split { ToolbarItem(placement: .principal) { Color.clear.frame(width: 1, height: 1) } }
}
}
}
+47 -38
View File
@@ -140,7 +140,7 @@ private func clean(_ url: String) -> String {
return u
}
/// Four little faders in the stem colours: the Settings mark.
/// Four little faders in the stem colors: the Settings mark.
private struct StemMark: View {
var scale: CGFloat = 1
var body: some View {
@@ -279,6 +279,7 @@ struct SettingsScreen: View {
case .online(let n, _): "\(n.formatted()) songs with stems"
case .offline(_, let cached): cached > 0 ? "Can't reach it, \(cached.formatted()) songs saved" : "Can't reach it"
case .unknown: "Checking…"
case .off: "Off, Plex only"
}
}
}
@@ -345,7 +346,7 @@ private let maintainers = [
coffee: "https://venmo.com/code?user_id=2910252785729536546&created=1792897467", tipTitle: "Venmo", tipIcon: "dollarsign.circle.fill"),
]
/// A maintainer's picture in a ring of their stem colour, their name and what they look after.
/// A maintainer's picture in a ring of their stem color, their name and what they look after.
private struct MaintainerCard: View {
let m: Maintainer
@Environment(\.palette) private var p
@@ -826,40 +827,51 @@ struct StemServerScreen: View {
let status = g.stems.status
List {
Section {
FieldCell(label: "Address", text: $url, placeholder: "http://192.168.86.2:8765")
FieldCell(label: "Token", text: $token, placeholder: "Optional", secret: true)
ActionCell(title: busy ? "Connecting…" : "Save & Connect") { connect() }
} header: { Header(text: "stemserve") } footer: {
Footer(text: "stemserve shares the Stems folder that stemd fills (port 8765). The app checks it for new stems every minute.\n\n" + matchNote)
}
Section {
ValueCell(title: "Connection", value: {
switch status {
case .online: "Online"
case .offline: "Offline"
case .unknown: "Checking"
}
}()).themedRow()
ValueCell(title: "Songs with Stems", value: {
switch status {
case .online(let n, _): "\(n)"
case .offline(_, let n): "\(n) (cached)"
case .unknown: "—"
}
}()).themedRow()
ValueCell(title: "stemd", value: g.stems.liveLine ?? (g.stems.failed.isEmpty ? "Idle" : "\(g.stems.failed.count) failed")).themedRow()
ValueCell(title: "Opus Transcoding", value: {
if case .online(_, let t) = status { return t ? "Available" : "No ffmpeg" }
return "—"
}()).themedRow()
if case .offline(let reason, _) = status {
VStack(alignment: .leading, spacing: 2) {
Text("Error").foregroundStyle(p.label)
Text(reason).font(.footnote).foregroundStyle(p.label2)
}
Toggle(isOn: Binding(get: { !g.settings.stemServerOff }, set: { on in
g.settings.stemServerOff = !on
Task { await g.stems.refresh(force: true) }
})) { Text("Use Stem Server").foregroundStyle(p.label) }
.tint(Color(hex: 0x34C759))
.themedRow()
}
if !g.settings.stemServerOff {
Section {
FieldCell(label: "Address", text: $url, placeholder: "http://192.168.86.2:8765")
FieldCell(label: "Token", text: $token, placeholder: "Optional", secret: true)
ActionCell(title: busy ? "Connecting…" : "Save & Connect") { connect() }
} header: { Header(text: "stemserve") } footer: {
Footer(text: "stemserve shares the Stems folder that stemd fills (port 8765). The app checks it for new stems every minute.\n\n" + matchNote)
}
} header: { Header(text: "Status") }
Section {
ValueCell(title: "Connection", value: {
switch status {
case .online: "Online"
case .offline: "Offline"
case .unknown: "Checking"
case .off: "Off"
}
}()).themedRow()
ValueCell(title: "Songs with Stems", value: {
switch status {
case .online(let n, _): "\(n)"
case .offline(_, let n): "\(n) (cached)"
case .unknown, .off: "—"
}
}()).themedRow()
ValueCell(title: "stemd", value: g.stems.liveLine ?? (g.stems.failed.isEmpty ? "Idle" : "\(g.stems.failed.count) failed")).themedRow()
ValueCell(title: "Opus Transcoding", value: {
if case .online(_, let t) = status { return t ? "Available" : "No ffmpeg" }
return "—"
}()).themedRow()
if case .offline(let reason, _) = status {
VStack(alignment: .leading, spacing: 2) {
Text("Error").foregroundStyle(p.label)
Text(reason).font(.footnote).foregroundStyle(p.label2)
}
.themedRow()
}
} header: { Header(text: "Status") }
}
}
.listStyle(.insetGrouped)
.themedList()
@@ -1031,13 +1043,10 @@ struct AppearanceScreen: View {
.themedRow()
}
Section {
Toggle(isOn: $s.albumColorNowPlaying) { Text("Album Colour Background").foregroundStyle(c.label) }
.tint(Color(hex: 0x34C759))
.themedRow()
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.") }
} header: { Header(text: "Now Playing") } footer: { Footer(text: "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))
+3 -3
View File
@@ -8,7 +8,7 @@ extension Color {
}
}
/// The three themes' colours. Black is true black for OLED; no gradients anywhere.
/// The three themes' colors. Black is true black for OLED; no gradients anywhere.
struct Palette {
var dark: Bool
var bg: Color
@@ -60,7 +60,7 @@ extension View {
/// A list on the theme's background instead of the system one.
func themedList(grouped: Bool = true) -> some View { modifier(ThemedList(grouped: grouped)) }
/// Rows on the theme's cell colour.
/// Rows on the theme's cell color.
func themedRow(grouped: Bool = true) -> some View { modifier(ThemedRow(grouped: grouped)) }
}
@@ -103,7 +103,7 @@ func artHue(_ thumb: String?) async -> ArtHue? {
}
extension Palette {
/// The theme recoloured around the art's hue: lightly tinted surfaces and an accent in the art's colour.
/// The theme recolored around the art's hue: lightly tinted surfaces and an accent in the art's color.
/// Black keeps its true-black background for OLED.
func art(_ a: ArtHue, mode: ThemeMode) -> Palette {
var c = self
+1 -1
View File
@@ -128,7 +128,7 @@ struct Art: View {
}
}
/// The primary-coloured capsule that moves to the next mix.
/// The primary-colored capsule that moves to the next mix.
struct MixPill: View {
let text: String
var icon = "chevron.right"
+3 -3
View File
@@ -7,9 +7,9 @@ settings:
base:
SWIFT_VERSION: "5.0"
# iOS needs a plain number for the bundle version; the label is what the app and releases show.
MARKETING_VERSION: "0.10.0"
VERSION_LABEL: "0.10.0"
CURRENT_PROJECT_VERSION: "40"
MARKETING_VERSION: "0.10.1"
VERSION_LABEL: "0.10.1"
CURRENT_PROJECT_VERSION: "48"
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
APP_ID: org.cdnutter.stemify
APP_NAME: Stemify
+10
View File
@@ -15,6 +15,16 @@
"tintColor": "#FA2D48",
"category": "entertainment",
"versions": [
{
"version": "0.10.1",
"marketingVersion": "0.10.1",
"buildVersion": "47",
"date": "2026-11-20T10:17:10-08:00",
"localizedDescription": "iOS: free orientation in background, re-lock after resume settles",
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v0.10.1/stemify-0.10.1.ipa",
"size": 3136176,
"minOSVersion": "17.0"
},
{
"version": "0.10.0",
"marketingVersion": "0.10.0",
+2 -2
View File
@@ -41,7 +41,7 @@ function artPalette([h, s0, v], base) {
return { bg: black ? "#000000" : hex(h, tint, .09), panel: black ? "#000000" : hex(h, tint, .06), raised: hex(h, tint, black ? .085 : .145), line: hex(h, tint, black ? .12 : .18),
text: hex(h, .15, .93), muted: hex(h, .1, .66), accent: hex(h, Math.max(s, .55), clamp(v * .7, .58, .7)) };
}
// Roughly a vibrant swatch: the circular mean hue of the most colourful mid-bright pixels.
// Roughly a vibrant swatch: the circular mean hue of the most colorful mid-bright pixels.
function vibrant(bm) {
const n = 24, cv = new OffscreenCanvas(n, n), cx = cv.getContext("2d", { willReadFrequently: true });
cx.drawImage(bm, 0, 0, n, n);
@@ -287,7 +287,7 @@ const karaokeHtml = () => `<div class="kara">
<div class="seg">${[["off", "No vocals"], ["soft", "Soft vocals"], ["on", "Vocals on"]].map(([m, l]) => `<button class="${S.karaokeMode === m ? "on" : ""}" data-kmode="${m}">${l}</button>`).join("")}</div>
${S.karaokeMode === "soft" ? `<label class="note">Soft vocals: <b id="softdb">${S.softDb} dB</b><input type="range" min="-30" max="-3" step="1" value="${S.softDb}" data-softdb></label>` : ""}</div>`;
// Stem colours match the iOS app.
// Stem colors match the iOS app.
const STEM_COLORS = { vocals: "#ff7ab6", drums: "#ffb547", bass: "#7c8cff", other: "#4cd07d", guitar: "#ff8a5c", piano: "#b48cff", instrumental: "#3dd6c6" };
const pct = v => Math.round(v * 100) + "%";
function presetsHtml(names) {