plugin v1.0.1
This commit is contained in:
1 parent
82e1ff025a
commit
bdfae5032b
3 files changed
+41
-76
No files matched your search
@@ -314,7 +314,7 @@ export async function parseMmpContent(xmlString) {
|
||||
console.log("Restaurando estado temporário da sessão...");
|
||||
const tempState = JSON.parse(tempStateJSON);
|
||||
|
||||
// 1. Restaura Pattern (código que já existia)
|
||||
// 1. Restaura Pattern (mantido)
|
||||
appState.pattern.tracks.forEach((liveTrack) => {
|
||||
const savedTrack = tempState.pattern.tracks.find(
|
||||
(t) => t.id === liveTrack.id
|
||||
@@ -325,7 +325,6 @@ export async function parseMmpContent(xmlString) {
|
||||
liveTrack.activePatternIndex = savedTrack.activePatternIndex;
|
||||
liveTrack.volume = savedTrack.volume;
|
||||
liveTrack.pan = savedTrack.pan;
|
||||
|
||||
if (liveTrack.volumeNode) {
|
||||
liveTrack.volumeNode.volume.value = Tone.gainToDb(savedTrack.volume);
|
||||
}
|
||||
@@ -334,20 +333,18 @@ export async function parseMmpContent(xmlString) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Filtra tracks deletadas
|
||||
appState.pattern.tracks = appState.pattern.tracks.filter((liveTrack) =>
|
||||
tempState.pattern.tracks.some((t) => t.id === liveTrack.id)
|
||||
);
|
||||
|
||||
// 2. 🔥 FIX: Restaura Áudio (Clips e Tracks)
|
||||
// 2. 🔥 NOVO: Restaura Áudio (Clips e Tracks) no F5
|
||||
if (tempState.audio) {
|
||||
console.log("Restaurando faixas de áudio e clips...");
|
||||
appState.audio.tracks = tempState.audio.tracks || [];
|
||||
appState.audio.clips = tempState.audio.clips || [];
|
||||
}
|
||||
|
||||
// 3. Restaura Global
|
||||
// 3. Restaura Global (mantido)
|
||||
document.getElementById("bpm-input").value = tempState.global.bpm;
|
||||
document.getElementById("compasso-a-input").value = tempState.global.compassoA;
|
||||
document.getElementById("compasso-b-input").value = tempState.global.compassoB;
|
||||
@@ -355,7 +352,6 @@ export async function parseMmpContent(xmlString) {
|
||||
|
||||
if (tempState.global.syncMode) {
|
||||
appState.global.syncMode = tempState.global.syncMode;
|
||||
// Atualiza visual do botão sync se existir (pode precisar disparar evento ou fazer manual)
|
||||
const syncBtn = document.getElementById("sync-mode-btn");
|
||||
if (syncBtn) {
|
||||
syncBtn.classList.toggle("active", tempState.global.syncMode === "global");
|
||||
|
||||
Reference in new issue
Block a user