diff --git a/src/division.cpp b/src/division.cpp index c1bb6c0..9ef79e6 100644 --- a/src/division.cpp +++ b/src/division.cpp @@ -196,8 +196,11 @@ Division::Division(Project *_project, MidiData &src, const DivisionSetting &sett void Division::divide_from_data(MidiData &src, const DivisionSetting &setting, bool copy) { if (copy) src_data = src; // store a copy of the src data... - - init(); /* clean ourselves up */ + else { + auto q = quantize; + init(); /* clean ourselves up */ + quantize = q; + } name = setting.name; diff --git a/src/midi_data.h b/src/midi_data.h index a9239e1..26796c7 100644 --- a/src/midi_data.h +++ b/src/midi_data.h @@ -22,8 +22,10 @@ class MidiData{ typedef std::pair MidiCCLanePair; wxString source_filename; +protected: + int quantize; + private: - int quantize; MidiNotesLane note_events; // �m�[�g MidiParamsLane pb_events; // �s�b�`�x���h diff --git a/src/midi_smfin.cpp b/src/midi_smfin.cpp index 5a23a4a..78c9f7d 100644 --- a/src/midi_smfin.cpp +++ b/src/midi_smfin.cpp @@ -158,11 +158,14 @@ bool MidiData::load_smf(const wxString &filename) { if (!smf.load(filename)) { return false; } + + init(); /* az: don't write on top of existing MIDI data in case of reload */ + quantize = smf.get_delta_time(); size_t track_count = smf.get_track_count(); if (!track_count) return false; - init(); /* az: don't write on top of existing MIDI data in case of reload */ + source_filename = filename; std::vector track_pre(track_count);