source: provide a little syntactic sugar via ::time_since_capture_start()

This commit is contained in:
Paul Davis
2022-10-28 16:38:46 -06:00
parent 31f78813e3
commit 6449bf5464
2 changed files with 11 additions and 0 deletions

View File

@@ -129,6 +129,11 @@ public:
bool have_natural_position() const { return _have_natural_position; }
/* This method is only for use during a capture pass. It makes no sense
* in any other context.
*/
timecnt_t time_since_capture_start (timepos_t const & pos);
void set_allow_remove_if_empty (bool yn);
Glib::Threads::RWLock& mutex() { return _lock; }

View File

@@ -417,6 +417,12 @@ Source::set_natural_position (timepos_t const & pos)
_have_natural_position = true;
}
timecnt_t
Source::time_since_capture_start (timepos_t const & pos)
{
return _natural_position.distance (pos);
}
void
Source::set_allow_remove_if_empty (bool yn)
{