* fixed segfault on MIDI Panic button
[ardour.git] / gtk2_ardour / analysis_window.cc
index dd749d2bb112a06a9f01f515528b81b8fecd1100..8f84febbba011d6fbff446de695d9f1703d89076 100644 (file)
@@ -16,7 +16,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <gtkmm2ext/gtk_ui.h>
@@ -42,9 +41,8 @@
 using namespace ARDOUR;
 using namespace PBD;
 
-AnalysisWindow::AnalysisWindow()
-       : ArdourDialog(_("analysis window")),
-       
+AnalysisWindow::AnalysisWindow() :
+
          source_selection_label       (_("Signal source")),
          source_selection_ranges_rb   (_("Selected ranges")),
          source_selection_regions_rb  (_("Selected regions")),
@@ -52,9 +50,15 @@ AnalysisWindow::AnalysisWindow()
          display_model_label                   (_("Display model")),
          display_model_composite_separate_rb   (_("Composite graphs for each track")),
          display_model_composite_all_tracks_rb (_("Composite graph of all tracks")),
+         
+         show_minmax_button     (_("Show frequency power range")),
+         show_normalized_button (_("Normalize values")),
 
-         fft_graph (2048)
+         fft_graph (16384)
 {
+       set_name(_("FFT analysis window"));
+       set_title(_("FFT analysis window"));
+
        track_list_ready = false;
        
        // Left side: track list + controls
@@ -125,17 +129,31 @@ AnalysisWindow::AnalysisWindow()
                                bind ( mem_fun(*this, &AnalysisWindow::display_model_changed), &display_model_composite_all_tracks_rb));
        }
 
-       vbox.pack_start(hseparator2, false, false);
+       // Analyze button
 
        refresh_button.set_name("EditorGTKButton");
-       refresh_button.set_label(_("Analyze data"));
+       refresh_button.set_label(_("Re-analyze data"));
 
        refresh_button.signal_clicked().connect ( bind ( mem_fun(*this, &AnalysisWindow::analyze_data), &refresh_button)); 
 
        vbox.pack_start(refresh_button, false, false, 10);
+
+
+       // Feature checkboxes
+
+       // minmax
+       show_minmax_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_minmax_changed));
+       vbox.pack_start(show_minmax_button, false, false);
+
+       // normalize
+       show_normalized_button.signal_toggled().connect( mem_fun(*this, &AnalysisWindow::show_normalized_changed));
+       vbox.pack_start(show_normalized_button, false, false);
+
+       
+
        
        
-       hbox.pack_start(vbox);
+       hbox.pack_start(vbox, Gtk::PACK_SHRINK);
        
        // Analysis window on the right
        fft_graph.ensure_style();
@@ -145,11 +163,9 @@ AnalysisWindow::AnalysisWindow()
        
 
        // And last we pack the hbox
-       get_vbox()->pack_start(hbox);
-
+       add(hbox);
+       show_all();
        track_list.show_all();
-
-       get_vbox()->show_all();
 }
 
 AnalysisWindow::~AnalysisWindow()
@@ -157,6 +173,18 @@ AnalysisWindow::~AnalysisWindow()
 
 }
 
+void
+AnalysisWindow::show_minmax_changed()
+{
+       fft_graph.set_show_minmax(show_minmax_button.get_active());
+}
+
+void
+AnalysisWindow::show_normalized_changed()
+{
+       fft_graph.set_show_normalized(show_normalized_button.get_active());
+}
+
 void
 AnalysisWindow::set_rangemode()
 {