mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
triggerbox UI: clean up class heirachy for *TriggerPropertiesBox and catch trigger swaps
This commit is contained in:
parent
4be38042a2
commit
e3293db126
5 changed files with 45 additions and 26 deletions
|
|
@ -44,6 +44,35 @@ using namespace ArdourWidgets;
|
|||
using std::max;
|
||||
using std::min;
|
||||
|
||||
void
|
||||
TriggerPropertiesBox::set_trigger (TriggerReference tr)
|
||||
{
|
||||
tref = tr;
|
||||
tref.trigger()->PropertyChanged.connect (_state_connection, invalidator (*this), boost::bind (&TriggerPropertiesBox::trigger_changed, this, _1), gui_context ());
|
||||
tref.box->TriggerSwapped.connect (trigger_swap_connection, MISSING_INVALIDATOR, boost::bind (&TriggerPropertiesBox::trigger_swap, this, _1), gui_context ());
|
||||
|
||||
PBD::PropertyChange changed;
|
||||
changed.add (ARDOUR::Properties::name);
|
||||
changed.add (ARDOUR::Properties::running);
|
||||
trigger_changed (changed);
|
||||
}
|
||||
|
||||
void
|
||||
TriggerPropertiesBox::trigger_swap (uint32_t n)
|
||||
{
|
||||
if (n != tref.slot) {
|
||||
/* some other slot in the same box got swapped. we don't care */
|
||||
return;
|
||||
}
|
||||
_state_connection.disconnect ();
|
||||
tref.trigger()->PropertyChanged.connect (_state_connection, invalidator (*this), boost::bind (&TriggerPropertiesBox::trigger_changed, this, _1), gui_context ());
|
||||
|
||||
PBD::PropertyChange changed;
|
||||
changed.add (ARDOUR::Properties::name);
|
||||
changed.add (ARDOUR::Properties::running);
|
||||
trigger_changed (changed);
|
||||
}
|
||||
|
||||
AudioTriggerPropertiesBox::AudioTriggerPropertiesBox ()
|
||||
: _length_clock (X_("regionlength"), true, "", true, false, true)
|
||||
, _start_clock (X_("regionstart"), true, "", false, false)
|
||||
|
|
@ -179,13 +208,7 @@ AudioTriggerPropertiesBox::set_trigger (ARDOUR::TriggerReference tr)
|
|||
return;
|
||||
}
|
||||
|
||||
tref = tr;
|
||||
tref.trigger()->PropertyChanged.connect (_state_connection, invalidator (*this), boost::bind (&AudioTriggerPropertiesBox::trigger_changed, this, _1), gui_context ());
|
||||
|
||||
PBD::PropertyChange changed;
|
||||
changed.add (ARDOUR::Properties::name);
|
||||
changed.add (ARDOUR::Properties::running);
|
||||
trigger_changed (changed);
|
||||
TriggerPropertiesBox::set_trigger (tr);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue