fader+meter: update numeric display bg on style change
[ardour.git] / gtk2_ardour / time_axis_view.h
index 6e659e47a73677ce8caf5ce6851c29620183c382..21819586721ee6b6d147cef0e280f3385016df4c 100644 (file)
@@ -44,7 +44,6 @@
 #include "axis_view.h"
 #include "enums.h"
 #include "editing.h"
-#include "canvas.h"
 
 namespace ARDOUR {
        class Session;
@@ -58,6 +57,12 @@ namespace Gtk {
        class Menu;
 }
 
+namespace ArdourCanvas {
+       class Canvas;
+       class Container;
+       class Item;
+}
+
 class PublicEditor;
 class RegionSelection;
 class TimeSelection;
@@ -99,9 +104,8 @@ class TimeAxisView : public virtual AxisView
         virtual void enter_internal_edit_mode () {}
         virtual void leave_internal_edit_mode () {}
 
-       ArdourCanvas::Group* canvas_display () { return _canvas_display; }
-       ArdourCanvas::Group* canvas_background () { return _canvas_background; }
-       ArdourCanvas::Group* ghost_group () { return _ghost_group; }
+       ArdourCanvas::Container* canvas_display () { return _canvas_display; }
+       ArdourCanvas::Container* ghost_group () { return _ghost_group; }
 
        /** @return effective height (taking children into account) in canvas units, or
            0 if this TimeAxisView has not yet been shown */
@@ -120,8 +124,6 @@ class TimeAxisView : public virtual AxisView
        virtual guint32 show_at (double y, int& nth, Gtk::VBox *parent);
        virtual void hide ();
 
-       void clip_to_viewport ();
-
        bool touched (double top, double bot);
 
        /** @return true if hidden, otherwise false */
@@ -142,14 +144,15 @@ class TimeAxisView : public virtual AxisView
 
        virtual void reset_visual_state ();
 
-       std::pair<TimeAxisView*, double> covers_y_position (double);
+       std::pair<TimeAxisView*, double> covers_y_position (double) const;
+        bool covered_by_y_range (double y0, double y1) const;
 
        virtual void step_height (bool);
 
        virtual ARDOUR::RouteGroup* route_group() const { return 0; }
        virtual boost::shared_ptr<ARDOUR::Playlist> playlist() const { return boost::shared_ptr<ARDOUR::Playlist> (); }
 
-       virtual void set_samples_per_unit (double);
+       virtual void set_samples_per_pixel (double);
        virtual void show_selection (TimeSelection&);
        virtual void hide_selection ();
        virtual void reshow_selection (TimeSelection&);
@@ -164,6 +167,8 @@ class TimeAxisView : public virtual AxisView
        virtual void set_selected_regionviews (RegionSelection&) {}
        virtual void set_selected_points (PointSelection&) {}
 
+       virtual void fade_range (TimeSelection&) {}
+
        virtual boost::shared_ptr<ARDOUR::Region> find_next_region (framepos_t /*pos*/, ARDOUR::RegionPoint, int32_t /*dir*/) {
                return boost::shared_ptr<ARDOUR::Region> ();
        }
@@ -198,10 +203,14 @@ class TimeAxisView : public virtual AxisView
        /* The Standard LHS Controls */
        Gtk::HBox              controls_hbox;
        Gtk::Table             controls_table;
+       Gtk::Table             name_table;
        Gtk::EventBox          controls_ebox;
        Gtk::VBox              controls_vbox;
+       Gtk::VBox              name_vbox;
        Gtk::VBox              time_axis_vbox;
+       Gtk::Frame              time_axis_frame;
        Gtk::HBox              name_hbox;
+       Gtk::HBox              top_hbox;
        Gtk::Label             name_label;
         bool                  _name_editing;
         uint32_t               height;  /* in canvas units */
@@ -209,14 +218,15 @@ class TimeAxisView : public virtual AxisView
        std::string            controls_base_selected_name;
        Gtk::Menu*             display_menu; /* The standard LHS Track control popup-menus */
        TimeAxisView*          parent;
-       ArdourCanvas::Group*   selection_group;
+       ArdourCanvas::Container*   selection_group;
+       ArdourCanvas::Container*  _ghost_group;
        std::list<GhostRegion*> ghosts;
        std::list<SelectionRect*> free_selection_rects;
        std::list<SelectionRect*> used_selection_rects;
        bool                  _hidden;
        bool                   in_destructor;
        Gtk::Menu*            _size_menu;
-       ArdourCanvas::Group*  _canvas_display;
+       ArdourCanvas::Container*  _canvas_display;
        double                _y_position;
        PublicEditor&         _editor;
 
@@ -224,8 +234,8 @@ class TimeAxisView : public virtual AxisView
 
        bool name_entry_key_release (GdkEventKey *ev);
        bool name_entry_key_press (GdkEventKey *ev);
+       bool name_entry_focus_out (GdkEventFocus *ev);
 
-        ArdourDialog* name_editor;
         Gtk::Entry* name_entry;
         void begin_name_edit ();
         void end_name_edit (int);
@@ -276,14 +286,12 @@ class TimeAxisView : public virtual AxisView
        void build_size_menu ();
 
 private:
-       ArdourCanvas::Group* _canvas_background;
        Gtk::VBox*            control_parent;
        int                  _order;
        uint32_t             _effective_height;
        double               _resize_drag_start;
        GdkCursor*           _preresize_cursor;
        bool                 _have_preresize_cursor;
-       ArdourCanvas::Group* _ghost_group;
         bool                  _ebox_release_can_act;
 
        static uint32_t button_height;