no more BBT_Time round/round_up methods (GUI edition)

This commit is contained in:
Paul Davis 2025-08-19 07:59:23 -06:00
parent f0111bcea5
commit 66dde32a1b
3 changed files with 5 additions and 11 deletions

View file

@ -46,7 +46,7 @@ BBTMarkerDialog::BBTMarkerDialog (MusicTimePoint& p)
: ArdourDialog (_("Edit Music Time")) : ArdourDialog (_("Edit Music Time"))
, _point (&p) , _point (&p)
, _position (timepos_t::from_superclock (p.sclock())) , _position (timepos_t::from_superclock (p.sclock()))
, _bbt (TempoMap::use()->bbt_at (_position).round_to_beat ()) , _bbt (TempoMap::use()->meter_at (_position).round_to_beat (TempoMap::use()->bbt_at (_position)))
, bar_label (_("Bar")) , bar_label (_("Bar"))
, beat_label (_("Beat")) , beat_label (_("Beat"))
, name_label (_("Name")) , name_label (_("Name"))

View file

@ -2480,7 +2480,7 @@ Editor::choose_mapping_drag (ArdourCanvas::Item* item, GdkEvent* event)
*/ */
timepos_t pointer_time (canvas_event_sample (event, nullptr, nullptr)); timepos_t pointer_time (canvas_event_sample (event, nullptr, nullptr));
Temporal::TempoPoint& tempo = const_cast<Temporal::TempoPoint&>(map->tempo_at (pointer_time)); TempoPoint& tempo = const_cast<TempoPoint&>(map->tempo_at (pointer_time));
TempoPoint* before = const_cast<TempoPoint*> (map->previous_tempo (tempo)); TempoPoint* before = const_cast<TempoPoint*> (map->previous_tempo (tempo));
TempoPoint* after = const_cast<TempoPoint*> (map->next_tempo (tempo)); TempoPoint* after = const_cast<TempoPoint*> (map->next_tempo (tempo));
@ -2494,14 +2494,8 @@ Editor::choose_mapping_drag (ArdourCanvas::Item* item, GdkEvent* event)
} }
BBT_Argument bbt = map->bbt_at (pointer_time); BBT_Argument bbt = map->bbt_at (pointer_time);
bbt = BBT_Argument (bbt.reference(), bbt.round_to_beat ()); Meter const & m = map->meter_at (pointer_time);
bbt = BBT_Argument (bbt.reference(), m.round_to_beat (bbt));
/* BBT_Argument is meter-agnostic so we need to use the map's meter to resolve bar boundaries */
const Meter& m = map->meter_at (pointer_time);
if (bbt.beats > m.divisions_per_bar()){
bbt.beats = 1;
bbt.bars++;
}
/* Create a new marker, or use the one under the mouse */ /* Create a new marker, or use the one under the mouse */

View file

@ -428,7 +428,7 @@ StepEditor::step_edit_bar_sync ()
/* have to go to BBT to round up to bar, unfortunately */ /* have to go to BBT to round up to bar, unfortunately */
TempoMap::SharedPtr tmap (TempoMap::use()); TempoMap::SharedPtr tmap (TempoMap::use());
BBT_Argument bbt (tmap->bbt_at (pos).round_up_to_bar ()); BBT_Argument bbt (tmap->meter_at (pos).round_up_to_bar (tmap->bbt_at (pos)));
/* now back to beats */ /* now back to beats */
pos = timepos_t (tmap->quarters_at (bbt)); pos = timepos_t (tmap->quarters_at (bbt));