summaryrefslogtreecommitdiff
path: root/gtk2_ardour/fft_graph.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-05-22 19:29:08 +0200
committerRobin Gareus <robin@gareus.org>2016-05-22 19:33:00 +0200
commit1b3b42403bf7324b1b35adc7aa7695dcde39c07b (patch)
tree658508a786bda58d78a2880ae3f3d2fa0af68298 /gtk2_ardour/fft_graph.h
parentef365d0310b40424c69eece86f284ee6db020735 (diff)
overhaul region/range spectrum analysis
Diffstat (limited to 'gtk2_ardour/fft_graph.h')
-rw-r--r--gtk2_ardour/fft_graph.h80
1 files changed, 43 insertions, 37 deletions
diff --git a/gtk2_ardour/fft_graph.h b/gtk2_ardour/fft_graph.h
index ab05da348b..75cda4d457 100644
--- a/gtk2_ardour/fft_graph.h
+++ b/gtk2_ardour/fft_graph.h
@@ -38,62 +38,68 @@ class AnalysisWindow;
class FFTGraph : public Gtk::DrawingArea
{
- public:
+public:
- FFTGraph(int windowSize);
- ~FFTGraph();
+ FFTGraph (int windowSize);
+ ~FFTGraph ();
- void set_analysis_window(AnalysisWindow *a_window);
+ void set_analysis_window (AnalysisWindow *a_window);
- int windowSize() const { return _windowSize; }
- void setWindowSize(int windowSize);
+ int windowSize () const { return _windowSize; }
+ void setWindowSize (int windowSize);
- void redraw();
- bool on_expose_event (GdkEventExpose* event);
+ void redraw ();
+ bool on_expose_event (GdkEventExpose* event);
- void on_size_request(Gtk::Requisition* requisition);
- void on_size_allocate(Gtk::Allocation & alloc);
- FFTResult *prepareResult(Gdk::Color color, std::string trackname);
+ void on_size_request (Gtk::Requisition* requisition);
+ void on_size_allocate (Gtk::Allocation & alloc);
+ FFTResult *prepareResult (Gdk::Color color, std::string trackname);
- void set_show_minmax (bool v) { _show_minmax = v; redraw(); }
- void set_show_normalized (bool v) { _show_normalized = v; redraw(); }
+ void set_show_minmax (bool v) { _show_minmax = v; redraw (); }
+ void set_show_normalized (bool v) { _show_normalized = v; redraw (); }
+ void set_show_proportioanl(bool v) { _show_proportional = v; redraw (); }
- private:
+private:
- void update_size();
+ void update_size ();
- void setWindowSize_internal(int windowSize);
+ void setWindowSize_internal (int windowSize);
- void draw_scales(Glib::RefPtr<Gdk::Window> window);
+ int draw_scales (Glib::RefPtr<Gdk::Window> window);
- static const int minScaleWidth = 512;
- static const int minScaleHeight = 420;
+ static const int minScaleWidth = 512;
+ static const int minScaleHeight = 420;
- int currentScaleWidth;
- int currentScaleHeight;
+ static const int hl_margin = 40; // this should scale with font (dBFS labels)
+ static const int hr_margin = 12;
+ static const int v_margin = 12;
- static const int h_margin = 20;
- static const int v_margin = 20;
- Glib::RefPtr<Gdk::GC> graph_gc;
+ int currentScaleWidth;
+ Glib::RefPtr<Gdk::GC> graph_gc;
- int width;
- int height;
+ int width;
+ int height;
- int _windowSize;
- int _dataSize;
+ unsigned int _windowSize;
+ unsigned int _dataSize;
- Glib::RefPtr<Pango::Layout> layout;
- AnalysisWindow *_a_window;
+ Glib::RefPtr<Pango::Layout> layout;
+ AnalysisWindow *_a_window;
- fftwf_plan _plan;
+ fftwf_plan _plan;
- float *_out;
- float *_in;
- float *_hanning;
- int *_logScale;
+ float* _out;
+ float* _in;
+ float* _hanning;
+ int* _logScale;
- bool _show_minmax;
- bool _show_normalized;
+ bool _show_minmax;
+ bool _show_normalized;
+ bool _show_proportional;
+
+ float _fft_start;
+ float _fft_end;
+ float _fft_log_base;
friend class FFTResult;
};