13
0

temporal: provide TempoMap::replace_tempo()

This commit is contained in:
Paul Davis 2022-12-20 21:31:02 -07:00
parent 033b4c5152
commit ae36f8e445
2 changed files with 10 additions and 0 deletions

View File

@ -814,9 +814,17 @@ TempoMap::change_tempo (TempoPoint & p, Tempo const & t)
reset_starting_at (p.sclock());
}
void
TempoMap::replace_tempo (TempoPoint const & old, Tempo const & t, timepos_t const & time)
{
remove_tempo (old);
set_tempo (t, time);
}
TempoPoint &
TempoMap::set_tempo (Tempo const & t, BBT_Time const & bbt)
{
std::cerr << "ST with bbt = " << bbt << std::endl;
return set_tempo (t, timepos_t (quarters_at (bbt)));
}

View File

@ -739,6 +739,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
LIBTEMPORAL_API TempoPoint& set_tempo (Tempo const &, BBT_Time const &);
LIBTEMPORAL_API TempoPoint& set_tempo (Tempo const &, timepos_t const &);
LIBTEMPORAL_API void replace_tempo (TempoPoint const & old, Tempo const & thenew, timepos_t const &);
LIBTEMPORAL_API MeterPoint& set_meter (Meter const &, BBT_Time const &);
LIBTEMPORAL_API MeterPoint& set_meter (Meter const &, timepos_t const &);