Handle an unused edge-case

In practice PanControllable::owner cannot be NULL, but in theory it
could be (and might be for Mixbus6 internal panning).
This commit is contained in:
Robin Gareus
2019-09-20 19:40:29 +02:00
parent 467795f467
commit 3f9d79e7ab

View File

@@ -58,5 +58,12 @@ PanControllable::actually_set_value (double v, Controllable::GroupControlDisposi
std::string
PanControllable::get_user_string () const
{
if (!owner) {
/* assume PanAzimuthAutomation, 0..1 */
float v = get_value ();
char buf[32];
snprintf(buf, sizeof(buf), "%.0f%%", 100.f * v);
return buf;
}
return owner->value_as_string (boost::dynamic_pointer_cast<const AutomationControl>(shared_from_this()));
}