MCP: a fistful of improvements. probably best to just try it and see what it broken...
[ardour.git] / libs / surfaces / mackie / controls.cc
index 29d8d165ce106310ea75625ce0cd2b2eb1896cdb..e5b8a28ab76ad78252f6f30de22c45331ef2722d 100644 (file)
@@ -92,24 +92,33 @@ Control::set_control (boost::shared_ptr<AutomationControl> ac)
 void
 Control::set_value (float val)
 {
-       normal_ac->set_value (normal_ac->interface_to_internal (val));
+       if (normal_ac) {
+               normal_ac->set_value (normal_ac->interface_to_internal (val));
+       }
 }
 
 float
 Control::get_value ()
 {
+       if (!normal_ac) {
+               return 0.0f;
+       }
        return normal_ac->internal_to_interface (normal_ac->get_value());
 }
 
 void
 Control::start_touch (double when)
 {
-       return normal_ac->start_touch (when);
+       if (normal_ac) {
+               return normal_ac->start_touch (when);
+       }
 }
        
 void
 Control::stop_touch (double when, bool mark)
 {
-       return normal_ac->stop_touch (when, mark);
+       if (normal_ac) {
+               return normal_ac->stop_touch (when, mark);
+       }
 }