Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed0fd1d184 | ||
|
|
55f8574eaa | ||
|
|
07b5636bac | ||
|
|
88d3aa48e7 | ||
|
|
d6da47db9d | ||
|
|
4dfcfbf434 | ||
|
|
56c92e8b93 | ||
|
|
639b5368ff | ||
|
|
cfaedd06cf | ||
|
|
8f3a10df2f | ||
|
|
5868430f8a | ||
|
|
566c5f7e8f | ||
|
|
e833af2704 | ||
|
|
c9fa90a840 | ||
|
|
0516362461 |
No files matched your search
+1
-1
@@ -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,
|
||||
|
||||
@@ -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"/>',
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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,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] = [
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,8 @@ 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 }
|
||||
var isDuo: Bool { duo }
|
||||
|
||||
/// Called with the window's side insets. Upright, only the folded Duo has a trailing one.
|
||||
func sawInsets(trailing: CGFloat, upright: Bool) {
|
||||
@@ -136,8 +139,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 +161,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
|
||||
|
||||
@@ -19,8 +19,21 @@ 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()
|
||||
// The panes underneath stop reporting while this covers them, so watch for the
|
||||
// hinge here too: unfolding hands over to the split (docked) layout.
|
||||
.background(GeometryReader { geo in
|
||||
let c = DuoPane<EmptyView>.cut(geo)
|
||||
Color.clear.onChange(of: c == nil ? 0 : c!.vertical ? 2 : 1, initial: true) { _, k in
|
||||
guard k > 0 else { return }
|
||||
ui.setUnfolded(true)
|
||||
ui.setSplit(k == 2)
|
||||
}
|
||||
})
|
||||
.overlayHost(ui.overlays, level: 1)
|
||||
.environment(ui)
|
||||
.environment(\.palette, p)
|
||||
@@ -43,6 +56,7 @@ struct RootView: View {
|
||||
}
|
||||
|
||||
@Environment(\.verticalSizeClass) private var vSize
|
||||
@Environment(\.scenePhase) private var phase
|
||||
|
||||
private enum BarItem: Hashable { case deck, tab(Tab) }
|
||||
|
||||
@@ -195,11 +209,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,15 +239,22 @@ 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 }
|
||||
}
|
||||
}
|
||||
|
||||
/// Where the hinge cuts the view: sizes of the two sides and the gap between them.
|
||||
private struct Cut { var vertical: Bool; var first: CGFloat; var gap: CGFloat; var second: CGFloat }
|
||||
fileprivate struct Cut { var vertical: Bool; var first: CGFloat; var gap: CGFloat; var second: CGFloat }
|
||||
|
||||
private static func cut(_ geo: GeometryProxy) -> Cut? {
|
||||
fileprivate static func cut(_ geo: GeometryProxy) -> Cut? {
|
||||
let size = geo.size
|
||||
var c: Cut?
|
||||
// The hinge reports inactive while the phone lies flat, so ask for inactive regions too.
|
||||
@@ -245,6 +270,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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,12 +62,13 @@ 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
|
||||
/// (folded or any other iPhone) uses the roomy layout across the whole window.
|
||||
private var tight: Bool { docked }
|
||||
/// Full screen on the Duo (folded, or a Split View half), the controls run down into the home indicator strip.
|
||||
private var runsLow: Bool { !docked && (folded || ui.isDuo) }
|
||||
/// Size of the art panel in the stacked layout, so the controls can match the art's width.
|
||||
@State private var artBox: CGSize = .zero
|
||||
/// The screen's height, for the strip at the top that a drag down closes from.
|
||||
@@ -124,7 +82,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.
|
||||
@@ -135,7 +93,7 @@ struct NowPlayingScreen: View {
|
||||
if wide {
|
||||
// The column never drops below what the transport row needs, so the buttons
|
||||
// can't spill onto the art or under the Duo rail.
|
||||
let col = tight ? min(max(geo.size.width * 0.46, 300), 420) : min(geo.size.width * 0.48, 440)
|
||||
let col = tight ? min(max(geo.size.width * 0.46, 300), 420) : min(max(geo.size.width * 0.42, 300), 440)
|
||||
HStack(spacing: 0) {
|
||||
panelView(track, header: false)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
@@ -168,11 +126,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.
|
||||
.ignoresSafeArea(.container, edges: !docked && vSize == .regular ? (folded ? [.trailing, .bottom] : .trailing) : [])
|
||||
// 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, runsLow ? 6 : 0)
|
||||
.ignoresSafeArea(.container, edges: !docked && vSize == .regular ? (runsLow ? [.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, runsLow ? 0 : tight ? 4 : 8)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(c.bg.ignoresSafeArea())
|
||||
.overlay(alignment: .top) {
|
||||
@@ -190,19 +151,14 @@ 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
|
||||
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,
|
||||
case .Art: ArtPanel(thumb: track.thumb, playing: g.playback.playWhenReady, inset: header ? 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) }) }
|
||||
@@ -219,7 +175,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,7 +192,7 @@ 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 : ui.isDuo && !wide ? 30 : 14)
|
||||
.transition(.opacity.combined(with: .move(edge: .top)))
|
||||
}
|
||||
ProgressVolumeBar(played: g.settings.albumTheme ? c.accent : c.label, unplayed: c.label3, centerLabel: badge(track))
|
||||
@@ -856,7 +812,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 +928,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 +936,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 +956,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 +1000,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 +1031,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 +1183,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 +1272,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
|
||||
}
|
||||
|
||||
@@ -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) } }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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: "41"
|
||||
MARKETING_VERSION: "0.10.1"
|
||||
VERSION_LABEL: "0.10.1"
|
||||
CURRENT_PROJECT_VERSION: "50"
|
||||
# Dev builds override these (build-ipa.sh dev) so they install next to the release app.
|
||||
APP_ID: org.cdnutter.stemify
|
||||
APP_NAME: Stemify
|
||||
|
||||
@@ -15,6 +15,16 @@
|
||||
"tintColor": "#FA2D48",
|
||||
"category": "entertainment",
|
||||
"versions": [
|
||||
{
|
||||
"version": "0.10.1",
|
||||
"marketingVersion": "0.10.1",
|
||||
"buildVersion": "49",
|
||||
"date": "2026-11-20T10:33:02-08:00",
|
||||
"localizedDescription": "iOS: full-screen Now Playing watches the hinge so unfolding goes landscape; build 49",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v0.10.1/stemify-0.10.1.ipa",
|
||||
"size": 3141489,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "0.10.0",
|
||||
"marketingVersion": "0.10.0",
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user