patch from brian to get consistent menu behaviour
[ardour.git] / gtk2_ardour / gain_meter.h
index d30f21314fa046c9cd5b0d19c6d4883ad888c992..bbc12ccb6ce37567c906f2cb3747c8da14e003ef 100644 (file)
 #include <gtkmm/table.h>
 #include <gtkmm/drawingarea.h>
 
-
 #include <ardour/types.h>
 
-#include <gtkmm2ext/slider_controller.h>
 #include <gtkmm2ext/click_box.h>
+#include <gtkmm2ext/slider_controller.h>
 
 #include "enums.h"
 
@@ -57,7 +56,7 @@ namespace Gtk {
 class GainMeter : public Gtk::VBox
 {
   public:
-       GainMeter (ARDOUR::IO&, ARDOUR::Session&);
+       GainMeter (boost::shared_ptr<ARDOUR::IO>, ARDOUR::Session&);
        ~GainMeter ();
 
        void update_gain_sensitive ();
@@ -74,7 +73,9 @@ class GainMeter : public Gtk::VBox
        void set_fader_name (const char * name);
 
   private:
-       ARDOUR::IO& _io;
+
+       friend class MixerStrip;
+       boost::shared_ptr<ARDOUR::IO> _io;
        ARDOUR::Session& _session;
 
        bool ignore_toggle;
@@ -86,14 +87,34 @@ class GainMeter : public Gtk::VBox
        Gtk::Frame                   peak_display_frame;
        Gtk::EventBox                peak_display;
        Gtk::Label                   peak_display_label;
-       Gtk::Button                  gain_unit_button;
-       Gtk::Label                   gain_unit_label;
        Gtk::HBox                    gain_display_box;
        Gtk::HBox                    fader_box;
        Gtk::DrawingArea             meter_metric_area;
-       Gtk::Button                  meter_point_button;
-        Gtk::Label                   meter_point_label;
-       Gtk::Table                   top_table;
+
+       sigc::connection gain_watching;
+
+       Gtk::Button gain_automation_style_button;
+       Gtk::ToggleButton gain_automation_state_button;
+
+       Gtk::Menu gain_astate_menu;
+       Gtk::Menu gain_astyle_menu;
+
+       gint gain_automation_style_button_event (GdkEventButton *);
+       gint gain_automation_state_button_event (GdkEventButton *);
+       gint pan_automation_style_button_event (GdkEventButton *);
+       gint pan_automation_state_button_event (GdkEventButton *);
+
+       void gain_automation_state_changed();
+       void gain_automation_style_changed();
+
+       std::string astate_string (ARDOUR::AutoState);
+       std::string short_astate_string (ARDOUR::AutoState);
+       std::string _astate_string (ARDOUR::AutoState, bool);
+
+       std::string astyle_string (ARDOUR::AutoStyle);
+       std::string short_astyle_string (ARDOUR::AutoStyle);
+       std::string _astyle_string (ARDOUR::AutoStyle, bool);
+
        Width                       _width;
 
        static std::map<std::string,Glib::RefPtr<Gdk::Pixmap> > metric_pixmaps;
@@ -121,7 +142,7 @@ class GainMeter : public Gtk::VBox
        vector<MeterInfo>    meters;
        float       max_peak;
        
-
+       Gtk::VBox*   fader_vbox;
        Gtk::HBox   hbox;
        Gtk::HBox   meter_packer;
 
@@ -129,7 +150,6 @@ class GainMeter : public Gtk::VBox
        void gain_changed (void *);
        
        void meter_point_clicked ();
-       void meter_changed (void *);
        void gain_unit_changed ();
        
        void hide_all_meters ();
@@ -152,7 +172,7 @@ class GainMeter : public Gtk::VBox
        bool wait_for_release;
        ARDOUR::MeterPoint old_meter_point;
 
-       void meter_hold_changed();
+       void parameter_changed (const char*);
 
        void reset_peak_display ();
        void reset_group_peak_display (ARDOUR::RouteGroup*);