Add code to use ASIO supplied min/max buffer sizes but don't use it
[ardour.git] / libs / gtkmm2ext / binding_proxy.cc
index 845146239dc4ae56a08301a6166f5c113bf02948..bf21c19bce983532aa575dd18bd57a814b581bd5 100644 (file)
@@ -31,20 +31,17 @@ using namespace Gtkmm2ext;
 using namespace std;
 using namespace PBD;
 
+guint BindingProxy::bind_button = 2;
+guint BindingProxy::bind_statemask = Gdk::CONTROL_MASK;
+
 BindingProxy::BindingProxy (boost::shared_ptr<Controllable> c)
        : prompter (0),
-         controllable (c),
-         bind_button (2),
-         bind_statemask (Gdk::CONTROL_MASK)
-
+         controllable (c)
 {                        
 }
 
 BindingProxy::BindingProxy ()
-       : prompter (0),
-         bind_button (2),
-         bind_statemask (Gdk::CONTROL_MASK)
-
+       : prompter (0)
 {                        
 }
 
@@ -69,17 +66,17 @@ BindingProxy::set_bind_button_state (guint button, guint statemask)
        bind_statemask = statemask;
 }
 
-void
-BindingProxy::get_bind_button_state (guint &button, guint &statemask)
+bool
+BindingProxy::is_bind_action (GdkEventButton *ev)
 {
-       button = bind_button;
-       statemask = bind_statemask;
+       return ( (ev->state & bind_statemask) && ev->button == bind_button );
 }
 
+
 bool
 BindingProxy::button_press_handler (GdkEventButton *ev)
 {
-       if (controllable && (ev->state & bind_statemask) && ev->button == bind_button) { 
+       if ( controllable && is_bind_action(ev) ) { 
                if (Controllable::StartLearning (controllable.get())) {
                        string prompt = _("operate controller now");
                        if (prompter == 0) {
@@ -88,7 +85,7 @@ BindingProxy::button_press_handler (GdkEventButton *ev)
                        }
                        prompter->set_text (prompt);
                        prompter->touch (); // shows popup
-                       learning_connection = controllable->LearningFinished.connect (mem_fun (*this, &BindingProxy::learning_finished));
+                       controllable->LearningFinished.connect_same_thread (learning_connection, boost::bind (&BindingProxy::learning_finished, this));
                }
                return true;
        }
@@ -107,7 +104,7 @@ BindingProxy::learning_finished ()
 
 
 bool
-BindingProxy::prompter_hiding (GdkEventAny *ev)
+BindingProxy::prompter_hiding (GdkEventAny* /*ev*/)
 {
        learning_connection.disconnect ();
        if (controllable) {