chore: import upstream snapshot with attribution
CI / lint (push) Has been cancelled
CI / js-syntax (push) Successful in 10m24s
CI / deps-audit (push) Has been cancelled
CI / test (push) Failing after 24m55s
CI / sast-bandit (push) Failing after 11m13s
CI / trivy (push) Failing after 9m32s
Docker Publish / build-and-push (push) Failing after 34m3s
CI / lint (push) Has been cancelled
CI / js-syntax (push) Successful in 10m24s
CI / deps-audit (push) Has been cancelled
CI / test (push) Failing after 24m55s
CI / sast-bandit (push) Failing after 11m13s
CI / trivy (push) Failing after 9m32s
Docker Publish / build-and-push (push) Failing after 34m3s
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
// Fallback list used before /api/config responds. Kept in sync with
|
||||
// STEM_NAMES in app/core/config.py — the API is the canonical source.
|
||||
export let STEM_NAMES = ["vocals", "drums", "bass", "guitar", "piano", "other"];
|
||||
export let TRACK_NAMES = ["original", ...STEM_NAMES];
|
||||
|
||||
export async function syncStemNamesFromAPI() {
|
||||
try {
|
||||
const res = await fetch("/api/config");
|
||||
if (!res.ok) return;
|
||||
const data = await res.json();
|
||||
if (Array.isArray(data.stem_names) && data.stem_names.length > 0) {
|
||||
STEM_NAMES = data.stem_names;
|
||||
TRACK_NAMES = ["original", ...STEM_NAMES];
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("[constants] failed to sync stem names from API:", e);
|
||||
}
|
||||
}
|
||||
|
||||
export const STEM_DISPLAY = {
|
||||
vocals: "Vocals",
|
||||
drums: "Drums",
|
||||
bass: "Bass",
|
||||
guitar: "Guitar",
|
||||
piano: "Piano",
|
||||
other: "Other",
|
||||
original: "Original",
|
||||
};
|
||||
|
||||
// FL Studio-style channel palette: saturated but slightly dusty, designed
|
||||
// to read well on a dark background.
|
||||
export const STEM_COLORS = {
|
||||
vocals: "#e85f6f",
|
||||
drums: "#e89048",
|
||||
bass: "#e8b848",
|
||||
guitar: "#88d878",
|
||||
piano: "#b88fe8",
|
||||
other: "#88a8c8",
|
||||
original: "#a8b0bd",
|
||||
};
|
||||
|
||||
export const PROGRESS_COLOR = "#3a3a3a";
|
||||
|
||||
export const LOOP_DEFAULT_START_FRAC = 0.25;
|
||||
export const LOOP_DEFAULT_END_FRAC = 0.5;
|
||||
|
||||
export const LANE_VOLUME_MAX = 2;
|
||||
Reference in New Issue
Block a user