2 Copyright (C) 2006 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_fft_graph_h
21 #define __ardour_fft_graph_h
23 #include <ardour/types.h>
26 #include <gtkmm/drawingarea.h>
27 #include <gtkmm/treemodel.h>
28 #include <gdkmm/color.h>
30 #include <glibmm/refptr.h>
34 #include "fft_result.h"
38 class FFTGraph
: public Gtk::DrawingArea
42 FFTGraph(int windowSize
);
45 void set_analysis_window(AnalysisWindow
*a_window
);
47 int windowSize() const { return _windowSize
; }
48 void setWindowSize(int windowSize
);
51 bool on_expose_event (GdkEventExpose
* event
);
53 void on_size_request(Gtk::Requisition
* requisition
);
54 void on_size_allocate(Gtk::Allocation
& alloc
);
55 FFTResult
*prepareResult(Gdk::Color color
, std::string trackname
);
57 const void set_show_minmax (bool v
) { _show_minmax
= v
; redraw(); };
58 const void set_show_normalized (bool v
) { _show_normalized
= v
; redraw(); };
64 void setWindowSize_internal(int windowSize
);
66 void draw_scales(Glib::RefPtr
<Gdk::Window
> window
);
68 static const int minScaleWidth
= 512;
69 static const int minScaleHeight
= 420;
71 int currentScaleWidth
;
72 int currentScaleHeight
;
74 static const int h_margin
= 20;
75 static const int v_margin
= 20;
76 Glib::RefPtr
<Gdk::GC
> graph_gc
;
84 Glib::RefPtr
<Pango::Layout
> layout
;
85 AnalysisWindow
*_a_window
;
95 bool _show_normalized
;
97 friend class FFTResult
;
100 #endif /* __ardour_fft_graph_h */