mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
fix DSP load bounds 0..1 and add unbound API
This commit is contained in:
parent
570d92c527
commit
e125c78070
1 changed files with 12 additions and 6 deletions
|
|
@ -93,12 +93,18 @@ public:
|
|||
*/
|
||||
float get_dsp_load() const
|
||||
{
|
||||
if (m_dsp_load > m_max_time_us) {
|
||||
return 1.0f;
|
||||
}
|
||||
if (m_dsp_load < 0.0f) {
|
||||
return 0.0f;
|
||||
}
|
||||
assert (m_dsp_load >= 0.f); // since stop > start is assured this cannot happen.
|
||||
return std::min (1.f, m_dsp_load);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return an unbound value representing the percentage of time spent between
|
||||
* start and stop in proportion to the max expected time in microseconds(us).
|
||||
* This is useful for cases to estimate overload (e.g. Dummy backend)
|
||||
*/
|
||||
float get_dsp_load_unbound() const
|
||||
{
|
||||
assert (m_dsp_load >= 0.f);
|
||||
return m_dsp_load;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue