+
+ ARDOUR_UI::instance()->drop_process_buffers ();
+}
+
+void
+PluginEqGui::update_pointer_info(float x)
+{
+ /* find the bin corresponding to x (see plot_impulse_amplitude) */
+ int i = roundf ((powf (10, _log_max * x / _analysis_width) - 1.0) * _impulse_fft->bins() / _log_coeff);
+ float dB = power_to_dB (_impulse_fft->power_at_bin (i));
+ /* calc freq corresponding to bin */
+ const int freq = std::max (1, (int) roundf((float)i / (float)_impulse_fft->bins() * _samplerate / 2.f));
+
+ _pointer_in_area_freq = round (_analysis_width * log10f(1.0 + (float)i / (float)_impulse_fft->bins() * _log_coeff) / _log_max);
+
+ std::stringstream ss;
+ ss << std::fixed;
+ if (freq >= 10000) {
+ ss << std::setprecision (1) << freq / 1000.0 << "kHz";
+ } else if (freq >= 1000) {
+ ss << std::setprecision (2) << freq / 1000.0 << "kHz";
+ } else {
+ ss << std::setprecision (0) << freq << "Hz";
+ }
+ ss << " " << std::setw(6) << std::setprecision (1) << std::showpos << dB;
+ ss << std::setw(0) << "dB";
+
+ if (_phase_button->get_active()) {
+ float phase = 180. * _impulse_fft->phase_at_bin (i) / M_PI;
+ ss << " " << std::setw(6) << std::setprecision (1) << std::showpos << phase;
+ ss << std::setw(0) << "\u00B0";
+ }
+ _pointer_info->set_text(ss.str());
+}
+
+bool
+PluginEqGui::analysis_area_mouseover(GdkEventMotion *event)
+{
+ update_pointer_info(event->x);
+ _pointer_in_area_xpos = event->x;
+ _analysis_area->queue_draw();
+ return true;
+}
+
+bool
+PluginEqGui::analysis_area_mouseexit(GdkEventCrossing *)
+{
+ _pointer_info->set_text("");
+ _pointer_in_area_xpos = -1;
+ _analysis_area->queue_draw();
+ return true;