Allow the region gain automation tool to create standard automation events. Fixes...
authorCarl Hetherington <carl@carlh.net>
Thu, 27 May 2010 01:08:37 +0000 (01:08 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 27 May 2010 01:08:37 +0000 (01:08 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7173 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_mouse.cc

index 217983a2ed1376a5b5fa1f5bdc6dbfcedbf739b9..0d6cf7b79f8ae885cb9aea386b82c089545f3582 100644 (file)
@@ -1295,23 +1295,20 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
                        break;
 
                case MouseGain:
-                       // Gain only makes sense for audio regions
-
-                       if (!dynamic_cast<AudioRegionView*>(clicked_regionview)) {
-                               break;
-                       }
-
                        switch (item_type) {
                        case RegionItem:
+                       {
                                /* check that we didn't drag before releasing, since
                                   its really annoying to create new control
                                   points when doing this.
                                */
-                               if (were_dragging) {
-                                       dynamic_cast<AudioRegionView*>(clicked_regionview)->add_gain_point_event (item, event);
+                               AudioRegionView* arv = dynamic_cast<AudioRegionView*> (clicked_regionview);
+                               if (were_dragging && arv) {
+                                       arv->add_gain_point_event (item, event);
                                }
                                return true;
                                break;
+                       }
 
                        case AutomationTrackItem:
                                dynamic_cast<AutomationTimeAxisView*>(clicked_axisview)->