VBAP GUI depends on signal-position (not parameter changes)
[ardour.git] / gtk2_ardour / panner2d.cc
index ffe9a159542fc03040c7a89c13cddf998b031910..b822b5c381628693839bdd5515048822c627e39a 100644 (file)
@@ -77,8 +77,7 @@ Panner2d::Panner2d (boost::shared_ptr<PannerShell> p, int32_t h)
 {
        panner_shell->Changed.connect (connections, invalidator (*this), boost::bind (&Panner2d::handle_state_change, this), gui_context());
 
-        panner_shell->pannable()->pan_azimuth_control->Changed.connect (connections, invalidator(*this), boost::bind (&Panner2d::handle_position_change, this), gui_context());
-        panner_shell->pannable()->pan_width_control->Changed.connect (connections, invalidator(*this), boost::bind (&Panner2d::handle_position_change, this), gui_context());
+       panner_shell->panner()->SignalPositionChanged.connect (panconnect, invalidator(*this), boost::bind (&Panner2d::handle_position_change, this), gui_context());
 
        drag_target = 0;
        set_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK);
@@ -199,6 +198,8 @@ Panner2d::add_speaker (const AngularVector& a)
 void
 Panner2d::handle_state_change ()
 {
+       panconnect.drop_connections();
+       panner_shell->panner()->SignalPositionChanged.connect (panconnect, invalidator(*this), boost::bind (&Panner2d::handle_position_change, this), gui_context());
        queue_draw ();
 }
 
@@ -390,7 +391,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
 {
         CartesianVector c;
        cairo_t* cr;
-        bool small = (height <= large_size_threshold);
+        bool small_size = (height <= large_size_threshold);
         const double diameter = radius*2.0;
 
        cr = gdk_cairo_create (get_window()->gobj());
@@ -473,7 +474,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
 
                cairo_select_font_face (cr, "sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
 
-               if (small) {
+               if (small_size) {
                        arc_radius = 4.0;
                } else {
                        cairo_set_font_size (cr, 10);
@@ -498,10 +499,10 @@ Panner2d::on_expose_event (GdkEventExpose *event)
                                         cairo_set_source_rgba (cr, 0.517, 0.772, 0.882, 1.0);
                                         cairo_stroke (cr);
 
-                                        if (!small && !signal->text.empty()) {
+                                        if (!small_size && !signal->text.empty()) {
                                                 cairo_set_source_rgb (cr, 0.517, 0.772, 0.882);
                                                 /* the +/- adjustments are a hack to try to center the text in the circle */
-                                                if (small) {
+                                                if (small_size) {
                                                         cairo_move_to (cr, c.x - 1, c.y + 1);
                                                 } else {
                                                         cairo_move_to (cr, c.x - 4, c.y + 4);
@@ -535,7 +536,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
                                 cairo_move_to (cr, c.x, c.y);
                                 cairo_save (cr);
                                 cairo_rotate (cr, -(speaker->position.azi/360.0) * (2.0 * M_PI));
-                                if (small) {
+                                if (small_size) {
                                         cairo_scale (cr, 0.8, 0.8);
                                 } else {
                                         cairo_scale (cr, 1.2, 1.2);
@@ -553,7 +554,7 @@ Panner2d::on_expose_event (GdkEventExpose *event)
                                cairo_fill (cr);
                                 cairo_restore (cr);
 
-                                if (!small) {
+                                if (!small_size) {
                                         cairo_set_font_size (cr, 16);
 
                                         /* move the text in just a bit */
@@ -778,7 +779,7 @@ Panner2d::toggle_bypass ()
 }
 
 Panner2dWindow::Panner2dWindow (boost::shared_ptr<PannerShell> p, int32_t h, uint32_t inputs)
-       : ArdourDialog (_("Panner (2D)"))
+       : ArdourWindow (_("Panner (2D)"))
         , widget (p, h)
        , bypass_button (_("Bypass"))
 {
@@ -809,7 +810,7 @@ Panner2dWindow::Panner2dWindow (boost::shared_ptr<PannerShell> p, int32_t h, uin
        hpacker.pack_start (left_side, false, false);
        hpacker.show ();
 
-       get_vbox()->pack_start (hpacker);
+       add (hpacker);
        reset (inputs);
        widget.show ();
 }