13
0

triggerbox: defensive coding changes

This commit is contained in:
Ben Loftis 2022-01-16 10:56:45 -06:00
parent 869a862c86
commit 3e0bb03363

View File

@ -155,6 +155,10 @@ Trigger::will_not_follow () const
void void
Trigger::set_name (std::string const & str) Trigger::set_name (std::string const & str)
{ {
if (_name == str) {
return;
}
_name = str; _name = str;
PropertyChanged (Properties::name); PropertyChanged (Properties::name);
_box.session().set_dirty(); _box.session().set_dirty();
@ -163,6 +167,10 @@ Trigger::set_name (std::string const & str)
void void
Trigger::set_scene_isolated (bool i) Trigger::set_scene_isolated (bool i)
{ {
if (_isolated == i) {
return;
}
_isolated = i; _isolated = i;
PropertyChanged (ARDOUR::Properties::isolated); PropertyChanged (ARDOUR::Properties::isolated);
_box.session().set_dirty(); _box.session().set_dirty();
@ -171,6 +179,10 @@ Trigger::set_scene_isolated (bool i)
void void
Trigger::set_color (color_t c) Trigger::set_color (color_t c)
{ {
if (_color == c) {
return;
}
_color = c; _color = c;
PropertyChanged (ARDOUR::Properties::color); PropertyChanged (ARDOUR::Properties::color);
_box.session().set_dirty(); _box.session().set_dirty();
@ -179,6 +191,10 @@ Trigger::set_color (color_t c)
void void
Trigger::set_stretchable (bool s) Trigger::set_stretchable (bool s)
{ {
if (_stretchable == s) {
return;
}
_stretchable = s; _stretchable = s;
PropertyChanged (ARDOUR::Properties::stretchable); PropertyChanged (ARDOUR::Properties::stretchable);
_box.session().set_dirty(); _box.session().set_dirty();
@ -361,7 +377,14 @@ Trigger::set_state (const XMLNode& node, int version)
void void
Trigger::set_follow_length (Temporal::BBT_Offset const & bbo) Trigger::set_follow_length (Temporal::BBT_Offset const & bbo)
{ {
if (_use_follow_length == bbo) {
return;
}
_follow_length = bbo; _follow_length = bbo;
PropertyChanged (Properties::use_follow_length);
_box.session().set_dirty();
}
void void
Trigger::set_use_follow_length (bool ufl) Trigger::set_use_follow_length (bool ufl)
{ {
@ -376,6 +399,9 @@ Trigger::set_use_follow_length (bool ufl)
void void
Trigger::set_legato (bool yn) Trigger::set_legato (bool yn)
{ {
if (_legato == yn) {
return;
}
_legato = yn; _legato = yn;
PropertyChanged (Properties::legato); PropertyChanged (Properties::legato);
_box.session().set_dirty(); _box.session().set_dirty();
@ -2560,6 +2586,7 @@ TriggerBox::set_pass_thru (bool yn)
{ {
_requests.pass_thru = yn; _requests.pass_thru = yn;
PropertyChanged (Properties::passthru); PropertyChanged (Properties::passthru);
session().set_dirty();
} }
void void