projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
an awful lot of tweaks to drawing details
[ardour.git]
/
libs
/
gtkmm2ext
/
binding_proxy.cc
diff --git
a/libs/gtkmm2ext/binding_proxy.cc
b/libs/gtkmm2ext/binding_proxy.cc
index 90f95f82ef44b174d8241acc5ba477e91f357412..f12c64cf68973a0bf39a626ee5167abdb2c60a8a 100644
(file)
--- a/
libs/gtkmm2ext/binding_proxy.cc
+++ b/
libs/gtkmm2ext/binding_proxy.cc
@@
-31,7
+31,7
@@
using namespace Gtkmm2ext;
using namespace std;
using namespace PBD;
using namespace std;
using namespace PBD;
-BindingProxy::BindingProxy (
Controllable&
c)
+BindingProxy::BindingProxy (
boost::shared_ptr<Controllable>
c)
: prompter (0),
controllable (c),
bind_button (2),
: prompter (0),
controllable (c),
bind_button (2),
@@
-40,6
+40,14
@@
BindingProxy::BindingProxy (Controllable& c)
{
}
{
}
+BindingProxy::BindingProxy ()
+ : prompter (0),
+ bind_button (2),
+ bind_statemask (Gdk::CONTROL_MASK)
+
+{
+}
+
BindingProxy::~BindingProxy ()
{
if (prompter) {
BindingProxy::~BindingProxy ()
{
if (prompter) {
@@
-47,6
+55,13
@@
BindingProxy::~BindingProxy ()
}
}
}
}
+void
+BindingProxy::set_controllable (boost::shared_ptr<Controllable> c)
+{
+ learning_finished ();
+ controllable = c;
+}
+
void
BindingProxy::set_bind_button_state (guint button, guint statemask)
{
void
BindingProxy::set_bind_button_state (guint button, guint statemask)
{
@@
-64,8
+79,8
@@
BindingProxy::get_bind_button_state (guint &button, guint &statemask)
bool
BindingProxy::button_press_handler (GdkEventButton *ev)
{
bool
BindingProxy::button_press_handler (GdkEventButton *ev)
{
- if ((ev->state & bind_statemask) && ev->button == bind_button) {
- if (Controllable::StartLearning (
&controllable
)) {
+ if (
controllable &&
(ev->state & bind_statemask) && ev->button == bind_button) {
+ if (Controllable::StartLearning (
controllable.get()
)) {
string prompt = _("operate controller now");
if (prompter == 0) {
prompter = new PopUp (Gtk::WIN_POS_MOUSE, 30000, false);
string prompt = _("operate controller now");
if (prompter == 0) {
prompter = new PopUp (Gtk::WIN_POS_MOUSE, 30000, false);
@@
-73,7
+88,7
@@
BindingProxy::button_press_handler (GdkEventButton *ev)
}
prompter->set_text (prompt);
prompter->touch (); // shows popup
}
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;
}
}
return true;
}
@@
-92,10
+107,12
@@
BindingProxy::learning_finished ()
bool
bool
-BindingProxy::prompter_hiding (GdkEventAny *
ev
)
+BindingProxy::prompter_hiding (GdkEventAny *
/*ev*/
)
{
learning_connection.disconnect ();
{
learning_connection.disconnect ();
- Controllable::StopLearning (&controllable);
+ if (controllable) {
+ Controllable::StopLearning (controllable.get());
+ }
return false;
}
return false;
}