disable unused param check for building; updated version number; avoid relying on constructor.name to determine class type due to class name mangling.

This commit is contained in:
Xiaohan-Tian
2025-08-11 19:54:51 -07:00
parent 4ceadbd09c
commit af9eca8fee
6 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -313,7 +313,7 @@ export const useProjectStore = create<ProjectState>((set, get) => {
// Type guard to check if track is KGMidiTrack
const isMidiTrack = (track: KGTrack): track is KGMidiTrack => {
return track.constructor.name === 'KGMidiTrack' && 'getInstrument' in track;
return track.getCurrentType() === 'KGMidiTrack' && 'getInstrument' in track;
};
// Check if instrument changed (only for MIDI tracks)
@@ -455,7 +455,7 @@ export const useProjectStore = create<ProjectState>((set, get) => {
const trackId = track.getId().toString();
// Get instrument from track model if it's a MIDI track
let instrument: InstrumentType = 'acoustic_grand_piano'; // Default fallback
if (track.constructor.name === 'KGMidiTrack' && 'getInstrument' in track) {
if (track.getCurrentType() === 'KGMidiTrack' && 'getInstrument' in track) {
instrument = (track as KGMidiTrack).getInstrument();
}
audioInterface.createTrackSynth(trackId, instrument);