Fix state setting in the port matrix, broken a few commits ago.
authorCarl Hetherington <carl@carlh.net>
Sat, 24 Jan 2009 01:17:26 +0000 (01:17 +0000)
committerCarl Hetherington <carl@carlh.net>
Sat, 24 Jan 2009 01:17:26 +0000 (01:17 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4436 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/port_matrix_grid.cc

index e202332d861dd66e8f33dae5180aea2bb7e3a13a..13e1dcf4c200fac8980fa6cfac5c1a8dc8c77c11 100644 (file)
@@ -194,16 +194,22 @@ PortMatrixGrid::button_press (double x, double y, int b)
                }
        }
 
+       
        if (our_bundle && other_bundle) {
                
-               bool const s = _port_matrix->get_state (
+               PortMatrix::State const s = _port_matrix->get_state (
                        our_bundle, our_channel, other_bundle, other_channel
                        );
                                
+               if (s == PortMatrix::ASSOCIATED || s == PortMatrix::NOT_ASSOCIATED) {
+
+                       bool const n = !(s == PortMatrix::ASSOCIATED);
+                       
                _port_matrix->set_state (
                        our_bundle, our_channel, other_bundle, other_channel,
-                       !s, 0
+                               n, 0
                        );
+               }
 
                require_render ();
                _body->queue_draw ();