From 1151f1afa045e40205b8ff16c85f9c081c82da61 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sat, 25 Jul 2026 18:36:11 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20b=E1=BA=ADt=20t=C3=ADnh=20n=C4=83ng=20g?= =?UTF-8?q?hi=20midi=20note=20trong=20piano=20roll=20tab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/app.jsx | 9 ++++----- app/storage/sonicforge.db | Bin 118784 -> 118784 bytes 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/static/js/app.jsx b/app/static/js/app.jsx index d418238..237cb99 100644 --- a/app/static/js/app.jsx +++ b/app/static/js/app.jsx @@ -5483,9 +5483,8 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, onClose, onUpdateNot const [selectedScale, setSelectedScale] = React.useState(null); const selectedScaleRef = React.useRef(null); selectedScaleRef.current = selectedScale; - const [snapToScale, setSnapToScale] = React.useState(true); const snapToScaleRef = React.useRef(true); - snapToScaleRef.current = snapToScale; + snapToScaleRef.current = st.snapToScale !== undefined ? st.snapToScale : true; const [scaleMenuPos, setScaleMenuPos] = React.useState(null); const scaleMenuOriginRef = React.useRef(null); const [showCC, setShowCC] = React.useState(true); @@ -5597,8 +5596,8 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, onClose, onUpdateNot }, /*#__PURE__*/React.createElement("span", { className: "text-zinc-500 font-semibold" }, "Snap to Scale"), /*#__PURE__*/React.createElement("button", { - onClick: () => setSnapToScale(!snapToScale), - className: `w-7 h-4 rounded-full transition-colors relative ${snapToScale ? 'bg-yellow-600' : 'bg-zinc-700'}`, + onClick: () => setSubTabs(prev => prev.map(s => s.id === st.id ? { ...s, snapToScale: !(s.snapToScale !== undefined ? s.snapToScale : true) } : s)), + className: `w-7 h-4 rounded-full transition-colors relative ${(st.snapToScale !== undefined ? st.snapToScale : true) ? 'bg-yellow-600' : 'bg-zinc-700'}`, style: { padding: 0 } }, /*#__PURE__*/React.createElement("div", { className: `w-3 h-3 rounded-full bg-white absolute top-0.5 transition-transform ${snapToScale ? 'translate-x-3.5' : 'translate-x-0.5'}` @@ -9841,7 +9840,7 @@ const App = () => { midiRec.tempTabId = tab.id; pianoRollRecorderRef.current = midiRec; activeMIDIRecordersRef.current['piano_roll'] = midiRec; - if (selectedMidiInputId) midiRec.setSelectedMidiInputId(selectedMidiInputId); + if (selectedMidiInputId) midiRec.selectedMidiInputId = selectedMidiInputId; setRecStartTimelineTime(startTime); recordingStartTimeRef.current = startTime; setRecordingState('RECORDING'); diff --git a/app/storage/sonicforge.db b/app/storage/sonicforge.db index 6eff710a3fcd563186d005312d33f9198b03c557..a7b6dc3b2e8d416ed04ff9bbd6e7169a96018c56 100644 GIT binary patch delta 224 zcmZozz}~QceS$Qj>_i!7M%j%C%ht0nF>o_&78Llw#o1ZS$Qd7MKS^+N-flN0HcJCj z6BCoobI!RkPF6S}$7yK}6fre0GnwpuA{xR2${S4X+OJ?+t(2LfWTljsUy>ScXl`Kw zRBLEvXbM!HlUr<{q@z@jS(2QgWMyWdqf}gySX2_9l$uzgWMycfXKp(Az$v}S|IhGF z-o9UWvdLK`p4wWLCdXSd)lUe;-rRJ+-hfqxfq_AGGvfs|h0OvNzRTkv9?Js&w7X5P delta 193 zcmZozz}~QceS$P2^F$eEM&^wP%ht1`GH|DE78Ho)=IoSUM zR7WYfw5TXGuOz-CGdC3^WMXb+YG!0Q+4QU;Pi-xWyyLBz%I_Lye%y4x-hfq>fq_A0 TGvfs|h0OvNzRTkv9?Js&HZ(z&