X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fquantize.cc;h=b60b63dcf40176e1117055950251274ea3da40d5;hb=b66d5e842b954f69c3cdff71c133c78b93b4e698;hp=bcce41c96d2da0fe093ab34e95f080f7cabad055;hpb=46c83693284ece4a732d26e62113ea4ac584d539;p=ardour.git diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc index bcce41c96d..b60b63dcf4 100644 --- a/libs/ardour/quantize.cc +++ b/libs/ardour/quantize.cc @@ -23,7 +23,7 @@ #include "ardour/quantize.h" #include "ardour/midi_model.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace PBD; @@ -69,7 +69,7 @@ swing_position (double pos, double grid, double swing, double offset) * if the start grid is 1.0, the beat at 0 isn't swung, * but the beat at 1.0 is. the beat at 2.0 isn't swung, * but the beat at 3.0 is. and so on. - * + * * so the criterion for a position being swung is * whether or not ((possible_grid_position / grid) % 2) != 0 */ @@ -99,7 +99,7 @@ swing_position (double pos, double grid, double swing, double offset) /* now correct for start-of-model offset */ pos += offset; - + if (fabs (pos - swung_pos) > fabs (pos - swung_previous_grid_position)) { pos = swung_previous_grid_position; } else { @@ -131,11 +131,11 @@ Quantize::operator () (boost::shared_ptr model, /* compute new start + end points WITHOUT the offset * caused by the start of the model (see above). - * + * * these versions of new_start and new_end are * guaranteed to precisely align with the quantize grid(s). */ - + double new_start = round (((*i)->time().to_double() - offset) / _start_grid) * _start_grid; double new_end = round (((*i)->end_time().to_double() - offset) / _end_grid) * _end_grid; @@ -143,7 +143,7 @@ Quantize::operator () (boost::shared_ptr model, new_start = swing_position (new_start, _start_grid, _swing, offset); new_end = swing_position (new_end, _end_grid, _swing, offset); - + } else { /* now correct for start-of-model offset */ @@ -151,10 +151,10 @@ Quantize::operator () (boost::shared_ptr model, new_start += offset; new_end += offset; } - + double delta = new_start - (*i)->time().to_double(); - + if (fabs (delta) >= _threshold) { if (_snap_start) { delta *= _strength;