From 1dee60510a3e7e1db3e9339ca4e5b6f0798b50d7 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Mon, 13 Mar 2006 03:27:58 +0000 Subject: [PATCH] Make the FFT Anaylsis optional and disabled by default until further discussion. git-svn-id: svn://localhost/trunk/ardour2@386 d708f5d6-7413-0410-9779-e7cbd77b26cf --- SConstruct | 8 +++++--- gtk2_ardour/SConscript | 11 ++++++++++- gtk2_ardour/editor.cc | 20 +++++++++++++++++++- gtk2_ardour/editor.h | 7 +++++++ 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index da4d446ae6..e0e4042d22 100644 --- a/SConstruct +++ b/SConstruct @@ -34,7 +34,8 @@ opts.AddOptions( BoolOption('VST', 'Compile with support for VST', 0), BoolOption('VERSIONED', 'Add version information to ardour/gtk executable name inside the build directory', 0), EnumOption('DIST_TARGET', 'Build target for cross compiling packagers', 'auto', allowed_values=('auto', 'i386', 'i686', 'x86_64', 'powerpc', 'tiger', 'panther', 'none' ), ignorecase=2), - BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1) + BoolOption('FPU_OPTIMIZATION', 'Build runtime checked assembler code', 1), + BoolOption('FFT_ANALYSIS', 'Include FFT analysis window', 0) ) #---------------------------------------------------------------------- @@ -361,8 +362,9 @@ libraries['raptor'].ParseConfig('pkg-config --cflags --libs raptor') libraries['samplerate'] = LibraryInfo() libraries['samplerate'].ParseConfig('pkg-config --cflags --libs samplerate') -libraries['fftw3f'] = LibraryInfo() -libraries['fftw3f'].ParseConfig('pkg-config --cflags --libs fftw3f') +if env['FFT_ANALYSIS']: + libraries['fftw3f'] = LibraryInfo() + libraries['fftw3f'].ParseConfig('pkg-config --cflags --libs fftw3f') libraries['jack'] = LibraryInfo() libraries['jack'].ParseConfig('pkg-config --cflags --libs jack') diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index afcb92b8e8..ac58fe3f24 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -44,12 +44,14 @@ gtkardour.Merge ([ libraries['xml'], libraries['soundtouch'], libraries['samplerate'], - libraries['fftw3f'], libraries['jack'], libraries['glade2'], libraries['libglademm'] ]) +if gtkardour['FFT_ANALYSIS']: + gtkardour.Merge ([libraries['fftw3f']]) + if gtkardour['VST']: gtkardour.Merge ([ libraries['fst']]) @@ -176,6 +178,9 @@ utils.cc version.cc visual_time_axis.cc waveview.cc +""") + +fft_analysis_files=Split(""" analysis_window.cc fft_graph.cc fft_result.cc @@ -199,6 +204,10 @@ vst_files = [ 'vst_pluginui.cc' ] if env['VST']: extra_sources += vst_files +if env['FFT_ANALYSIS']: + extra_sources += fft_analysis_files + + intl_files += extra_sources gtkardour.Append(CCFLAGS="-D_REENTRANT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE") diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index f10492ce2d..88f1d05f3b 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -67,7 +67,10 @@ #include "canvas_impl.h" #include "actions.h" #include "gui_thread.h" + +#ifdef FFT_ANALYSIS #include "analysis_window.h" +#endif #include "i18n.h" @@ -252,7 +255,11 @@ Editor::Editor (AudioEngine& eng) canvas_height = 0; autoscroll_timeout_tag = -1; interthread_progress_window = 0; + +#ifdef FFT_ANALYSIS analysis_window = 0; +#endif + current_interthread_info = 0; _show_measures = true; _show_waveforms = true; @@ -1170,8 +1177,10 @@ Editor::connect_to_session (Session *t) _playlist_selector->set_session (session); nudge_clock.set_session (session); +#ifdef FFT_ANALYSIS if (analysis_window != 0) analysis_window->set_session (session); +#endif switch (session->get_edit_mode()) { case Splice: @@ -1589,6 +1598,7 @@ Editor::build_track_crossfade_context_menu (jack_nframes_t frame) return &track_crossfade_context_menu; } +#ifdef FFT_ANALYSIS void Editor::analyze_region_selection() { @@ -1624,7 +1634,7 @@ Editor::analyze_range_selection() analysis_window->present(); } - +#endif /* FFT_ANALYSIS */ @@ -1729,7 +1739,11 @@ 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))); + +#ifdef FFT_ANALYSIS items.push_back (MenuElem (_("Analyze region"), mem_fun(*this, &Editor::analyze_region_selection))); +#endif + items.push_back (SeparatorElem()); /* XXX hopefully this nonsense will go away with SigC++ 2.X, where the compiler @@ -1836,8 +1850,12 @@ 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))); + +#ifdef FFT_ANALYSIS items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Analyze range"), mem_fun(*this, &Editor::analyze_range_selection))); +#endif + 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 e729a27fc1..ecf9da747d 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -102,7 +102,9 @@ class AutomationSelection; class MixerStrip; class StreamView; class ControlPoint; +#ifdef FFT_ANALYSIS class AnalysisWindow; +#endif /* */ class ImageFrameView; @@ -226,9 +228,11 @@ class Editor : public PublicEditor void set_show_measures (bool yn); bool show_measures () const { return _show_measures; } +#ifdef FFT_ANALYSIS /* analysis window */ void analyze_region_selection(); void analyze_range_selection(); +#endif /* export */ @@ -982,7 +986,10 @@ class Editor : public PublicEditor void interthread_cancel_clicked (); void build_interthread_progress_window (); ARDOUR::InterThreadInfo* current_interthread_info; + +#ifdef FFT_ANALYSIS AnalysisWindow* analysis_window; +#endif /* import specific info */