Ardour  9.0-pre0-582-g084a23a80d
plugin_eq_gui.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Sampo Savolainen <v2@iki.fi>
3  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
4  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2010 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2018-2019 Robin Gareus <robin@gareus.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef __ardour_plugin_eq_gui_h
24 #define __ardour_plugin_eq_gui_h
25 
26 #include "pbd/signals.h"
27 
28 #include "ardour/buffer_set.h"
29 
30 #include <gtkmm/table.h>
31 #include <gtkmm/drawingarea.h>
32 #include <gtkmm/combobox.h>
33 #include <gtkmm/comboboxtext.h>
34 #include <gtkmm/liststore.h>
35 
36 namespace ARDOUR {
37  class Plugin;
38  class PluginInsert;
39 }
40 
41 namespace GTKArdour {
42  class FFT;
43 }
44 
45 class PluginEqGui : public Gtk::Table
46 {
47 public:
48  PluginEqGui (std::shared_ptr<ARDOUR::PluginInsert>);
50 
51 private:
52  // Setup
53  void set_buffer_size (uint32_t, uint32_t);
54  void change_dB_scale ();
55 
56  // 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 start_listening ();
69  void stop_listening ();
70 
73 
74  void draw_analysis_scales (cairo_t *);
76 
77  void draw_scales_power (Gtk::Widget *, cairo_t *);
78  void plot_impulse_amplitude (Gtk::Widget *,cairo_t *);
79 
80  void draw_scales_phase (Gtk::Widget *,cairo_t *);
81  void plot_impulse_phase (Gtk::Widget *,cairo_t *);
82 
84 
85  void update_pointer_info(float);
88 
89  // Helpers
91  void redraw_scales ();
92 
93  // Fields:
94 
95  // analysis parameters
96  float _samplerate;
97 
98  float _min_dB;
99  float _max_dB;
100  float _step_dB;
101 
102  float _log_coeff;
103  float _log_max;
104 
108 
109  // buffers
112 
113  // dimensions
116 
117  // My objects
121  std::shared_ptr<ARDOUR::Plugin> _plugin;
122  std::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;
123 
124  // gui objects
126  cairo_surface_t *_analysis_scale_surface;
130 
131  // dB scale selection:
133  {
134  public:
136  { add(dBMin); add(dBMax); add(dBStep); add(name); }
137 
142  };
143 
145 
147  Glib::RefPtr<Gtk::ListStore> dBScaleModel;
148 
150 
152 
153  // signals and connections
154  sigc::connection _update_connection;
155  sigc::connection _window_unmap_connection;
156  sigc::connection _window_map_connection;
157 
159 };
160 
161 #endif
Definition: FFT.h:19
void add(TreeModelColumnBase &column)
Gtk::TreeModelColumn< std::string > name
Gtk::TreeModelColumn< float > dBMin
Gtk::TreeModelColumn< float > dBStep
Gtk::TreeModelColumn< float > dBMax
bool timeout_callback()
void resize_analysis_area(Gtk::Allocation &)
void set_buffer_size(uint32_t, uint32_t)
Gtk::ComboBoxText * _live_signal_combo
Gtk::Label * _pointer_info
void redraw_analysis_area()
Gtk::CheckButton * _phase_button
float _signal_analysis_running
Definition: plugin_eq_gui.h:59
int _pointer_in_area_freq
ARDOUR::samplecnt_t _signal_buffer_size
bool expose_analysis_area(GdkEventExpose *)
PBD::ScopedConnection analysis_connection
bool analysis_area_mouseover(GdkEventMotion *)
PluginEqGui(std::shared_ptr< ARDOUR::PluginInsert >)
void plot_signal_amplitude_difference(Gtk::Widget *, cairo_t *)
float _analysis_height
float _log_coeff
ARDOUR::BufferSet _collect_bufferset
void start_listening()
GTKArdour::FFT * _impulse_fft
cairo_surface_t * _analysis_scale_surface
virtual void on_hide()
This is a default handler for the signal signal_hide().
void draw_scales_phase(Gtk::Widget *, cairo_t *)
ARDOUR::samplecnt_t _buffer_size
sigc::connection _window_unmap_connection
float _samplerate
Definition: plugin_eq_gui.h:96
std::shared_ptr< ARDOUR::Plugin > _plugin
Gtk::DrawingArea * _analysis_area
ARDOUR::samplecnt_t _block_size
void update_pointer_info(float)
int _pointer_in_area_xpos
void run_impulse_analysis()
sigc::connection _window_map_connection
void signal_collect_callback(ARDOUR::BufferSet *, ARDOUR::BufferSet *)
void start_updating()
GTKArdour::FFT * _signal_output_fft
bool analysis_area_mouseexit(GdkEventCrossing *)
GTKArdour::FFT * _signal_input_fft
void draw_analysis_scales(cairo_t *)
void plot_impulse_amplitude(Gtk::Widget *, cairo_t *)
void stop_listening()
void stop_updating()
float _analysis_width
void redraw_scales()
std::shared_ptr< ARDOUR::PluginInsert > _plugin_insert
virtual void on_show()
This is a default handler for the signal signal_show().
void change_dB_scale()
Gtk::ComboBox * dBScaleCombo
ARDOUR::BufferSet _bufferset
void plot_impulse_phase(Gtk::Widget *, cairo_t *)
Glib::RefPtr< Gtk::ListStore > dBScaleModel
void draw_scales_power(Gtk::Widget *, cairo_t *)
sigc::connection _update_connection
dBSelectionColumns dBColumns
Temporal::samplecnt_t samplecnt_t
Definition: fft.h:32