Skip to content

Commit

Permalink
Do not repeated audio split timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoru committed Nov 21, 2020
1 parent 4e50ea4 commit 8dda1d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/midi_smfin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class LoadSmfDialog : public wxDialog {
auto channels_lbl = new wxStaticText(this, ID_Tracks_Text, _("Channels (&C):"));
dlg_sizer->Add(channels_lbl);

auto chan_grid = new wxGridSizer(4, 4, 3, 3);
auto chan_grid = new wxGridSizer(4, 4, 5, 5);
dlg_sizer->Add(chan_grid);

for (int i = 0; i < 16; i++) {
Expand Down
7 changes: 3 additions & 4 deletions src/wavsplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,16 @@ void SplitFile(
}

std::vector<double> GetSplitPoints(Division *pDivision, double bpm, double offset_ms) {
std::vector<double> ret;
ret.reserve(pDivision->notes_count());
std::set<double> ret;

for (int i = 0; i < pDivision->notes_count(); i++) {
auto note = pDivision->notes(i);
auto beat = (double)note.position / (double)pDivision->get_quantize();
auto spb = 60 / bpm;
auto time = spb * beat + offset_ms / 1000.0;

ret.push_back(time);
ret.insert(time);
}

return ret;
return std::vector(ret.begin(), ret.end());
}

0 comments on commit 8dda1d8

Please sign in to comment.