ardour
plugin_eq_gui.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 Paul Davis
3  Author: Sampo Savolainen
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 
19 */
20 
21 #ifndef __ardour_plugin_eq_gui_h
22 #define __ardour_plugin_eq_gui_h
23 
24 #include "pbd/signals.h"
25 
26 #include "ardour/buffer_set.h"
27 
28 #include <gtkmm/table.h>
29 #include <gtkmm/drawingarea.h>
30 #include <gtkmm/combobox.h>
31 #include <gtkmm/liststore.h>
32 
33 namespace ARDOUR {
34  class Plugin;
35  class PluginInsert;
36 }
37 
38 namespace GTKArdour {
39  class FFT;
40 }
41 
42 class PluginEqGui : public Gtk::Table
43 {
44 public:
46  ~PluginEqGui ();
47 
48  void start_listening ();
49  void stop_listening ();
50 
51 private:
52  // Setup
53  void set_buffer_size (uint32_t, uint32_t);
54  void change_dB_scale ();
55 
56  // Analysis
57  void run_impulse_analysis ();
60 
61  // Drawing
62  virtual void on_hide ();
63  virtual void on_show ();
64 
65  void stop_updating ();
66  void start_updating ();
67 
68  void resize_analysis_area (Gtk::Allocation&);
69  void redraw_analysis_area ();
70 
71  void draw_analysis_scales (cairo_t *);
72  bool expose_analysis_area (GdkEventExpose *);
73 
74  void draw_scales_power (Gtk::Widget *, cairo_t *);
75  void plot_impulse_amplitude (Gtk::Widget *,cairo_t *);
76 
77  void draw_scales_phase (Gtk::Widget *,cairo_t *);
78  void plot_impulse_phase (Gtk::Widget *,cairo_t *);
79 
80  void plot_signal_amplitude_difference (Gtk::Widget *,cairo_t *);
81 
82  // Helpers
83  bool timeout_callback ();
84  void redraw_scales ();
85 
86  // Fields:
87 
88  // analysis parameters
89  float _samplerate;
90 
91  float _min_dB;
92  float _max_dB;
93  float _step_dB;
94 
95  float _log_coeff;
96  float _log_max;
97 
100 
101  // buffers
104 
105 
106  // dimensions
109 
110  // My objects
116 
117  // gui objects
118  Gtk::DrawingArea *_analysis_area;
119  cairo_surface_t *_analysis_scale_surface;
120 
121  // dB scale selection:
122  class dBSelectionColumns : public Gtk::TreeModel::ColumnRecord
123  {
124  public:
126  { add(dBMin); add(dBMax); add(dBStep); add(name); }
127 
128  Gtk::TreeModelColumn<float> dBMin;
129  Gtk::TreeModelColumn<float> dBMax;
130  Gtk::TreeModelColumn<float> dBStep;
131  Gtk::TreeModelColumn<std::string> name;
132  };
133 
135 
136  Gtk::ComboBox *dBScaleCombo;
137  Glib::RefPtr<Gtk::ListStore> dBScaleModel;
138 
139  Gtk::CheckButton *_phase_button;
140 
141  // signals and connections
142  sigc::connection _update_connection;
143  sigc::connection _window_unmap_connection;
144  sigc::connection _window_map_connection;
145 
147 };
148 
149 #endif
150 
ARDOUR::framecnt_t _signal_buffer_size
Definition: plugin_eq_gui.h:99
void run_impulse_analysis()
float _log_coeff
Definition: plugin_eq_gui.h:95
ARDOUR::BufferSet _bufferset
void resize_analysis_area(Gtk::Allocation &)
boost::shared_ptr< ARDOUR::Plugin > _plugin
Glib::RefPtr< Gtk::ListStore > dBScaleModel
float _signal_analysis_running
Definition: plugin_eq_gui.h:59
PluginEqGui(boost::shared_ptr< ARDOUR::PluginInsert >)
Gtk::TreeModelColumn< float > dBMax
virtual void on_show()
ARDOUR::framecnt_t _buffer_size
Definition: plugin_eq_gui.h:98
void redraw_analysis_area()
cairo_surface_t * _analysis_scale_surface
void plot_signal_amplitude_difference(Gtk::Widget *, cairo_t *)
void start_updating()
sigc::connection _window_unmap_connection
void draw_scales_phase(Gtk::Widget *, cairo_t *)
GTKArdour::FFT * _impulse_fft
void draw_scales_power(Gtk::Widget *, cairo_t *)
void redraw_scales()
void stop_listening()
int64_t framecnt_t
Definition: types.h:76
float _analysis_height
sigc::connection _update_connection
Gtk::TreeModelColumn< float > dBStep
Definition: amp.h:29
void change_dB_scale()
float _analysis_width
Gtk::CheckButton * _phase_button
sigc::connection _window_map_connection
void set_buffer_size(uint32_t, uint32_t)
void start_listening()
float _samplerate
Definition: plugin_eq_gui.h:89
float _step_dB
Definition: plugin_eq_gui.h:93
Gtk::ComboBox * dBScaleCombo
void plot_impulse_phase(Gtk::Widget *, cairo_t *)
Gtk::TreeModelColumn< float > dBMin
float _log_max
Definition: plugin_eq_gui.h:96
void signal_collect_callback(ARDOUR::BufferSet *, ARDOUR::BufferSet *)
void plot_impulse_amplitude(Gtk::Widget *, cairo_t *)
boost::shared_ptr< ARDOUR::PluginInsert > _plugin_insert
Gtk::TreeModelColumn< std::string > name
Gtk::DrawingArea * _analysis_area
void stop_updating()
GTKArdour::FFT * _signal_output_fft
PBD::ScopedConnection analysis_connection
ARDOUR::BufferSet _collect_bufferset
void draw_analysis_scales(cairo_t *)
virtual void on_hide()
bool expose_analysis_area(GdkEventExpose *)
dBSelectionColumns dBColumns
Definition: fft.h:35
bool timeout_callback()
GTKArdour::FFT * _signal_input_fft