13
0

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
This commit is contained in:
Paul Davis 2011-03-03 17:58:11 +00:00
parent 1ba667a0c1
commit 80c46cc451
5 changed files with 21 additions and 12 deletions

View File

@ -23,6 +23,8 @@
#include <string.h>
#include <math.h>
using namespace GTKArdour;
FFT::FFT(uint32_t windowSize)
: _window_size(windowSize),
_data_size(_window_size/2),

View File

@ -32,6 +32,8 @@
#include "ardour/types.h"
namespace GTKArdour {
class FFT
{
public:
@ -72,4 +74,6 @@ class FFT
fftwf_plan _plan;
};
}
#endif

View File

@ -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

View File

@ -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();

View File

@ -30,7 +30,9 @@
#include <gtkmm/combobox.h>
#include <gtkmm/liststore.h>
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<ARDOUR::Plugin> _plugin;
boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;