summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_routes.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-02 08:42:58 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-02 08:42:58 -0400
commit6baac7d46f95cfe94eb1a67f64a2a68f0cf4552d (patch)
tree81c71bbffc6a47350725b670022863ec759a4763 /gtk2_ardour/editor_routes.cc
parent3835b782b370940ba1c96bcb212338e86e30e590 (diff)
various safety checks for the result of dynamic_cast-ing a TimeAxisView to RouteTimeAxisView
Now that we have VCATimeAxisView, this needed to be done, but it also potentially applied with automation
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r--gtk2_ardour/editor_routes.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 70d8887204..0fbc0db5b2 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -425,6 +425,11 @@ EditorRoutes::on_tv_rec_enable_changed (std::string const & path_string)
TimeAxisView* tv = row[_columns.tv];
RouteTimeAxisView *rtv = dynamic_cast<RouteTimeAxisView*> (tv);
+
+ if (!rtv) {
+ return;
+ }
+
boost::shared_ptr<AutomationControl> ac = rtv->route()->rec_enable_control();
if (ac) {
@@ -438,6 +443,11 @@ EditorRoutes::on_tv_rec_safe_toggled (std::string const & path_string)
Gtk::TreeModel::Row row = *_model->get_iter (Gtk::TreeModel::Path (path_string));
TimeAxisView* tv = row[_columns.tv];
RouteTimeAxisView *rtv = dynamic_cast<RouteTimeAxisView*> (tv);
+
+ if (!rtv) {
+ return;
+ }
+
boost::shared_ptr<AutomationControl> ac (rtv->route()->rec_safe_control());
if (ac) {
@@ -453,6 +463,11 @@ EditorRoutes::on_tv_mute_enable_toggled (std::string const & path_string)
TimeAxisView *tv = row[_columns.tv];
RouteTimeAxisView *rtv = dynamic_cast<RouteTimeAxisView*> (tv);
+
+ if (!rtv) {
+ return;
+ }
+
boost::shared_ptr<AutomationControl> ac (rtv->route()->mute_control());
if (ac) {
@@ -468,6 +483,11 @@ EditorRoutes::on_tv_solo_enable_toggled (std::string const & path_string)
TimeAxisView *tv = row[_columns.tv];
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
+
+ if (!rtv) {
+ return;
+ }
+
boost::shared_ptr<AutomationControl> ac (rtv->route()->solo_control());
if (ac) {
@@ -483,6 +503,11 @@ EditorRoutes::on_tv_solo_isolate_toggled (std::string const & path_string)
TimeAxisView *tv = row[_columns.tv];
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
+
+ if (!rtv) {
+ return;
+ }
+
boost::shared_ptr<AutomationControl> ac (rtv->route()->solo_isolate_control());
if (ac) {
@@ -498,6 +523,11 @@ EditorRoutes::on_tv_solo_safe_toggled (std::string const & path_string)
TimeAxisView *tv = row[_columns.tv];
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv);
+
+ if (!rtv) {
+ return;
+ }
+
boost::shared_ptr<AutomationControl> ac (rtv->route()->solo_safe_control());
if (ac) {