Skip to content

Commit

Permalink
fix quantize being overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoru committed Feb 7, 2021
1 parent 68afa1b commit a2617e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/division.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion src/midi_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ class MidiData{
typedef std::pair<int, MidiParamsLane> MidiCCLanePair;
wxString source_filename;

protected:
int quantize;

private:
int quantize;

MidiNotesLane note_events; // �m�[�g
MidiParamsLane pb_events; // �s�b�`�x���h
Expand Down
5 changes: 4 additions & 1 deletion src/midi_smfin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<MidiData_PreLoader> track_pre(track_count);
Expand Down

0 comments on commit a2617e5

Please sign in to comment.