13
0

Editor::get_grid_type_as_beats() returns the quarter note equivalent of BBT beat and bar.

This commit is contained in:
nick_m 2016-09-02 05:11:54 +10:00
parent 46858a2925
commit e689182a6a

View File

@ -4105,10 +4105,11 @@ Editor::get_grid_type_as_beats (bool& success, framepos_t position)
switch (_snap_type) {
case SnapToBeat:
return Evoral::Beats(1.0);
return Evoral::Beats(4.0 / _session->tempo_map().meter_at_frame (position).note_divisor());
case SnapToBar:
if (_session) {
return Evoral::Beats(_session->tempo_map().meter_at_frame (position).divisions_per_bar());
const Meter& m = _session->tempo_map().meter_at_frame (position);
return Evoral::Beats((4.0 * m.divisions_per_bar()) / m.note_divisor());
}
break;
default: