diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-23 19:12:26 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-23 19:12:26 +0100 |
commit | bf649cd68ad46c34a656700aa6cb89416d648c64 (patch) | |
tree | 08d9beb2a71ed72155297081b38cfe8c13b2d608 /libs | |
parent | 8b092f86586d7aa835bfb2c7931f0b916109ab30 (diff) |
Fix another websocket surface crash when no panner is available
This amends 224be91211
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/websockets/strips.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/surfaces/websockets/strips.cc b/libs/surfaces/websockets/strips.cc index 4c73a4e00b..e80d8af5d7 100644 --- a/libs/surfaces/websockets/strips.cc +++ b/libs/surfaces/websockets/strips.cc @@ -85,17 +85,23 @@ ArdourStrips::set_strip_gain (uint32_t strip_n, double db) double ArdourStrips::strip_pan (uint32_t strip_n) const { + boost::shared_ptr<AutomationControl> ac = nth_strip (strip_n)->pan_azimuth_control (); + if (!ac) { + /* TODO: inform GUI that strip has no panner */ + return 0; + } /* scale from [0.0 ; 1.0] to [-1.0 ; 1.0] */ - return 2.0 * nth_strip (strip_n)->pan_azimuth_control ()->get_value () - 1.0; + return 2.0 * ac->get_value () - 1.0; //TODO: prefer ac->internal_to_interface (c->get_value ()); } void ArdourStrips::set_strip_pan (uint32_t strip_n, double value) { - boost::shared_ptr<AutomationControl> ac = nth_strip (strip_n)->pan_azimuth_control (); + boost::shared_ptr<AutomationControl> ac = nth_strip (strip_n)->pan_azimuth_control (); if (!ac) { return; } + /* TODO: prefer ac->set_value (ac->interface_to_internal (value), NoGroup); */ value = (value + 1.0) / 2.0; ac->set_value (value, PBD::Controllable::NoGroup); } |