diff options
author | Sampo Savolainen <v2@iki.fi> | 2006-03-12 22:35:39 +0000 |
---|---|---|
committer | Sampo Savolainen <v2@iki.fi> | 2006-03-12 22:35:39 +0000 |
commit | b6efb1fdd9efff6b2067c1abfb0621111b387022 (patch) | |
tree | e2e8e82d09452dd98a523bf65d679655806579d6 | |
parent | 22502823aa0760b40d170deb1ebb69c2a3fec062 (diff) |
Make FFT easier to use. right click on a range selection or a region and
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
-rw-r--r-- | gtk2_ardour/analysis_window.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/analysis_window.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 29 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 3 |
4 files changed, 36 insertions, 3 deletions
diff --git a/gtk2_ardour/analysis_window.cc b/gtk2_ardour/analysis_window.cc index a26186ab42..6c8e569822 100644 --- a/gtk2_ardour/analysis_window.cc +++ b/gtk2_ardour/analysis_window.cc @@ -201,6 +201,12 @@ AnalysisWindow::clear_tracklist() } void +AnalysisWindow::analyze() +{ + analyze_data(&refresh_button); +} + +void AnalysisWindow::analyze_data (Gtk::Button *button) { track_list_ready = false; diff --git a/gtk2_ardour/analysis_window.h b/gtk2_ardour/analysis_window.h index c4ae7f2252..a5ca5b3c26 100644 --- a/gtk2_ardour/analysis_window.h +++ b/gtk2_ardour/analysis_window.h @@ -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: diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 55809e6cc5..f10492ce2d 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -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))); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 612057dfbd..e729a27fc1 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -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 */ |