notably modify the design and logic of the startup dialog, so that we can handle...
[ardour.git] / gtk2_ardour / level_meter.h
index ce0aa125cbbd668185fce9433cca4fdc74d00ea7..0e51758858e33fa897fe8e9e30521952b4cc313d 100644 (file)
@@ -21,7 +21,6 @@
 #define __ardour_gtk_track_meter_h__
 
 #include <vector>
-#include <map>
 
 #include <gtkmm/box.h>
 #include <gtkmm/adjustment.h>
@@ -31,7 +30,9 @@
 #include <gtkmm/table.h>
 #include <gtkmm/drawingarea.h>
 
-#include <ardour/types.h>
+#include "ardour/types.h"
+#include "ardour/chan_count.h"
+#include "ardour/session_handle.h"
 
 #include <gtkmm2ext/click_box.h>
 #include <gtkmm2ext/focus_entry.h>
 #include "enums.h"
 
 namespace ARDOUR {
-       class IO;
        class Session;
-       class Route;
-       class RouteGroup;
+       class PeakMeter;
 }
 namespace Gtkmm2ext {
        class FastMeter;
-       class BarController;
 }
 namespace Gtk {
        class Menu;
 }
 
-class LevelMeter : public Gtk::HBox
+class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
 {
   public:
-       LevelMeter (boost::shared_ptr<ARDOUR::IO>, ARDOUR::Session&);
+       LevelMeter (ARDOUR::Session*);
        ~LevelMeter ();
 
+       virtual void set_meter (ARDOUR::PeakMeter* meter);
+
        void update_gain_sensitive ();
 
        float update_meters ();
@@ -67,37 +67,43 @@ class LevelMeter : public Gtk::HBox
        void hide_meters ();
        void setup_meters (int len=0, int width=3);
 
-  private:
+       /** Emitted in the GUI thread when a button is pressed over the meter */
+       PBD::Signal1<bool, GdkEventButton *> ButtonPress;
 
-       //friend class MixerStrip;
-       boost::shared_ptr<ARDOUR::IO> _io;
-       ARDOUR::Session& _session;
+  private:
+       ARDOUR::PeakMeter* _meter;
 
        Width _width;
 
        struct MeterInfo {
            Gtkmm2ext::FastMeter *meter;
-           gint16          width;
-               int                             length;   
-           bool            packed;
-           
-           MeterInfo() { 
+           gint16                width;
+            int                          length;
+           bool                  packed;
+
+           MeterInfo() {
                    meter = 0;
                    width = 0;
-                       length = 0;
+                    length = 0;
                    packed = false;
            }
        };
 
-       guint16 regular_meter_width;
-       static const guint16 thin_meter_width = 2;
-       vector<MeterInfo>    meters;
-       float       max_peak;
-       
+       guint16                regular_meter_width;
+       int                    meter_length;
+       static const guint16   thin_meter_width = 2;
+       std::vector<MeterInfo> meters;
+       float                  max_peak;
+
+       PBD::ScopedConnection _configuration_connection;
+       PBD::ScopedConnection _parameter_connection;
+
        void hide_all_meters ();
-       gint meter_button_release (GdkEventButton*, uint32_t);
+       bool meter_button_press (GdkEventButton *);
+       bool meter_button_release (GdkEventButton *);
 
-       void parameter_changed (const char*);
+       void parameter_changed (std::string);
+       void configuration_changed (ARDOUR::ChanCount in, ARDOUR::ChanCount out);
 
        void on_theme_changed ();
        bool style_changed;