summaryrefslogtreecommitdiff
path: root/libs/ardour/pan_controllable.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-09-20 19:40:29 +0200
committerRobin Gareus <robin@gareus.org>2019-09-20 19:41:06 +0200
commit3f9d79e7abb0c2ef12992573853554729a021b26 (patch)
tree5bf3cd8aeaa82ebcb02c6bd578b5b289bb5befcc /libs/ardour/pan_controllable.cc
parent467795f46747396edddae9fd5e9d531304d14c00 (diff)
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).
Diffstat (limited to 'libs/ardour/pan_controllable.cc')
-rw-r--r--libs/ardour/pan_controllable.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/ardour/pan_controllable.cc b/libs/ardour/pan_controllable.cc
index 3b45622b08..5b257158fe 100644
--- a/libs/ardour/pan_controllable.cc
+++ b/libs/ardour/pan_controllable.cc
@@ -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()));
}