Make FFT easier to use. right click on a range selection or a region and
authorSampo Savolainen <v2@iki.fi>
Sun, 12 Mar 2006 22:35:39 +0000 (22:35 +0000)
committerSampo Savolainen <v2@iki.fi>
Sun, 12 Mar 2006 22:35:39 +0000 (22:35 +0000)
in the range/region submenu you should find a "Analyze range/region"
entry.

git-svn-id: svn://localhost/trunk/ardour2@385 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/analysis_window.cc
gtk2_ardour/analysis_window.h
gtk2_ardour/editor.cc
gtk2_ardour/editor.h

index a26186ab423315dc08b451d7ff3e3499be05ceba..6c8e569822eaba0b522b2dc4c298c7b1ed2d54d7 100644 (file)
@@ -200,6 +200,12 @@ AnalysisWindow::clear_tracklist()
        tlmodel->clear();
 }
 
+void
+AnalysisWindow::analyze()
+{
+       analyze_data(&refresh_button);
+}
+
 void
 AnalysisWindow::analyze_data (Gtk::Button *button)
 {
index c4ae7f2252e1f2cebf7e79fcb9c1e38a50b36837..a5ca5b3c260883efb68b29130e27b709348ac533 100644 (file)
@@ -53,6 +53,7 @@ class AnalysisWindow : public ArdourDialog
          
          void track_list_row_changed(const Gtk::TreeModel::Path& path, const Gtk::TreeModel::iterator& iter);
 
+         void analyze ();
 
   private:
          
index 55809e6cc586c36fc40384491306f5cdbfc5f86f..f10492ce2d151e0d212bbb79093f5769ac124651 100644 (file)
@@ -1590,7 +1590,7 @@ Editor::build_track_crossfade_context_menu (jack_nframes_t frame)
 }
 
 void
-Editor::show_analysis_window()
+Editor::analyze_region_selection()
 {
        if (analysis_window == 0) {
                analysis_window = new AnalysisWindow();
@@ -1601,9 +1601,33 @@ Editor::show_analysis_window()
                analysis_window->show_all();
        }
 
+       analysis_window->set_regionmode();
+       analysis_window->analyze();
+       
        analysis_window->present();
 }
 
+void
+Editor::analyze_range_selection()
+{
+       if (analysis_window == 0) {
+               analysis_window = new AnalysisWindow();
+
+               if (session != 0)
+                       analysis_window->set_session(session);
+
+               analysis_window->show_all();
+       }
+
+       analysis_window->set_rangemode();
+       analysis_window->analyze();
+       
+       analysis_window->present();
+}
+
+
+
+
 Menu*
 Editor::build_track_selection_context_menu (jack_nframes_t ignored)
 {
@@ -1705,6 +1729,7 @@ Editor::add_region_context_items (StreamView* sv, Region* region, Menu_Helpers::
        items.push_back (MenuElem (_("Audition"), mem_fun(*this, &Editor::audition_selected_region)));
        items.push_back (MenuElem (_("Export"), mem_fun(*this, &Editor::export_region)));
        items.push_back (MenuElem (_("Bounce"), mem_fun(*this, &Editor::bounce_region_selection)));
+       items.push_back (MenuElem (_("Analyze region"), mem_fun(*this, &Editor::analyze_region_selection)));
        items.push_back (SeparatorElem());
 
        /* XXX hopefully this nonsense will go away with SigC++ 2.X, where the compiler
@@ -1812,7 +1837,7 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
        items.push_back (MenuElem (_("Play range"), mem_fun(*this, &Editor::play_selection)));
        items.push_back (MenuElem (_("Loop range"), mem_fun(*this, &Editor::set_route_loop_selection)));
        items.push_back (SeparatorElem());
-       items.push_back (MenuElem (_("Analyze range"), mem_fun(*this, &Editor::show_analysis_window)));
+       items.push_back (MenuElem (_("Analyze range"), mem_fun(*this, &Editor::analyze_range_selection)));
        items.push_back (SeparatorElem());
        items.push_back (MenuElem (_("Separate range to track"), mem_fun(*this, &Editor::separate_region_from_selection)));
        items.push_back (MenuElem (_("Separate range to region list"), mem_fun(*this, &Editor::new_region_from_selection)));
index 612057dfbda3593588f3cd74ffa24943a5446705..e729a27fc110b95d4aa18727de7c33632f7664cf 100644 (file)
@@ -227,7 +227,8 @@ class Editor : public PublicEditor
        bool show_measures () const { return _show_measures; }
 
        /* analysis window */
-       void show_analysis_window();
+       void analyze_region_selection();
+       void analyze_range_selection();
 
        /* export */