From 80c46cc451fed4b50bd1e974b4586fcea99c1ab5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 3 Mar 2011 17:58:11 +0000 Subject: [PATCH] put sampo's FFT into the (new) GTKArdour namespace, to avoid collision with the FFT in the QM DSP library. they should both be namespaced but its easier to avoid changing the QM code at all git-svn-id: svn://localhost/ardour2/branches/3.0@9056 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/fft.cc | 2 ++ gtk2_ardour/fft.h | 4 ++++ gtk2_ardour/fft_graph.h | 1 + gtk2_ardour/plugin_eq_gui.cc | 16 ++++++++-------- gtk2_ardour/plugin_eq_gui.h | 10 ++++++---- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/gtk2_ardour/fft.cc b/gtk2_ardour/fft.cc index d4841dd573..a4e34bf2aa 100644 --- a/gtk2_ardour/fft.cc +++ b/gtk2_ardour/fft.cc @@ -23,6 +23,8 @@ #include #include +using namespace GTKArdour; + FFT::FFT(uint32_t windowSize) : _window_size(windowSize), _data_size(_window_size/2), diff --git a/gtk2_ardour/fft.h b/gtk2_ardour/fft.h index ba191c03cd..6022f1c770 100644 --- a/gtk2_ardour/fft.h +++ b/gtk2_ardour/fft.h @@ -32,6 +32,8 @@ #include "ardour/types.h" +namespace GTKArdour { + class FFT { public: @@ -72,4 +74,6 @@ class FFT fftwf_plan _plan; }; +} + #endif diff --git a/gtk2_ardour/fft_graph.h b/gtk2_ardour/fft_graph.h index c91adec8b7..ab05da348b 100644 --- a/gtk2_ardour/fft_graph.h +++ b/gtk2_ardour/fft_graph.h @@ -1,5 +1,6 @@ /* Copyright (C) 2006 Paul Davis + Author: Sampo Savoleinen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/gtk2_ardour/plugin_eq_gui.cc b/gtk2_ardour/plugin_eq_gui.cc index 21ec837992..a5bfb38f17 100644 --- a/gtk2_ardour/plugin_eq_gui.cc +++ b/gtk2_ardour/plugin_eq_gui.cc @@ -218,14 +218,14 @@ PluginEqGui::set_buffer_size(uint32_t size, uint32_t signal_size) return; - FFT *tmp1 = _impulse_fft; - FFT *tmp2 = _signal_input_fft; - FFT *tmp3 = _signal_output_fft; + GTKArdour::FFT *tmp1 = _impulse_fft; + GTKArdour::FFT *tmp2 = _signal_input_fft; + GTKArdour::FFT *tmp3 = _signal_output_fft; try { - _impulse_fft = new FFT(size); - _signal_input_fft = new FFT(signal_size); - _signal_output_fft = new FFT(signal_size); + _impulse_fft = new GTKArdour::FFT(size); + _signal_input_fft = new GTKArdour::FFT(signal_size); + _signal_output_fft = new GTKArdour::FFT(signal_size); } catch( ... ) { // Don't care about lost memory, we're screwed anyhow _impulse_fft = tmp1; @@ -284,11 +284,11 @@ PluginEqGui::signal_collect_callback(ARDOUR::BufferSet *in, ARDOUR::BufferSet *o _signal_output_fft->reset(); for (uint32_t i = 0; i < _plugin_insert->input_streams().n_audio(); ++i) { - _signal_input_fft ->analyze(in ->get_audio(i).data(), FFT::HANN); + _signal_input_fft ->analyze(in ->get_audio(i).data(), GTKArdour::FFT::HANN); } for (uint32_t i = 0; i < _plugin_insert->output_streams().n_audio(); ++i) { - _signal_output_fft->analyze(out->get_audio(i).data(), FFT::HANN); + _signal_output_fft->analyze(out->get_audio(i).data(), GTKArdour::FFT::HANN); } _signal_input_fft ->calculate(); diff --git a/gtk2_ardour/plugin_eq_gui.h b/gtk2_ardour/plugin_eq_gui.h index 5fc0af0fc0..e38bc8e8f7 100644 --- a/gtk2_ardour/plugin_eq_gui.h +++ b/gtk2_ardour/plugin_eq_gui.h @@ -30,7 +30,9 @@ #include #include -class FFT; +namespace GTKArdour { + class FFT; +} class PluginEqGui : public Gtk::Table { @@ -98,9 +100,9 @@ private: float _analysis_height; // My objects - FFT *_impulse_fft; - FFT *_signal_input_fft; - FFT *_signal_output_fft; + GTKArdour::FFT *_impulse_fft; + GTKArdour::FFT *_signal_input_fft; + GTKArdour::FFT *_signal_output_fft; boost::shared_ptr _plugin; boost::shared_ptr _plugin_insert;