Don't show DSP stats of inserts that don't collect them.
[ardour.git] / gtk2_ardour / fft_graph.cc
index 630d822a2ced6b72996afc3749b7b59528bf3dc5..25f6c6ff2943d7ae86be5e1c27bf51101e449d77 100644 (file)
@@ -175,11 +175,11 @@ FFTGraph::on_expose_event (GdkEventExpose* event)
 
                std::stringstream ss;
                if (freq >= 10000) {
-                       ss <<  std::setprecision (1) << std::fixed << freq / 1000 << "K";
+                       ss <<  std::setprecision (1) << std::fixed << freq / 1000 << " kHz";
                } else if (freq >= 1000) {
-                       ss <<  std::setprecision (2) << std::fixed << freq / 1000 << "K";
+                       ss <<  std::setprecision (2) << std::fixed << freq / 1000 << " kHz";
                } else {
-                       ss <<  std::setprecision (0) << std::fixed << freq << "Hz";
+                       ss <<  std::setprecision (0) << std::fixed << freq << " Hz";
                }
                layout->set_text (ss.str ());
                int lw, lh;
@@ -312,7 +312,7 @@ FFTGraph::draw_scales (cairo_t* cr)
        cairo_line_to (cr, width - 3              , .5 + v_margin); // 5
        cairo_stroke (cr);
 
-       if (layout == 0) {
+       if (! layout) {
                layout = create_pango_layout ("");
                layout->set_font_description (get_style ()->get_font ());
        }
@@ -335,9 +335,9 @@ FFTGraph::draw_scales (cairo_t* cr)
 
                std::stringstream ss;
                if (freq >= 10000) {
-                       ss <<  std::setprecision (1) << std::fixed << freq / 1000 << "K";
+                       ss <<  std::setprecision (1) << std::fixed << freq / 1000 << "k";
                } else if (freq >= 1000) {
-                       ss <<  std::setprecision (2) << std::fixed << freq / 1000 << "K";
+                       ss <<  std::setprecision (2) << std::fixed << freq / 1000 << "k";
                } else {
                        ss <<  std::setprecision (0) << std::fixed << freq << "Hz";
                }
@@ -379,9 +379,9 @@ FFTGraph::draw_scales (cairo_t* cr)
 
                std::stringstream ss;
                if (freq >= 10000) {
-                       ss <<  std::setprecision (1) << std::fixed << freq / 1000 << "K";
+                       ss <<  std::setprecision (1) << std::fixed << freq / 1000 << "k";
                } else if (freq >= 1000) {
-                       ss <<  std::setprecision (2) << std::fixed << freq / 1000 << "K";
+                       ss <<  std::setprecision (2) << std::fixed << freq / 1000 << "k";
                } else {
                        ss <<  std::setprecision (0) << std::fixed << freq << "Hz";
                }
@@ -420,8 +420,6 @@ FFTGraph::draw_scales (cairo_t* cr)
 void
 FFTGraph::redraw ()
 {
-       Glib::Threads::Mutex::Lock lm  (_a_window->track_list_lock);
-
        assert (_surface);
        cairo_t* cr = cairo_create (_surface);
 
@@ -433,6 +431,8 @@ FFTGraph::redraw ()
                return;
        }
 
+       Glib::Threads::Mutex::Lock lm  (_a_window->track_list_lock);
+
        if (!_a_window->track_list_ready) {
                cairo_destroy (cr);
                queue_draw ();
@@ -651,7 +651,7 @@ FFTGraph::on_size_allocate (Gtk::Allocation & alloc)
 void
 FFTGraph::update_size ()
 {
-       framecnt_t SR = PublicEditor::instance ().session ()->nominal_frame_rate ();
+       samplecnt_t SR = PublicEditor::instance ().session ()->nominal_sample_rate ();
        _fft_start = SR / (double)_dataSize;
        _fft_end = .5 * SR;
        _fft_log_base = logf (.5 * _dataSize);