X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fardour%2Fquantize.cc;h=f484a1602a817b6ca3d22855fd44a0df17678a20;hb=d01cb7910faddbf13b7190ceca990a2cafb71f95;hp=bcce41c96d2da0fe093ab34e95f080f7cabad055;hpb=8803cd664ce7554ba42417b326de2d0b0c407549;p=ardour.git diff --git a/libs/ardour/quantize.cc b/libs/ardour/quantize.cc index bcce41c96d..f484a1602a 100644 --- a/libs/ardour/quantize.cc +++ b/libs/ardour/quantize.cc @@ -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;