fix: snap default '1' + Power button reads masterConnected directly
- snapValue default '1' (was 'free'), piano roll snapVal default '1' (was '1/16') - Power button: remove shared isFxActive, use masteringSettings.masterConnected
This commit is contained in:
@@ -989,18 +989,16 @@ const MasterStripConsole = ({ masterVolume, setMasterVolume, showMasteringModal,
|
|||||||
),
|
),
|
||||||
React.createElement("button", {
|
React.createElement("button", {
|
||||||
id: "fxBtn",
|
id: "fxBtn",
|
||||||
className: "btn-daw h-[18px] rounded font-extrabold text-[10px] transition-all" + (isFxActive ? " btn-teal-active" : ""),
|
className: "btn-daw h-[18px] rounded font-extrabold text-[10px] transition-all",
|
||||||
onClick: function() { setShowMasteringModal(true); },
|
onClick: function() { setShowMasteringModal(true); },
|
||||||
title: "Mở MASTERING PANEL để chỉnh sửa"
|
title: "Mở MASTERING PANEL để chỉnh sửa"
|
||||||
}, "FX"),
|
}, "FX"),
|
||||||
React.createElement("button", {
|
React.createElement("button", {
|
||||||
id: "powerBtn",
|
id: "powerBtn",
|
||||||
className: "btn-daw h-[18px] rounded text-xs transition-all" + (isFxActive ? " btn-teal-active" : ""),
|
className: "btn-daw h-[18px] rounded text-xs transition-all" + (isMasterActive ? " btn-teal-active" : ""),
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
var newActive = !isFxActive;
|
|
||||||
setIsFxActive(newActive);
|
|
||||||
if (setMasteringSettings) {
|
if (setMasteringSettings) {
|
||||||
setMasteringSettings(function(prev) { return Object.assign({}, prev, { isBypassed: !newActive, masterConnected: newActive }); });
|
setMasteringSettings(function(prev) { return Object.assign({}, prev, { isBypassed: prev.masterConnected ? false : true, masterConnected: !prev.masterConnected }); });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
title: "Bật/Tắt MASTERING PANEL Bypass"
|
title: "Bật/Tắt MASTERING PANEL Bypass"
|
||||||
@@ -5789,7 +5787,7 @@ Ví dụ: Nhạc phim epic, dàn nhạc giao hưởng, tempo 130 BPM, giọng Cm
|
|||||||
|
|
||||||
const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, activeTracks, onClose, onUpdateNotes, onSaveNotes, setSubTabs, onPlayPause, onStop, isPlaying, playPreviewNote, showToast, midiDevices, recordingState, recTempMidiNotes, onRecord, selectedMidiInputId, onMidiInputSelect, activeMidiPitches, onInstrumentSelect, onRescheduleMidi, onSeekPlayhead }) => {
|
const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, activeTracks, onClose, onUpdateNotes, onSaveNotes, setSubTabs, onPlayPause, onStop, isPlaying, playPreviewNote, showToast, midiDevices, recordingState, recTempMidiNotes, onRecord, selectedMidiInputId, onMidiInputSelect, activeMidiPitches, onInstrumentSelect, onRescheduleMidi, onSeekPlayhead }) => {
|
||||||
const [activeRollTool, setActiveRollTool] = React.useState('select');
|
const [activeRollTool, setActiveRollTool] = React.useState('select');
|
||||||
const [snapVal, setSnapVal] = React.useState('1/16');
|
const [snapVal, setSnapVal] = React.useState('1');
|
||||||
const [ccMode, setCcMode] = React.useState('velocity');
|
const [ccMode, setCcMode] = React.useState('velocity');
|
||||||
const [rollZoom, setRollZoom] = React.useState(60); // local horizontal zoom factor
|
const [rollZoom, setRollZoom] = React.useState(60); // local horizontal zoom factor
|
||||||
const [aiBarStart, setAiBarStart] = React.useState(0);
|
const [aiBarStart, setAiBarStart] = React.useState(0);
|
||||||
@@ -9043,7 +9041,7 @@ const App = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [activeTool, setActiveTool] = useState('select'); // 'select' | 'grab' | 'razor'
|
const [activeTool, setActiveTool] = useState('select'); // 'select' | 'grab' | 'razor'
|
||||||
const [snapValue, setSnapValue] = useState('free'); // 'free', '1', '1/2', '1/4', '1/8', '1/16', '1/32'
|
const [snapValue, setSnapValue] = useState('1'); // 'free', '1', '1/2', '1/4', '1/8', '1/16', '1/32'
|
||||||
|
|
||||||
const snapTime = (time, snapVal, bpmVal) => {
|
const snapTime = (time, snapVal, bpmVal) => {
|
||||||
if (snapVal === 'free') return time;
|
if (snapVal === 'free') return time;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -849,6 +849,12 @@
|
|||||||
- **Các file ảnh hưởng:** `app/templates/index.html`, `app/static/js/app.jsx`
|
- **Các file ảnh hưởng:** `app/templates/index.html`, `app/static/js/app.jsx`
|
||||||
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
||||||
|
|
||||||
|
### [2026-07-30 20:58] Task: Fix snap default + Power button mastering bypass
|
||||||
|
- **Tóm tắt thay đổi:** (1) snapValue mặc định `'1'` (thay `'free'`), snapVal PIANO_ROLL mặc định `'1'` (thay `'1/16'`); (2) Power button trong MasterStripConsole: bỏ `isFxActive` local state dùng chung sai với FX button, đọc `masteringSettings.masterConnected` trực tiếp → toggle `masterConnected` + set `isBypassed` tương ứng.
|
||||||
|
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
|
||||||
|
- **Ghi chú/Test (nếu có):** `npm run build` pass. Load project → snap = 1. Mixer → Power button → mastering bật/tắt đúng.
|
||||||
|
---
|
||||||
|
|
||||||
### [2026-07-30 20:52] Task: Fix audio clip items lost after reload
|
### [2026-07-30 20:52] Task: Fix audio clip items lost after reload
|
||||||
- **Tóm tắt thay đổi:** 3 root causes: (1) `serverFileId` không được lưu vào clip/track khi upload audio — `insertSoundClipAtCursor` gọi `uploadToServer` nhưng chỉ lưu vào global `serverFileIdMap`, không set `t.serverFileId`; (2) Serialize dùng `t.serverFileId` (null) → `audio_file_url` rỗng → Deserialize không lấy được fileId → `loadAudioBuffersForTracks` không load được buffer; (3) WaveformLane canvas `clip.buffer.numberOfChannels` crash khi buffer null → clip items không vẽ được. Fix: set `serverFileId` trên clip + track khi upload; serialize/deserialize `server_file_id` trong `source_data`; guard `if (!clip.buffer) return` trong WaveformLane.
|
- **Tóm tắt thay đổi:** 3 root causes: (1) `serverFileId` không được lưu vào clip/track khi upload audio — `insertSoundClipAtCursor` gọi `uploadToServer` nhưng chỉ lưu vào global `serverFileIdMap`, không set `t.serverFileId`; (2) Serialize dùng `t.serverFileId` (null) → `audio_file_url` rỗng → Deserialize không lấy được fileId → `loadAudioBuffersForTracks` không load được buffer; (3) WaveformLane canvas `clip.buffer.numberOfChannels` crash khi buffer null → clip items không vẽ được. Fix: set `serverFileId` trên clip + track khi upload; serialize/deserialize `server_file_id` trong `source_data`; guard `if (!clip.buffer) return` trong WaveformLane.
|
||||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
|
- **Các file ảnh hưởng:** `app/static/js/app.jsx`, `app/static/js/app.precompiled.js`
|
||||||
|
|||||||
Reference in New Issue
Block a user