mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Binding Proxy: Drop references as requested.
This commit is contained in:
parent
6f80a5ba0f
commit
edcfa23e14
2 changed files with 16 additions and 0 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "pbd/controllable.h"
|
#include "pbd/controllable.h"
|
||||||
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/keyboard.h"
|
#include "gtkmm2ext/keyboard.h"
|
||||||
#include "widgets/binding_proxy.h"
|
#include "widgets/binding_proxy.h"
|
||||||
#include "widgets/popup.h"
|
#include "widgets/popup.h"
|
||||||
|
|
@ -38,6 +39,12 @@ BindingProxy::BindingProxy (boost::shared_ptr<Controllable> c)
|
||||||
: prompter (0),
|
: prompter (0),
|
||||||
controllable (c)
|
controllable (c)
|
||||||
{
|
{
|
||||||
|
if (c) {
|
||||||
|
c->DropReferences.connect (
|
||||||
|
_controllable_going_away_connection, invalidator (*this),
|
||||||
|
boost::bind (&BindingProxy::set_controllable, this, boost::shared_ptr<Controllable> ()),
|
||||||
|
gui_context());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BindingProxy::BindingProxy ()
|
BindingProxy::BindingProxy ()
|
||||||
|
|
@ -57,6 +64,14 @@ BindingProxy::set_controllable (boost::shared_ptr<Controllable> c)
|
||||||
{
|
{
|
||||||
learning_finished ();
|
learning_finished ();
|
||||||
controllable = c;
|
controllable = c;
|
||||||
|
|
||||||
|
_controllable_going_away_connection.disconnect ();
|
||||||
|
if (c) {
|
||||||
|
c->DropReferences.connect (
|
||||||
|
_controllable_going_away_connection, invalidator (*this),
|
||||||
|
boost::bind (&BindingProxy::set_controllable, this, boost::shared_ptr<Controllable> ()),
|
||||||
|
gui_context());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ protected:
|
||||||
static guint bind_statemask;
|
static guint bind_statemask;
|
||||||
|
|
||||||
PBD::ScopedConnection learning_connection;
|
PBD::ScopedConnection learning_connection;
|
||||||
|
PBD::ScopedConnection _controllable_going_away_connection;
|
||||||
void learning_finished ();
|
void learning_finished ();
|
||||||
bool prompter_hiding (GdkEventAny *);
|
bool prompter_hiding (GdkEventAny *);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue