::find_next_event() does not need to be a pure virtual in ControlSet (it can originat...
[ardour.git] / gtk2_ardour / plugin_eq_gui.cc
index c33e6b96bbd6c1b62c741da371a690a12ce44d8f..c637968181d2347a645c0db5a525e6fe6b8ff5a3 100644 (file)
@@ -450,9 +450,9 @@ PluginEqGui::update_pointer_info(float x, float y)
        std::stringstream ss;
        ss << std::fixed;
        if (freq >= 10000) {
-               ss <<  std::setprecision (1) << freq / 1000 << "kHz";
+               ss <<  std::setprecision (1) << freq / 1000.0 << "kHz";
        } else if (freq >= 1000) {
-               ss <<  std::setprecision (2) << freq / 1000 << "kHz";
+               ss <<  std::setprecision (2) << freq / 1000.0 << "kHz";
        } else {
                ss <<  std::setprecision (0) << freq << "Hz";
        }
@@ -758,7 +758,7 @@ PluginEqGui::plot_impulse_amplitude(Gtk::Widget *w, cairo_t *cr)
        // float width  = w->get_width();
        float height = w->get_height();
 
-        cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+       cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
        cairo_set_line_width (cr, 2.5);
 
        for (uint32_t i = 0; i < _impulse_fft->bins()-1; i++) {
@@ -808,26 +808,19 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr)
        float height = w->get_height();
 
        cairo_set_source_rgb(cr, 0.0, 1.0, 0.0);
-       cairo_set_line_width (cr, 2.5);
+       cairo_set_line_width (cr, 1.5);
 
        for (uint32_t i = 0; i < _signal_input_fft->bins()-1; i++) {
                // x coordinate of bin i
                x  = log10f(1.0 + (float)i / (float)_signal_input_fft->bins() * _log_coeff) / _log_max;
                x *= _analysis_width;
 
-               float power_out = power_to_dB(_signal_output_fft->power_at_bin(i));
-               float power_in  = power_to_dB(_signal_input_fft ->power_at_bin(i));
-               float power = power_out - power_in;
+               float power_out = _signal_output_fft->power_at_bin (i) + 1e-30;
+               float power_in  = _signal_input_fft ->power_at_bin (i) + 1e-30;
+               float power = power_to_dB (power_out / power_in);
 
-               if (ISINF(power)) {
-                       if (power < 0) {
-                               power = _min_dB - 1.0;
-                       } else {
-                               power = _max_dB - 1.0;
-                       }
-               } else if (ISNAN(power)) {
-                       power = _min_dB - 1.0;
-               }
+               assert (!ISINF(power));
+               assert (!ISNAN(power));
 
                float yCoeff = ( power - _min_dB) / (_max_dB - _min_dB);