diff options
author | Robin Gareus <robin@gareus.org> | 2014-05-28 17:12:33 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-05-28 17:38:42 +0200 |
commit | f1f8f89fcb9312065a818233dff4a3f1871fa7fe (patch) | |
tree | a9a3b594096ee298f753ccd9c5a4efaefe23592a /gtk2_ardour | |
parent | c57fcde78cc0fb393fb7420f1edbc71edf572bd0 (diff) |
exercise subsurface rendering for x-fade curves
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/audio_region_view.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/audio_region_view.h | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index da07c9f324..b85706ec4b 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -91,6 +91,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView , _end_xfade_visible (false) , _amplitude_above_axis(1.0) , fade_color(0) + , curve_surface(new ArdourCanvas::SurfaceGroup(group)) { Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context()); } @@ -111,6 +112,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView , _end_xfade_visible (false) , _amplitude_above_axis(1.0) , fade_color(0) + , curve_surface(new ArdourCanvas::SurfaceGroup(group)) { Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context()); } @@ -129,6 +131,7 @@ AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_pt , _end_xfade_visible (false) , _amplitude_above_axis (other._amplitude_above_axis) , fade_color(0) + , curve_surface(new ArdourCanvas::SurfaceGroup(group)) { Gdk::Color c; int r,g,b,a; @@ -690,7 +693,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame } if (!start_xfade_out) { - start_xfade_out = new ArdourCanvas::Curve (group); + start_xfade_out = new ArdourCanvas::Curve (curve_surface); CANVAS_DEBUG_NAME (start_xfade_out, string_compose ("xfade start out line for %1", region()->name())); start_xfade_out->set_fill_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_ActiveCrossfade(), 32)); start_xfade_out->set_fill_mode (ArdourCanvas::Curve::Inside); @@ -700,7 +703,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame } if (!start_xfade_in) { - start_xfade_in = new ArdourCanvas::Curve (group); + start_xfade_in = new ArdourCanvas::Curve (curve_surface); CANVAS_DEBUG_NAME (start_xfade_in, string_compose ("xfade start in line for %1", region()->name())); start_xfade_in->set_fill_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_CrossfadeLine(), 96)); start_xfade_in->set_fill_mode (ArdourCanvas::Curve::Outside); @@ -795,7 +798,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn } if (!end_xfade_out) { - end_xfade_out = new ArdourCanvas::Curve (group); + end_xfade_out = new ArdourCanvas::Curve (curve_surface); CANVAS_DEBUG_NAME (end_xfade_out, string_compose ("xfade end out line for %1", region()->name())); end_xfade_out->set_fill_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_ActiveCrossfade(), 32)); end_xfade_out->set_fill_mode (ArdourCanvas::Curve::Inside); @@ -805,7 +808,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn } if (!end_xfade_in) { - end_xfade_in = new ArdourCanvas::Curve (group); + end_xfade_in = new ArdourCanvas::Curve (curve_surface); CANVAS_DEBUG_NAME (end_xfade_in, string_compose ("xfade end in line for %1", region()->name())); end_xfade_in->set_fill_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_CrossfadeLine(), 96)); end_xfade_in->set_fill_mode (ArdourCanvas::Curve::Outside); diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 3c6b675692..5444b1b569 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -30,6 +30,7 @@ #include "canvas/fwd.h" #include "canvas/wave_view.h" +#include "canvas/surface_group.h" #include "region_view.h" #include "time_axis_view_item.h" @@ -204,6 +205,8 @@ class AudioRegionView : public RegionView AutomationLine::VisibleAspects automation_line_visibility () const; private: + ArdourCanvas::SurfaceGroup *curve_surface; + void setup_fade_handle_positions (); void parameter_changed (std::string const &); |