X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmeter_strip.h;h=b8d9bf26c22b12ca8fc8fff5ef9e06dd859098a6;hb=4050ca5633dda03679f9aa9fab87d3bbf517395b;hp=e1bae713265059c78bdb16df7a75c9dab76b52e7;hpb=316973d7c7bc99bfef6367d42009883d0de2abbd;p=ardour.git diff --git a/gtk2_ardour/meter_strip.h b/gtk2_ardour/meter_strip.h index e1bae71326..b8d9bf26c2 100644 --- a/gtk2_ardour/meter_strip.h +++ b/gtk2_ardour/meter_strip.h @@ -1,55 +1,62 @@ /* - 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-2017 Robin Gareus + * Copyright (C) 2016 Paul Davis + * + * 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. + */ #ifndef __ardour_meter_strip__ #define __ardour_meter_strip__ #include - #include +#include +#include +#include +#include +#include + #include "pbd/stateful.h" #include "ardour/types.h" #include "ardour/ardour.h" -#include "route_ui.h" -#include "ardour_button.h" + +#include "widgets/ardour_button.h" #include "level_meter.h" +#include "route_ui.h" namespace ARDOUR { class Route; class RouteGroup; class Session; } -namespace Gtk { - class Window; - class Style; -} -class MeterStrip : public Gtk::VBox, public RouteUI +class MeterStrip : public Gtk::VBox, public AxisView, public RouteUI { - public: +public: MeterStrip (ARDOUR::Session*, boost::shared_ptr); MeterStrip (int, ARDOUR::MeterType); ~MeterStrip (); + std::string name() const; + Gdk::Color color () const; + + boost::shared_ptr stripable() const { return RouteUI::stripable(); } + void set_session (ARDOUR::Session* s); void fast_update (); boost::shared_ptr route() { return _route; } @@ -72,9 +79,11 @@ class MeterStrip : public Gtk::VBox, public RouteUI bool is_metric_display() { return _strip_type == 0; } ARDOUR::MeterType meter_type(); - protected: + bool selected() const { return false; } + +protected: boost::shared_ptr _route; - PBD::ScopedConnectionList route_connections; + PBD::ScopedConnectionList meter_route_connections; PBD::ScopedConnectionList level_meter_connection; void self_delete (); @@ -88,11 +97,11 @@ class MeterStrip : public Gtk::VBox, public RouteUI void on_size_request (Gtk::Requisition*); /* route UI */ - void update_rec_display (); + void blink_rec_display (bool onoff); std::string state_id() const; void set_button_names (); - private: +private: Gtk::VBox mtr_vbox; Gtk::VBox nfo_vbox; Gtk::EventBox mtr_container; @@ -100,7 +109,9 @@ class MeterStrip : public Gtk::VBox, public RouteUI Gtk::HBox meterbox; Gtk::HBox spacer; Gtk::HBox namebx; - ArdourButton name_label; + Gtk::VBox namenumberbx; + ArdourWidgets::ArdourButton name_label; + ArdourWidgets::ArdourButton number_label; Gtk::DrawingArea meter_metric_area; Gtk::DrawingArea meter_ticks1_area; Gtk::DrawingArea meter_ticks2_area; @@ -115,7 +126,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI Gtk::Alignment peak_align; Gtk::HBox peakbx; Gtk::VBox btnbox; - ArdourButton peak_display; + ArdourWidgets::ArdourButton peak_display; std::vector _types; ARDOUR::MeterType metric_type; @@ -128,8 +139,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI LevelMeterHBox *level_meter; - PBD::ScopedConnection _config_connection; - void strip_property_changed (const PBD::PropertyChange&); + void route_property_changed (const PBD::PropertyChange&); void meter_configuration_changed (ARDOUR::ChanCount); void meter_type_changed (ARDOUR::MeterType); void update_background (ARDOUR::MeterType); @@ -140,9 +150,12 @@ class MeterStrip : public Gtk::VBox, public RouteUI void redraw_metrics (); void update_button_box (); void update_name_box (); + void name_changed (); + + void route_color_changed (); bool _suspend_menu_callbacks; - bool level_meter_button_release (GdkEventButton* ev); + bool level_meter_button_press (GdkEventButton* ev); void popup_level_meter_menu (GdkEventButton* ev); void add_level_meter_type_item (Gtk::Menu_Helpers::MenuList&, Gtk::RadioMenuItem::Group&, std::string const &, ARDOUR::MeterType);