comparison base/AudioLevel.cpp @ 750:5bfc4930588d

Meter deflection fix due to Robin Gareus
author Chris Cannam
date Wed, 26 Sep 2012 21:27:10 +0100
parents bdc9bb371a9f
children cc27f35aa75c
comparison
equal deleted inserted replaced
741:aca6e61eaea3 750:5bfc4930588d
76 if (db < -70.0f) { 76 if (db < -70.0f) {
77 def = 0.0f; 77 def = 0.0f;
78 } else if (db < -60.0f) { 78 } else if (db < -60.0f) {
79 def = (db + 70.0f) * 0.25f; 79 def = (db + 70.0f) * 0.25f;
80 } else if (db < -50.0f) { 80 } else if (db < -50.0f) {
81 def = (db + 60.0f) * 0.5f + 5.0f; 81 def = (db + 60.0f) * 0.5f + 2.5f; // corrected from 5.0f base, thanks Robin Gareus
82 } else if (db < -40.0f) { 82 } else if (db < -40.0f) {
83 def = (db + 50.0f) * 0.75f + 7.5f; 83 def = (db + 50.0f) * 0.75f + 7.5f;
84 } else if (db < -30.0f) { 84 } else if (db < -30.0f) {
85 def = (db + 40.0f) * 1.5f + 15.0f; 85 def = (db + 40.0f) * 1.5f + 15.0f;
86 } else if (db < -20.0f) { 86 } else if (db < -20.0f) {
102 db = (def - 30.0f) / 2.0f - 30.0f; 102 db = (def - 30.0f) / 2.0f - 30.0f;
103 } else if (def >= 15.0f) { 103 } else if (def >= 15.0f) {
104 db = (def - 15.0f) / 1.5f - 40.0f; 104 db = (def - 15.0f) / 1.5f - 40.0f;
105 } else if (def >= 7.5f) { 105 } else if (def >= 7.5f) {
106 db = (def - 7.5f) / 0.75f - 50.0f; 106 db = (def - 7.5f) / 0.75f - 50.0f;
107 } else if (def >= 5.0f) { 107 } else if (def >= 2.5f) {
108 db = (def - 5.0f) / 0.5f - 60.0f; 108 db = (def - 2.5f) / 0.5f - 60.0f;
109 } else { 109 } else {
110 db = (def / 0.25f) - 70.0f; 110 db = (def / 0.25f) - 70.0f;
111 } 111 }
112 112
113 return db; 113 return db;