diff options
author | Robin Gareus <robin@gareus.org> | 2015-09-16 17:45:04 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-09-16 18:24:57 +0200 |
commit | e125c7807027b31e2fd2fb48ea117bb769c5f678 (patch) | |
tree | 94c488ddf2fc2fd67c8364e829f2b37b0d4e6f56 /libs/ardour/ardour/dsp_load_calculator.h | |
parent | 570d92c527e6c1919ac8aa69dc6fe67283f3f5a4 (diff) |
fix DSP load bounds 0..1 and add unbound API
Diffstat (limited to 'libs/ardour/ardour/dsp_load_calculator.h')
-rw-r--r-- | libs/ardour/ardour/dsp_load_calculator.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/ardour/ardour/dsp_load_calculator.h b/libs/ardour/ardour/dsp_load_calculator.h index 7ee741aceb..c7f8e2a2e0 100644 --- a/libs/ardour/ardour/dsp_load_calculator.h +++ b/libs/ardour/ardour/dsp_load_calculator.h @@ -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; } |