mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
Add Canvas::get_microseconds_since_render_start() method
Initial use is for the WaveView class to determine whether on not to draw the waveform in the GUI thread.
This commit is contained in:
parent
ab13e87ec2
commit
4ddf97f5a2
2 changed files with 14 additions and 0 deletions
|
|
@ -163,6 +163,18 @@ Canvas::prepare_for_render (Rect const & area) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gint64
|
||||||
|
Canvas::get_microseconds_since_render_start () const
|
||||||
|
{
|
||||||
|
gint64 timestamp = g_get_monotonic_time();
|
||||||
|
|
||||||
|
if (_last_render_start_timestamp == 0 || timestamp <= _last_render_start_timestamp) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return timestamp - _last_render_start_timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
ostream&
|
ostream&
|
||||||
operator<< (ostream& o, Canvas& c)
|
operator<< (ostream& o, Canvas& c)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,8 @@ public:
|
||||||
|
|
||||||
gint64 get_last_render_start_timestamp () const { return _last_render_start_timestamp; }
|
gint64 get_last_render_start_timestamp () const { return _last_render_start_timestamp; }
|
||||||
|
|
||||||
|
gint64 get_microseconds_since_render_start () const;
|
||||||
|
|
||||||
/** @return root group */
|
/** @return root group */
|
||||||
Item* root () {
|
Item* root () {
|
||||||
return &_root;
|
return &_root;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue