code cleanup; crossfade shape drawing is now more closely associated with the fade...
authorBen Loftis <ben@glw.com>
Fri, 14 Dec 2012 17:21:44 +0000 (17:21 +0000)
committerBen Loftis <ben@glw.com>
Fri, 14 Dec 2012 17:21:44 +0000 (17:21 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13669 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_region_view.cc
gtk2_ardour/audio_region_view.h
gtk2_ardour/editor_drag.cc
gtk2_ardour/session_option_editor.cc

index b1ffbd7d4b3c009d30565e7af6897ce74db157d8..26bcad68f85cf8310fd9d6453e7619df89684072 100644 (file)
@@ -522,14 +522,12 @@ AudioRegionView::reset_fade_shapes ()
 void
 AudioRegionView::reset_fade_in_shape ()
 {
-       reset_fade_in_shape_width ((framecnt_t) audio_region()->fade_in()->back()->when);
+       reset_fade_in_shape_width (audio_region(), (framecnt_t) audio_region()->fade_in()->back()->when);
 }
 
 void
-AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
+AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
 {
-       redraw_start_xfade ();
-
        if (fade_in_handle == 0) {
                return;
        }
@@ -602,19 +600,20 @@ AudioRegionView::reset_fade_in_shape_width (framecnt_t width)
        if (frame_handle_start) {
                frame_handle_start->raise_to_top();
        }
+
+       redraw_start_xfade_to ( ar, width);
+
 }
 
 void
 AudioRegionView::reset_fade_out_shape ()
 {
-       reset_fade_out_shape_width ((framecnt_t) audio_region()->fade_out()->back()->when);
+       reset_fade_out_shape_width (audio_region(), (framecnt_t) audio_region()->fade_out()->back()->when);
 }
 
 void
-AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
+AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
 {
-       redraw_end_xfade ();
-
        if (fade_out_handle == 0) {
                return;
        }
@@ -691,6 +690,8 @@ AudioRegionView::reset_fade_out_shape_width (framecnt_t width)
        if (frame_handle_end) {
                frame_handle_end->raise_to_top();
        }
+
+       redraw_end_xfade_to (ar, width);
 }
 
 framepos_t
@@ -1411,7 +1412,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
        if (!start_xfade_out) {
                start_xfade_out = new ArdourCanvas::Line (*group);
                start_xfade_out->property_width_pixels() = 1;
-               uint32_t col = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 255);
+               uint32_t col = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 128);
                start_xfade_out->property_fill_color_rgba() = col;
        }
 
@@ -1519,7 +1520,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
        if (!end_xfade_out) {
                end_xfade_out = new ArdourCanvas::Line (*group);
                end_xfade_out->property_width_pixels() = 1;
-               uint32_t col UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 255);
+               uint32_t col UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 128);
                end_xfade_out->property_fill_color_rgba() = col;
        }
 
index 6f6d76d06b4e0ea55c471170317a5adc31468223..10159d0cfbf6970716051d7952ebf3ae803d033f 100644 (file)
@@ -91,8 +91,8 @@ class AudioRegionView : public RegionView
 
        GhostRegion* add_ghost (TimeAxisView&);
 
-       void reset_fade_in_shape_width (framecnt_t);
-       void reset_fade_out_shape_width (framecnt_t);
+       void reset_fade_in_shape_width (boost::shared_ptr<ARDOUR::AudioRegion> ar, framecnt_t);
+       void reset_fade_out_shape_width (boost::shared_ptr<ARDOUR::AudioRegion> ar, framecnt_t);
 
        framepos_t get_fade_in_shape_width ();
        framepos_t get_fade_out_shape_width ();
index 6db252c2d0519dae3cdf15ad15fbfd13ff55e6d7..a8e9a78dc5f1ebc95a07b65506f2337297329a63 100644 (file)
@@ -1735,8 +1735,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
                                        len = ar->fade_in()->back()->when;
                                        new_length = len - _editor->unit_to_frame (distance);
                                        new_length = ar->verify_xfade_bounds (new_length, true  /*START*/ );
-                                       arv->reset_fade_in_shape_width (new_length);  //the grey shape
-                                       arv->redraw_start_xfade_to (ar, new_length);  //the green lines & blue rect
+                                       arv->reset_fade_in_shape_width (ar, new_length);  //the grey shape
                                }
                        }
                }
@@ -1756,8 +1755,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move)
                                        len = ar->fade_out()->back()->when;
                                        new_length = len - _editor->unit_to_frame (distance);
                                        new_length = ar->verify_xfade_bounds (new_length, false  /*END*/ );
-                                       arv->reset_fade_out_shape_width (new_length);  //the grey shape
-                                       arv->redraw_end_xfade_to (ar, new_length);  //the green lines & blue rect (must do this after)
+                                       arv->reset_fade_out_shape_width (ar, new_length);  //the grey shape
                                }
                        }
                }
@@ -2349,9 +2347,7 @@ FadeInDrag::motion (GdkEvent* event, bool)
                        continue;
                }
 
-               tmp->reset_fade_in_shape_width (fade_length);
-               boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
-               tmp->redraw_start_xfade_to (ar, fade_length);
+               tmp->reset_fade_in_shape_width (tmp->audio_region(), fade_length);
        }
 
        show_verbose_cursor_duration (region->position(), region->position() + fade_length, 32);
@@ -2411,7 +2407,7 @@ FadeInDrag::aborted (bool)
                        continue;
                }
 
-               tmp->reset_fade_in_shape_width (tmp->audio_region()->fade_in()->back()->when);
+               tmp->reset_fade_in_shape_width (tmp->audio_region(), tmp->audio_region()->fade_in()->back()->when);
        }
 }
 
@@ -2467,9 +2463,7 @@ FadeOutDrag::motion (GdkEvent* event, bool)
                        continue;
                }
 
-               tmp->reset_fade_out_shape_width (fade_length);
-               boost::shared_ptr<AudioRegion> ar (tmp->audio_region());
-               tmp->redraw_end_xfade_to (ar, fade_length);
+               tmp->reset_fade_out_shape_width (tmp->audio_region(), fade_length);
        }
 
        show_verbose_cursor_duration (region->last_frame() - fade_length, region->last_frame());
@@ -2531,7 +2525,7 @@ FadeOutDrag::aborted (bool)
                        continue;
                }
 
-               tmp->reset_fade_out_shape_width (tmp->audio_region()->fade_out()->back()->when);
+               tmp->reset_fade_out_shape_width (tmp->audio_region(), tmp->audio_region()->fade_out()->back()->when);
        }
 }
 
index aa2a7c9ccdc9e816a4b02c99acd5055d5771bfae..9470dd8a8db25a0a6179f0367d620b9dd7263d08 100644 (file)
@@ -138,9 +138,8 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
                sigc::mem_fun (*_session_config, &SessionConfiguration::set_xfade_choice)
                );
 
-       cfc->add (ConstantPowerMinus3dB, _("constant power (-3dB)"));
-       cfc->add (ConstantPowerMinus6dB, _("constant power (-6dB)"));
-       cfc->add (RegionFades, _("use existing region fade shape"));
+       cfc->add (ConstantPowerMinus3dB, _("Constant power (-3dB) crossfade"));
+       cfc->add (ConstantPowerMinus6dB, _("Linear (-6dB) crossfade"));
 
        add_option (_("Fades"), cfc);