13
0

Add explicit BBT/Beat print functions (like timeline.h has)

This is in preparation for Lua bindings to allow print()ing
the value. We cannot use PBD::to_string() here.
This commit is contained in:
Robin Gareus 2022-09-27 02:23:11 +02:00
parent f79f3ee301
commit 36aa661a1d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 13 additions and 0 deletions

View File

@ -130,6 +130,13 @@ struct LIBTEMPORAL_API BBT_Time
<< std::setw (2) << beats << "|"
<< std::setw (4) << ticks;
}
std::string str () const {
std::ostringstream os;
os << bars << '|' << beats << '|' << ticks;
return os.str ();
}
};
struct LIBTEMPORAL_API BBT_Offset

View File

@ -238,6 +238,12 @@ public:
static Beats one_tick() { return Beats(0, 1); }
std::string str () const {
std::ostringstream os;
os << get_beats() << ':' << get_ticks();
return os.str();
}
protected:
int64_t _ticks;