Ardour  9.0-pre0-582-g084a23a80d
meter_strip.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
3  * Copyright (C) 2016 Paul Davis <paul@linuxaudiosystems.com>
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 along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __ardour_meter_strip__
21 #define __ardour_meter_strip__
22 
23 #include <vector>
24 #include <cmath>
25 
26 #include <gtkmm/alignment.h>
27 #include <gtkmm/box.h>
28 #include <gtkmm/drawingarea.h>
29 #include <gtkmm/eventbox.h>
30 #include <gtkmm/separator.h>
31 
32 #include "pbd/stateful.h"
33 
34 #include "ardour/types.h"
35 #include "ardour/ardour.h"
36 
37 #include "widgets/ardour_button.h"
38 #include "widgets/ardour_knob.h"
39 
40 #include "level_meter.h"
41 #include "route_ui.h"
42 
43 namespace ARDOUR {
44  class Route;
45  class RouteGroup;
46  class Session;
47 }
48 
49 class MeterStrip : public Gtk::VBox, public AxisView, public RouteUI
50 {
51 public:
52  MeterStrip (ARDOUR::Session*, std::shared_ptr<ARDOUR::Route>);
55 
56  std::string name() const;
57  Gdk::Color color () const;
58 
59  std::shared_ptr<ARDOUR::Stripable> stripable() const { return RouteUI::stripable(); }
60 
62  void fast_update ();
63  std::shared_ptr<ARDOUR::Route> route() { return _route; }
64 
66  static PBD::Signal<void()> MetricChanged;
68 
72 
74 
76  int get_metric_mode() { return _metricmode; }
77  void set_tick_bar (int);
78  int get_tick_bar() { return _tick_bar; }
79  bool has_midi() { return _has_midi; }
80  bool is_metric_display() { return _strip_type == 0; }
82 
83  bool selected() const { return false; }
84 
85 protected:
86  std::shared_ptr<ARDOUR::Route> _route;
89  void self_delete ();
90 
94 
96 
99 
100  /* route UI */
101  void blink_rec_display (bool onoff);
102  std::string state_id() const;
104 
105 private:
119 
126 
132 
133  std::vector<ARDOUR::DataType> _types;
135 
138  bool _has_midi;
142 
144 
146 
151 
153 
154  void gain_start_touch (int);
155  void gain_end_touch (int);
156 
157  void parameter_changed (std::string const & p);
158  void redraw_metrics ();
161  void name_changed ();
162 
164 
169 
173 
175  void set_label_height (uint32_t);
176 };
177 
178 #endif /* __ardour_mixer_strip__ */
Gdk::Color color() const
ArdourWidgets::ArdourButton peak_display
Definition: meter_strip.h:131
void name_changed()
int get_metric_mode()
Definition: meter_strip.h:76
static PBD::Signal< void(MeterStrip *)> CatchDeletion
Definition: meter_strip.h:65
bool level_meter_button_press(GdkEventButton *ev)
void meter_type_changed(ARDOUR::MeterType)
void route_color_changed()
void parameter_changed(std::string const &p)
ARDOUR::MeterType meter_type()
Gtk::HBox recbox
Definition: meter_strip.h:122
Gtk::HBox namebx
Definition: meter_strip.h:112
std::shared_ptr< ARDOUR::Route > _route
Definition: meter_strip.h:86
bool is_metric_display()
Definition: meter_strip.h:80
void set_meter_type_multi(int, ARDOUR::RouteGroup *, ARDOUR::MeterType)
std::shared_ptr< ARDOUR::Route > route()
Definition: meter_strip.h:63
std::string state_id() const
Gtk::HBox mon_in_box
Definition: meter_strip.h:123
void update_button_box()
void set_button_names()
void reset_route_peak_display(ARDOUR::Route *)
void gain_start_touch(int)
bool peak_button_release(GdkEventButton *)
Gtk::VBox btnbox
Definition: meter_strip.h:130
static PBD::Signal< void()> ConfigurationChanged
Definition: meter_strip.h:67
std::string name() const
void redraw_metrics()
Gtk::HBox solobox
Definition: meter_strip.h:121
void add_level_meter_type_item(Gtk::Menu_Helpers::MenuList &, Gtk::RadioMenuItem::Group &, std::string const &, ARDOUR::MeterType)
Gtk::VBox namenumberbx
Definition: meter_strip.h:113
gint meter_ticks2_expose(GdkEventExpose *)
void set_metric_mode(int, ARDOUR::MeterType)
bool _has_midi
Definition: meter_strip.h:138
Gtk::Alignment meter_align
Definition: meter_strip.h:127
void reset_peak_display()
void blink_rec_display(bool onoff)
Gtk::EventBox mtr_container
Definition: meter_strip.h:108
int _metricmode
Definition: meter_strip.h:141
bool _suspend_menu_callbacks
Definition: meter_strip.h:165
void gain_end_touch(int)
void set_tick_bar(int)
ArdourWidgets::ArdourButton name_label
Definition: meter_strip.h:114
Gtk::HSeparator mtr_hsep
Definition: meter_strip.h:109
Gtk::VBox nfo_vbox
Definition: meter_strip.h:107
void update_name_box()
ArdourWidgets::ArdourButton number_label
Definition: meter_strip.h:115
static PBD::Signal< void()> MetricChanged
Definition: meter_strip.h:66
void on_size_allocate(Gtk::Allocation &)
This is a default handler for the signal signal_size_allocate().
gint meter_metrics_expose(GdkEventExpose *)
Gtk::VBox mtr_vbox
Definition: meter_strip.h:106
void on_size_request(Gtk::Requisition *)
This is a default handler for the signal signal_size_request().
void fast_update()
int get_tick_bar()
Definition: meter_strip.h:78
void add_label_height_item(Gtk::Menu_Helpers::MenuList &, Gtk::RadioMenuItem::Group &, std::string const &, uint32_t)
MeterStrip(ARDOUR::Session *, std::shared_ptr< ARDOUR::Route >)
void set_meter_type(ARDOUR::MeterType mode)
LevelMeterHBox * level_meter
Definition: meter_strip.h:143
ArdourWidgets::ArdourKnob gain_control
Definition: meter_strip.h:145
bool _meter_peaked
Definition: meter_strip.h:137
void meter_configuration_changed(ARDOUR::ChanCount)
bool _clear_meters
Definition: meter_strip.h:136
std::vector< ARDOUR::DataType > _types
Definition: meter_strip.h:133
void update_background(ARDOUR::MeterType)
int _strip_type
Definition: meter_strip.h:140
void popup_name_label_menu(GdkEventButton *ev)
Gtk::Alignment peak_align
Definition: meter_strip.h:128
gint meter_ticks1_expose(GdkEventExpose *)
void popup_level_meter_menu(GdkEventButton *ev)
Gtk::HBox spacer
Definition: meter_strip.h:111
Gtk::HBox meterbox
Definition: meter_strip.h:110
PBD::ScopedConnectionList meter_route_connections
Definition: meter_strip.h:87
Gtk::DrawingArea meter_ticks1_area
Definition: meter_strip.h:117
Gtk::HBox mutebox
Definition: meter_strip.h:120
void set_session(ARDOUR::Session *s)
std::shared_ptr< ARDOUR::Stripable > stripable() const
Definition: meter_strip.h:59
void on_theme_changed()
Gtk::HBox peakbx
Definition: meter_strip.h:129
void set_label_height(uint32_t)
Gtk::DrawingArea meter_metric_area
Definition: meter_strip.h:116
void reset_group_peak_display(ARDOUR::RouteGroup *)
bool name_label_button_release(GdkEventButton *ev)
MeterStrip(int, ARDOUR::MeterType)
void self_delete()
PBD::ScopedConnectionList level_meter_connection
Definition: meter_strip.h:88
Gtk::HBox gain_box
Definition: meter_strip.h:125
void route_property_changed(const PBD::PropertyChange &)
ARDOUR::MeterType metric_type
Definition: meter_strip.h:134
bool selected() const
Definition: meter_strip.h:83
Gtk::DrawingArea meter_ticks2_area
Definition: meter_strip.h:118
Gtk::HBox mon_disk_box
Definition: meter_strip.h:124
bool has_midi()
Definition: meter_strip.h:79
std::shared_ptr< ARDOUR::Stripable > stripable() const