Skip to content

Commit

Permalink
Clamp the value from 0 to 1 to prevent the HSV warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergAtGithub committed Nov 26, 2021
1 parent fe2b854 commit 5075663
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vinylcontrol/vinylcontrolxwax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,11 +846,11 @@ int VinylControlXwax::getPitchQuality(double& pitch) {

void VinylControlXwax::establishQuality(double& pitch) {
m_iQualityRing[m_iQualityRingIndex] = getPositionQuality() + getPitchQuality(pitch);
m_fTimecodeQuality =
m_fTimecodeQuality = std::max<float>(0.0, std::min<float>(1.0,
static_cast<float>(std::accumulate(
m_iQualityRing, m_iQualityRing + m_iQualityRingFilled, 0)) /
2.0f / 100.0f /
static_cast<float>(m_iQualityRingFilled); // Two information in percent per datapoint
static_cast<float>(m_iQualityRingFilled))); // Two information in percent per datapoint

if (m_iQualityRingFilled < QUALITY_RING_SIZE) {
m_iQualityRingFilled++;
Expand Down

0 comments on commit 5075663

Please sign in to comment.