Only show user-presets in favorite sidebar
[ardour.git] / gtk2_ardour / panner2d.h
index 881638856f9f8ee5279b88bc0d28a310905e0fd4..f3077187aba4b38c3431a1c1e3a36d467a3aba6b 100644 (file)
@@ -46,14 +46,14 @@ namespace Gtk {
 }
 
 namespace Pango {
-       class Layout;
+       class Container;
 }
 
 class Panner2dWindow;
 
 class Panner2d : public Gtk::DrawingArea
 {
-  public:
+       public:
        Panner2d (boost::shared_ptr<ARDOUR::PannerShell>, int32_t height);
        ~Panner2d ();
 
@@ -63,16 +63,14 @@ class Panner2d : public Gtk::DrawingArea
        int  add_signal (const char* text, const PBD::AngularVector&);
        void move_signal (int which, const PBD::AngularVector&);
        void reset (uint32_t n_inputs);
+       void set_send_drawing_mode (bool);
 
        boost::shared_ptr<ARDOUR::PannerShell> get_panner_shell() const { return panner_shell; }
 
-       sigc::signal<void,int> PuckMoved;
-       sigc::signal<void,int> TargetMoved;
-
        void cart_to_gtk (PBD::CartesianVector&) const;
        void gtk_to_cart (PBD::CartesianVector&) const;
 
-  protected:
+       protected:
        bool on_expose_event (GdkEventExpose *);
        bool on_button_press_event (GdkEventButton *);
        bool on_button_release_event (GdkEventButton *);
@@ -80,9 +78,9 @@ class Panner2d : public Gtk::DrawingArea
        bool on_scroll_event (GdkEventScroll *);
        void on_size_allocate (Gtk::Allocation& alloc);
 
-  private:
+       private:
        class Target {
-       public:
+               public:
                PBD::AngularVector position;
                bool visible;
                std::string text;
@@ -98,33 +96,49 @@ class Panner2d : public Gtk::DrawingArea
                        return _selected;
                }
 
-       private:
+               private:
                bool _selected;
        };
 
+       struct ColorScheme {
+               uint32_t background;
+               uint32_t crosshairs;
+               uint32_t signalcircle_border;
+               uint32_t signalcircle;
+               uint32_t diffusion;
+               uint32_t diffusion_inv;
+               uint32_t pos_outline;
+               uint32_t pos_fill;
+               uint32_t signal_outline;
+               uint32_t signal_fill;
+               uint32_t speaker_fill;
+               uint32_t text;
+       };
+
+       static ColorScheme colors;
+       static void set_colors ();
+       static bool have_colors;
+       void color_handler ();
+
        boost::shared_ptr<ARDOUR::PannerShell> panner_shell;
        Glib::RefPtr<Pango::Layout> layout;
 
        typedef std::vector<Target*> Targets;
        Targets speakers;
        Targets signals;
-        Target  position;
+       Target  position;
 
        Target *drag_target;
-       int     drag_x;
-       int     drag_y;
-       bool    allow_speaker_motion;
        int     width;
        int     height;
-        double  radius;
-        double  border;
-        double  hoffset;
-        double  voffset;
-        double  last_width;
+       double  radius;
+       double  border;
+       double  hoffset;
+       double  voffset;
+       double  last_width;
        bool    did_move;
-
-       gint compute_x (float);
-       gint compute_y (float);
+       bool    have_elevation;
+       bool    _send_mode;
 
        Target *find_closest_object (gdouble x, gdouble y, bool& is_signal);
 
@@ -133,24 +147,26 @@ class Panner2d : public Gtk::DrawingArea
        void toggle_bypass ();
        void handle_state_change ();
        void handle_position_change ();
-        void label_signals ();
+       void label_signals ();
 
-       PBD::ScopedConnectionList connections;
+       PBD::ScopedConnectionList panshell_connections;
+       PBD::ScopedConnectionList panner_connections;
 
        /* cartesian coordinates in GTK units ; adjust to same but on a circle of radius 1.0
           and centered in the middle of our area
        */
        void clamp_to_circle (double& x, double& y);
+       void sphere_project (double& x, double& y, double& z);
 };
 
 class Panner2dWindow : public ArdourWindow
 {
-  public:
+       public:
        Panner2dWindow (boost::shared_ptr<ARDOUR::PannerShell>, int32_t height, uint32_t inputs);
 
        void reset (uint32_t n_inputs);
 
-  private:
+       private:
        Panner2d widget;
 
        Gtk::HBox         hpacker;
@@ -159,11 +175,19 @@ class Panner2dWindow : public ArdourWindow
        Gtk::VBox         spinner_box;
        Gtk::VBox         left_side;
 
-       std::vector<Gtk::SpinButton*> spinners;
+       Gtk::Adjustment   width_adjustment;
+       Gtk::SpinButton   width_spinner;
+
+       PBD::ScopedConnectionList panshell_connections;
+       PBD::ScopedConnectionList panvalue_connections;
+       void set_bypassed();
+       void set_width();
 
-        void bypass_toggled ();
-        bool on_key_press_event (GdkEventKey*);
-        bool on_key_release_event (GdkEventKey*);
+       void pannable_handler ();
+       void bypass_toggled ();
+       void width_changed ();
+       bool on_key_press_event (GdkEventKey*);
+       bool on_key_release_event (GdkEventKey*);
 };
 
 #endif /* __ardour_panner_2d_h__ */