Vkeybd: use ArdourWidgets for all GUI elements
[ardour.git] / gtk2_ardour / meter_strip.cc
index a6dac9a03877c9ab4d3a0c54133330d0792ca1c1..e51725aef543d8c4fec3a6cd341a972fdb2889f3 100644 (file)
@@ -1,21 +1,22 @@
 /*
-    Copyright (C) 2013 Paul Davis
-    Author: Robin Gareus
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
+ * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2014-2016 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <list>
 
@@ -68,13 +69,14 @@ PBD::Signal0<void> MeterStrip::ConfigurationChanged;
 
 MeterStrip::MeterStrip (int metricmode, MeterType mt)
        : RouteUI ((Session*) 0)
+       , metric_type (MeterPeak)
+       , _has_midi (false)
+       , _tick_bar (0)
+       , _strip_type (0)
+       , _metricmode (-1)
+       , level_meter (0)
+       , _suspend_menu_callbacks (false)
 {
-       level_meter = 0;
-       _strip_type = 0;
-       _tick_bar = 0;
-       _metricmode = -1;
-       metric_type = MeterPeak;
-
        mtr_vbox.set_spacing (PX_SCALE(2, 2));
        nfo_vbox.set_spacing (PX_SCALE(2, 2));
        peakbx.set_size_request (-1, PX_SCALE(14, 14));
@@ -122,9 +124,15 @@ MeterStrip::MeterStrip (int metricmode, MeterType mt)
 
 MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
        : SessionHandlePtr (sess)
-       , RouteUI(0)
-       , _route(rt)
-       , peak_display()
+       , RouteUI ((Session*) 0)
+       , _route (rt)
+       , metric_type (MeterPeak)
+       , _has_midi (false)
+       , _tick_bar (0)
+       , _strip_type (0)
+       , _metricmode (-1)
+       , level_meter (0)
+       , _suspend_menu_callbacks (false)
 {
        mtr_vbox.set_spacing (PX_SCALE(2, 2));
        nfo_vbox.set_spacing (PX_SCALE(2, 2));
@@ -132,11 +140,6 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
        RouteUI::init ();
        RouteUI::set_route (rt);
 
-       _has_midi = false;
-       _tick_bar = 0;
-       _metricmode = -1;
-       metric_type = MeterPeak;
-
        // note: level_meter->setup_meters() does the scaling
        int meter_width = 6;
        if (_route->shared_peak_meter()->input_streams().n_total() == 1) {
@@ -473,7 +476,9 @@ MeterStrip::meter_configuration_changed (ChanCount c)
        set_tick_bar(_tick_bar);
 
        on_theme_changed();
-       if (old_has_midi != _has_midi) MetricChanged();
+       if (old_has_midi != _has_midi) {
+               MetricChanged(); /* EMIT SIGNAL */
+       }
        else ConfigurationChanged();
 }
 
@@ -581,7 +586,8 @@ MeterStrip::on_size_allocate (Gtk::Allocation& a)
 
        if (need_relayout) {
                queue_resize();
-               MetricChanged(); // force re-layout, parent on_scroll(), queue_resize()
+               /* force re-layout, parent on_scroll(), queue_resize() */
+               MetricChanged(); /* EMIT SIGNAL */
        }
 }
 
@@ -941,7 +947,7 @@ void
 MeterStrip::meter_type_changed (MeterType type)
 {
        update_background (type);
-       MetricChanged();
+       MetricChanged(); /* EMIT SIGNAL */
 }
 
 void