X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmeterbridge.h;h=1709455ae4cf735f0d418d85875d732552d31165;hb=5c6e18e6a087823e4a3719177c92238b206e3aeb;hp=3bdf0483bd6923bd6b182369dcf9bd62daf64219;hpb=35937e508322cfe336a15cc240839dbb2d553ef6;p=ardour.git diff --git a/gtk2_ardour/meterbridge.h b/gtk2_ardour/meterbridge.h index 3bdf0483bd..1709455ae4 100644 --- a/gtk2_ardour/meterbridge.h +++ b/gtk2_ardour/meterbridge.h @@ -20,6 +20,8 @@ #ifndef __ardour_meterbridge_h__ #define __ardour_meterbridge_h__ +#include + #include #include #include @@ -59,8 +61,12 @@ class Meterbridge : static Meterbridge* _instance; bool _visible; + bool _show_busses; + bool _show_master; + bool _show_midi; Gtk::ScrolledWindow scroller; + Gtk::HBox meterarea; Gtk::HBox global_hpacker; Gtk::VBox global_vpacker; @@ -73,14 +79,56 @@ class Meterbridge : void add_strips (ARDOUR::RouteList&); void remove_strip (MeterStrip *); - void parameter_changed (std::string const &); - void session_going_away (); + void sync_order_keys (); + void resync_order (); + mutable Glib::Threads::Mutex _resync_mutex; + + struct MeterBridgeStrip { + MeterStrip *s; + bool visible; + + MeterBridgeStrip(MeterStrip *ss) { + s = ss; + visible = true; + } + }; + + struct MeterOrderRouteSorter { + bool operator() (struct MeterBridgeStrip ma, struct MeterBridgeStrip mb) { + boost::shared_ptr a = ma.s->route(); + boost::shared_ptr b = mb.s->route(); + if (a->is_master() || a->is_monitor()) { + /* "a" is a special route (master, monitor, etc), and comes + * last in the mixer ordering + */ + return false; + } else if (b->is_master() || b->is_monitor()) { + /* everything comes before b */ + return true; + } + return a->order_key () < b->order_key (); + } + }; + + std::list strips; + + MeterStrip metrics_left; + MeterStrip metrics_right; + std::vector _metrics; + + Gtk::VBox metrics_vpacker_left; + Gtk::VBox metrics_vpacker_right; + Gtk::HBox metrics_spacer_left; + Gtk::HBox metrics_spacer_right; + + static const int32_t default_width = 600; + static const int32_t default_height = 400; + static const int max_height = 1200; // == 1024 + 148 + 16 + 12 see meter_strip.cc + int cur_max_width; - std::list strips; + void update_title (); - static const int32_t default_width = 300; - static const int32_t default_height = 400; // for restoring window geometry. int m_root_x, m_root_y, m_width, m_height; @@ -89,6 +137,22 @@ class Meterbridge : bool on_key_press_event (GdkEventKey*); bool on_key_release_event (GdkEventKey*); + bool on_scroll_event (GdkEventScroll*); + + void scroll_left (); + void scroll_right (); + + void on_size_allocate (Gtk::Allocation&); + void on_size_request (Gtk::Requisition*); + + void parameter_changed (std::string const & p); + void on_theme_changed (); + + void on_scroll (); + sigc::connection scroll_connection; + + int _mm_left, _mm_right; + ARDOUR::MeterType _mt_left, _mt_right; }; #endif