Fixes and Changes again

This commit is contained in:
2026-02-22 17:28:27 +02:00
parent 8abb65ac8d
commit ae4b31328f
11 changed files with 1617 additions and 96 deletions

View File

@@ -130,11 +130,11 @@ export default function SpeedCalculatorModal({ open, melody, builtMelody, archet
const stepsRef = useRef([]);
const stepDelayRef = useRef(500);
const effectiveBeatRef = useRef(100);
const loopRef = useRef(false);
const loopRef = useRef(true);
const [playing, setPlaying] = useState(false);
const [paused, setPaused] = useState(false);
const [loop, setLoop] = useState(false);
const [loop, setLoop] = useState(true);
const [currentStep, setCurrentStep] = useState(-1);
// Sliders
@@ -285,11 +285,14 @@ export default function SpeedCalculatorModal({ open, melody, builtMelody, archet
};
const handleLoadFromBinary = async () => {
if (!builtMelody?.binary_url) return;
const binaryUrl = builtMelody?.binary_url
? `/api${builtMelody.binary_url}`
: melody?.url || null;
if (!binaryUrl) return;
setLoadingBinary(true);
setBinaryLoadError("");
try {
const decoded = await decodeBsmBinary(`/api${builtMelody.binary_url}`);
const decoded = await decodeBsmBinary(binaryUrl);
setSteps(decoded);
stepsRef.current = decoded;
stopPlayback();
@@ -388,7 +391,7 @@ export default function SpeedCalculatorModal({ open, melody, builtMelody, archet
<label className="text-sm font-medium" style={labelStyle}>
Melody Steps
</label>
{builtMelody?.binary_url && (
{(builtMelody?.binary_url || melody?.url) && (
<button
onClick={handleLoadFromBinary}
disabled={loadingBinary}