show() widgets explicitly in gtk2_ardour/analysis_window.cc
[ardour.git] / gtk2_ardour / automation_time_axis.h
index 7b62e6eee2586397329c5d2f09ffe0719f495807..c3be6ffd0013f1b9c69cc95b7294774baa45c6a0 100644 (file)
 #include <vector>
 #include <list>
 #include <string>
+#include <utility>
 
 #include <boost/shared_ptr.hpp>
 
 #include <ardour/types.h>
+#include <ardour/automatable.h>
 
 #include "canvas.h"
 #include "time_axis_view.h"
 #include "simplerect.h"
+#include "automation_controller.h"
 
 using std::vector;
 using std::list;
@@ -50,29 +53,29 @@ class GhostRegion;
 class Selection;
 class Selectable;
 
+
 class AutomationTimeAxisView : public TimeAxisView {
   public:
        AutomationTimeAxisView (ARDOUR::Session&,
                                boost::shared_ptr<ARDOUR::Route>,
+                               boost::shared_ptr<ARDOUR::Automatable>,
+                               boost::shared_ptr<ARDOUR::AutomationControl>,
                                PublicEditor&,
                                TimeAxisView& parent,
                                ArdourCanvas::Canvas& canvas,
                                const string & name, /* translatable */
-                               const string & state_name, /* not translatable */
                                const string & plug_name = "");
 
        ~AutomationTimeAxisView();
        
-       virtual void set_height (TimeAxisView::TrackHeight);
+       void set_height (TimeAxisView::TrackHeight);
        void set_samples_per_unit (double);
        std::string name() const { return _name; }
 
-       virtual void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, nframes_t, double) = 0;
-
-       virtual void clear_lines ();
-       virtual void add_line (AutomationLine&);
+       void add_automation_event (ArdourCanvas::Item *item, GdkEvent *event, nframes_t, double);
 
-       vector<AutomationLine*> lines;
+       void clear_lines ();
+       boost::shared_ptr<AutomationLine> line() { return _line; }
 
        void set_selected_points (PointSelection&);
        void get_selectables (nframes_t start, nframes_t end, double top, double bot, list<Selectable *>&);
@@ -94,14 +97,26 @@ class AutomationTimeAxisView : public TimeAxisView {
        void show_all_control_points ();
        void hide_all_but_selected_control_points ();
        void set_state (const XMLNode&);
-       XMLNode* get_state_node ();
+       
+       guint32 show_at (double y, int& nth, Gtk::VBox *parent);
+       void hide ();
+       
+       static const string state_node_name;
+       XMLNode* get_state_node();
 
   protected:
-       boost::shared_ptr<ARDOUR::Route> route;
-       ArdourCanvas::SimpleRect* base_rect;
+       boost::shared_ptr<ARDOUR::Route> _route; ///< Parent route
+       boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
+       boost::shared_ptr<ARDOUR::Automatable> _automatable; ///< Control owner, maybe = _route
+       
+       boost::shared_ptr<AutomationController> _controller;
+       
+       ArdourCanvas::SimpleRect* _base_rect;
+       boost::shared_ptr<AutomationLine> _line;
+       
        string _name;
-       string _state_name;
        bool    in_destructor;
+       bool    ignore_toggle;
 
        bool    first_call_to_set_height;
 
@@ -118,12 +133,14 @@ class AutomationTimeAxisView : public TimeAxisView {
        Gtk::CheckMenuItem*     auto_touch_item;
        Gtk::CheckMenuItem*     auto_write_item;
 
+       void add_line (boost::shared_ptr<AutomationLine>);
+       
        void clear_clicked ();
        void height_clicked ();
        void hide_clicked ();
        void auto_clicked ();
 
-       virtual void build_display_menu ();
+       void build_display_menu ();
 
        list<GhostRegion*> ghosts;
 
@@ -132,19 +149,21 @@ class AutomationTimeAxisView : public TimeAxisView {
        bool paste_one (AutomationLine&, nframes_t, float times, Selection&, size_t nth);
        void reset_objects_one (AutomationLine&, PointSelection&);
 
-       virtual void set_automation_state (ARDOUR::AutoState) = 0;
+       void set_automation_state (ARDOUR::AutoState);
        bool ignore_state_request;
 
        void automation_state_changed ();
        sigc::connection automation_connection;
 
+       void update_extra_xml_shown (bool editor_shown);
+
        void entered ();
        void exited ();
 
        void set_colors ();
-       void color_handler (ColorID, uint32_t);
+       void color_handler ();
 
-       static Pango::FontDescription name_font;
+       static Pango::FontDescription* name_font;
        static bool have_name_font;
 };