temporal: add TempoMap::replace_bartime()

This commit is contained in:
Paul Davis 2023-07-25 13:50:05 -06:00
parent e36dfa1f09
commit ca348ce0d9
2 changed files with 13 additions and 0 deletions

View File

@ -1493,6 +1493,18 @@ TempoMap::set_bartime (BBT_Time const & bbt, timepos_t const & pos, std::string
add_or_replace_bartime (tp);
}
void
TempoMap::replace_bartime (MusicTimePoint & mtp, bool with_reset)
{
bool ignored;
core_add_bartime (&mtp, ignored);
if (with_reset) {
reset_starting_at (mtp.sclock());
}
}
MusicTimePoint*
TempoMap::add_or_replace_bartime (MusicTimePoint* mtp)
{

View File

@ -822,6 +822,7 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible
LIBTEMPORAL_API void set_bartime (BBT_Time const &, timepos_t const &, std::string name = std::string());
LIBTEMPORAL_API void remove_bartime (MusicTimePoint const & tp, bool with_reset = true);
LIBTEMPORAL_API void replace_bartime (MusicTimePoint & tp, bool with_reset = true);
LIBTEMPORAL_API TempoPoint& set_tempo (Tempo const &, BBT_Argument const &);
LIBTEMPORAL_API TempoPoint& set_tempo (Tempo const &, timepos_t const &);