mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
no more BBT_Time round/round_up methods (GUI edition)
This commit is contained in:
parent
f0111bcea5
commit
66dde32a1b
3 changed files with 5 additions and 11 deletions
|
|
@ -46,7 +46,7 @@ BBTMarkerDialog::BBTMarkerDialog (MusicTimePoint& p)
|
|||
: ArdourDialog (_("Edit Music Time"))
|
||||
, _point (&p)
|
||||
, _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"))
|
||||
, beat_label (_("Beat"))
|
||||
, name_label (_("Name"))
|
||||
|
|
|
|||
|
|
@ -2480,7 +2480,7 @@ Editor::choose_mapping_drag (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
*/
|
||||
|
||||
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* 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 = BBT_Argument (bbt.reference(), bbt.round_to_beat ());
|
||||
|
||||
/* 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++;
|
||||
}
|
||||
Meter const & m = map->meter_at (pointer_time);
|
||||
bbt = BBT_Argument (bbt.reference(), m.round_to_beat (bbt));
|
||||
|
||||
/* Create a new marker, or use the one under the mouse */
|
||||
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ StepEditor::step_edit_bar_sync ()
|
|||
|
||||
/* have to go to BBT to round up to bar, unfortunately */
|
||||
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 */
|
||||
pos = timepos_t (tmap->quarters_at (bbt));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue