mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
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:
parent
1ba667a0c1
commit
80c46cc451
5 changed files with 21 additions and 12 deletions
|
|
@ -23,6 +23,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
using namespace GTKArdour;
|
||||||
|
|
||||||
FFT::FFT(uint32_t windowSize)
|
FFT::FFT(uint32_t windowSize)
|
||||||
: _window_size(windowSize),
|
: _window_size(windowSize),
|
||||||
_data_size(_window_size/2),
|
_data_size(_window_size/2),
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
#include "ardour/types.h"
|
#include "ardour/types.h"
|
||||||
|
|
||||||
|
namespace GTKArdour {
|
||||||
|
|
||||||
class FFT
|
class FFT
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -72,4 +74,6 @@ class FFT
|
||||||
fftwf_plan _plan;
|
fftwf_plan _plan;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006 Paul Davis
|
Copyright (C) 2006 Paul Davis
|
||||||
|
Author: Sampo Savoleinen
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
||||||
|
|
@ -218,14 +218,14 @@ PluginEqGui::set_buffer_size(uint32_t size, uint32_t signal_size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
FFT *tmp1 = _impulse_fft;
|
GTKArdour::FFT *tmp1 = _impulse_fft;
|
||||||
FFT *tmp2 = _signal_input_fft;
|
GTKArdour::FFT *tmp2 = _signal_input_fft;
|
||||||
FFT *tmp3 = _signal_output_fft;
|
GTKArdour::FFT *tmp3 = _signal_output_fft;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
_impulse_fft = new FFT(size);
|
_impulse_fft = new GTKArdour::FFT(size);
|
||||||
_signal_input_fft = new FFT(signal_size);
|
_signal_input_fft = new GTKArdour::FFT(signal_size);
|
||||||
_signal_output_fft = new FFT(signal_size);
|
_signal_output_fft = new GTKArdour::FFT(signal_size);
|
||||||
} catch( ... ) {
|
} catch( ... ) {
|
||||||
// Don't care about lost memory, we're screwed anyhow
|
// Don't care about lost memory, we're screwed anyhow
|
||||||
_impulse_fft = tmp1;
|
_impulse_fft = tmp1;
|
||||||
|
|
@ -284,11 +284,11 @@ PluginEqGui::signal_collect_callback(ARDOUR::BufferSet *in, ARDOUR::BufferSet *o
|
||||||
_signal_output_fft->reset();
|
_signal_output_fft->reset();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < _plugin_insert->input_streams().n_audio(); ++i) {
|
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) {
|
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();
|
_signal_input_fft ->calculate();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@
|
||||||
#include <gtkmm/combobox.h>
|
#include <gtkmm/combobox.h>
|
||||||
#include <gtkmm/liststore.h>
|
#include <gtkmm/liststore.h>
|
||||||
|
|
||||||
class FFT;
|
namespace GTKArdour {
|
||||||
|
class FFT;
|
||||||
|
}
|
||||||
|
|
||||||
class PluginEqGui : public Gtk::Table
|
class PluginEqGui : public Gtk::Table
|
||||||
{
|
{
|
||||||
|
|
@ -98,9 +100,9 @@ private:
|
||||||
float _analysis_height;
|
float _analysis_height;
|
||||||
|
|
||||||
// My objects
|
// My objects
|
||||||
FFT *_impulse_fft;
|
GTKArdour::FFT *_impulse_fft;
|
||||||
FFT *_signal_input_fft;
|
GTKArdour::FFT *_signal_input_fft;
|
||||||
FFT *_signal_output_fft;
|
GTKArdour::FFT *_signal_output_fft;
|
||||||
boost::shared_ptr<ARDOUR::Plugin> _plugin;
|
boost::shared_ptr<ARDOUR::Plugin> _plugin;
|
||||||
boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;
|
boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue