ios: 1.0.15, mixer rows stretch to fill spare height
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e7e4fcc9d6
commit
c17d6f174b
2 files changed
+13
-7
No files matched your search
@@ -583,6 +583,9 @@ private struct MixerPanel: View {
|
|||||||
let pm = g.playback
|
let pm = g.playback
|
||||||
let names = pm.stemNames
|
let names = pm.stemNames
|
||||||
let stems = pm.source == .Stems
|
let stems = pm.source == .Stems
|
||||||
|
GeometryReader { geo in
|
||||||
|
// Spread spare height across the rows (stems + master) instead of leaving it all at the bottom.
|
||||||
|
let rowH = min(62, max(46, (geo.size.height - 80) / CGFloat(names.count + 1)))
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
if pm.source == .Original {
|
if pm.source == .Original {
|
||||||
@@ -622,20 +625,21 @@ private struct MixerPanel: View {
|
|||||||
let levels = stems ? meters.step(pm.engine, names.count) : []
|
let levels = stems ? meters.step(pm.engine, names.count) : []
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
ForEach(Array(names.enumerated()), id: \.element) { i, name in
|
ForEach(Array(names.enumerated()), id: \.element) { i, name in
|
||||||
StemFader(name: name, setting: pm.mix[name] ?? StemSetting(), level: i < levels.count ? levels[i] : 0, enabled: stems)
|
StemFader(name: name, setting: pm.mix[name] ?? StemSetting(), level: i < levels.count ? levels[i] : 0, enabled: stems, height: rowH)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.separator.frame(height: 0.5).padding(.vertical, 6)
|
p.separator.frame(height: 0.5).padding(.vertical, 6)
|
||||||
FaderRow(dot: nil, label: "Master", percent: Int(pm.master * 100), dim: false) {
|
FaderRow(dot: nil, label: "Master", percent: Int(pm.master * 100), dim: false, height: rowH) {
|
||||||
FaderSlider(value: pm.master, fill: p.label, onChange: pm.setMaster)
|
FaderSlider(value: pm.master, fill: p.label, onChange: pm.setMaster)
|
||||||
} trailing: { EmptyView() }
|
} trailing: { EmptyView() }
|
||||||
Spacer(minLength: 12)
|
Spacer(minLength: 16)
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 24)
|
.padding(.horizontal, 24)
|
||||||
}
|
}
|
||||||
.scrollIndicators(.hidden)
|
.scrollIndicators(.hidden)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [Chip] in the sheet's own colours: selected is the label colour, so it reads on any tint.
|
/// [Chip] in the sheet's own colours: selected is the label colour, so it reads on any tint.
|
||||||
@@ -665,12 +669,13 @@ private struct StemFader: View {
|
|||||||
let setting: StemSetting
|
let setting: StemSetting
|
||||||
let level: Float
|
let level: Float
|
||||||
let enabled: Bool
|
let enabled: Bool
|
||||||
|
var height: CGFloat = 46
|
||||||
@Environment(\.palette) private var p
|
@Environment(\.palette) private var p
|
||||||
private var pm: PlaybackManager { AppGraph.shared.playback }
|
private var pm: PlaybackManager { AppGraph.shared.playback }
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
let color = Color(hex: Stems.color(name))
|
let color = Color(hex: Stems.color(name))
|
||||||
FaderRow(dot: setting.muted ? p.label3 : color, label: Stems.label(name), percent: Int(stemTaper(setting.level) * 100), dim: setting.muted) {
|
FaderRow(dot: setting.muted ? p.label3 : color, label: Stems.label(name), percent: Int(stemTaper(setting.level) * 100), dim: setting.muted, height: height) {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
FaderSlider(value: setting.level, fill: setting.muted ? p.label3 : color, detent: StemSetting.unity, enabled: enabled) {
|
FaderSlider(value: setting.level, fill: setting.muted ? p.label3 : color, detent: StemSetting.unity, enabled: enabled) {
|
||||||
pm.setStemLevel(name, $0)
|
pm.setStemLevel(name, $0)
|
||||||
@@ -702,6 +707,7 @@ private struct FaderRow<Fader: View, Trailing: View>: View {
|
|||||||
let label: String
|
let label: String
|
||||||
let percent: Int
|
let percent: Int
|
||||||
let dim: Bool
|
let dim: Bool
|
||||||
|
var height: CGFloat = 46
|
||||||
@ViewBuilder let fader: Fader
|
@ViewBuilder let fader: Fader
|
||||||
@ViewBuilder let trailing: Trailing
|
@ViewBuilder let trailing: Trailing
|
||||||
@Environment(\.palette) private var p
|
@Environment(\.palette) private var p
|
||||||
@@ -718,7 +724,7 @@ private struct FaderRow<Fader: View, Trailing: View>: View {
|
|||||||
.frame(width: 36, alignment: .trailing)
|
.frame(width: 36, alignment: .trailing)
|
||||||
trailing
|
trailing
|
||||||
}
|
}
|
||||||
.frame(height: 46)
|
.frame(height: height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -6,8 +6,8 @@ options:
|
|||||||
settings:
|
settings:
|
||||||
base:
|
base:
|
||||||
SWIFT_VERSION: "5.0"
|
SWIFT_VERSION: "5.0"
|
||||||
MARKETING_VERSION: "1.0.14"
|
MARKETING_VERSION: "1.0.15"
|
||||||
CURRENT_PROJECT_VERSION: "15"
|
CURRENT_PROJECT_VERSION: "16"
|
||||||
targets:
|
targets:
|
||||||
Stemify:
|
Stemify:
|
||||||
type: application
|
type: application
|
||||||
|
|||||||
Reference in new issue
Block a user