Use weak-pointer for Controllable learning
This commit is contained in:
parent
1dedadd03f
commit
16fe286ed9
@ -30,8 +30,8 @@ using namespace PBD;
|
||||
using namespace std;
|
||||
|
||||
PBD::Signal1<void,Controllable*> Controllable::Destroyed;
|
||||
PBD::Signal1<bool,Controllable*> Controllable::StartLearning;
|
||||
PBD::Signal1<void,Controllable*> Controllable::StopLearning;
|
||||
PBD::Signal1<bool, boost::weak_ptr<PBD::Controllable> > Controllable::StartLearning;
|
||||
PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > Controllable::StopLearning;
|
||||
PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > Controllable::GUIFocusChanged;
|
||||
|
||||
const std::string Controllable::xml_node_name = X_("Controllable");
|
||||
|
@ -123,8 +123,8 @@ public:
|
||||
|
||||
PBD::Signal0<void> LearningFinished;
|
||||
|
||||
static PBD::Signal1<bool,PBD::Controllable*> StartLearning;
|
||||
static PBD::Signal1<void,PBD::Controllable*> StopLearning;
|
||||
static PBD::Signal1<bool, boost::weak_ptr<PBD::Controllable> > StartLearning;
|
||||
static PBD::Signal1<void, boost::weak_ptr<PBD::Controllable> > StopLearning;
|
||||
|
||||
static PBD::Signal1<void,Controllable*> Destroyed;
|
||||
|
||||
|
@ -91,7 +91,7 @@ bool
|
||||
BindingProxy::button_press_handler (GdkEventButton *ev)
|
||||
{
|
||||
if ( controllable && is_bind_action(ev) ) {
|
||||
if (Controllable::StartLearning (controllable.get())) {
|
||||
if (Controllable::StartLearning (controllable)) {
|
||||
string prompt = _("operate controller now");
|
||||
if (prompter == 0) {
|
||||
prompter = new PopUp (Gtk::WIN_POS_MOUSE, 30000, false);
|
||||
@ -121,7 +121,7 @@ BindingProxy::prompter_hiding (GdkEventAny* /*ev*/)
|
||||
{
|
||||
learning_connection.disconnect ();
|
||||
if (controllable) {
|
||||
Controllable::StopLearning (controllable.get());
|
||||
Controllable::StopLearning (controllable);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user