mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
exercise subsurface rendering for x-fade curves
This commit is contained in:
parent
da7cdb9b26
commit
17e94e02e8
3 changed files with 18 additions and 4 deletions
|
|
@ -91,6 +91,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView
|
||||||
, _end_xfade_visible (false)
|
, _end_xfade_visible (false)
|
||||||
, _amplitude_above_axis(1.0)
|
, _amplitude_above_axis(1.0)
|
||||||
, fade_color(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());
|
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)
|
, _end_xfade_visible (false)
|
||||||
, _amplitude_above_axis(1.0)
|
, _amplitude_above_axis(1.0)
|
||||||
, fade_color(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());
|
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)
|
, _end_xfade_visible (false)
|
||||||
, _amplitude_above_axis (other._amplitude_above_axis)
|
, _amplitude_above_axis (other._amplitude_above_axis)
|
||||||
, fade_color(0)
|
, fade_color(0)
|
||||||
|
, curve_surface(new ArdourCanvas::SurfaceGroup(group))
|
||||||
{
|
{
|
||||||
Gdk::Color c;
|
Gdk::Color c;
|
||||||
int r,g,b,a;
|
int r,g,b,a;
|
||||||
|
|
@ -690,7 +693,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!start_xfade_out) {
|
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()));
|
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_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_ActiveCrossfade(), 32));
|
||||||
start_xfade_out->set_fill_mode (ArdourCanvas::Curve::Inside);
|
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) {
|
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()));
|
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_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_CrossfadeLine(), 96));
|
||||||
start_xfade_in->set_fill_mode (ArdourCanvas::Curve::Outside);
|
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) {
|
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()));
|
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_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_ActiveCrossfade(), 32));
|
||||||
end_xfade_out->set_fill_mode (ArdourCanvas::Curve::Inside);
|
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) {
|
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()));
|
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_color (UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->get_canvasvar_CrossfadeLine(), 96));
|
||||||
end_xfade_in->set_fill_mode (ArdourCanvas::Curve::Outside);
|
end_xfade_in->set_fill_mode (ArdourCanvas::Curve::Outside);
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#include "canvas/fwd.h"
|
#include "canvas/fwd.h"
|
||||||
#include "canvas/wave_view.h"
|
#include "canvas/wave_view.h"
|
||||||
|
#include "canvas/surface_group.h"
|
||||||
|
|
||||||
#include "region_view.h"
|
#include "region_view.h"
|
||||||
#include "time_axis_view_item.h"
|
#include "time_axis_view_item.h"
|
||||||
|
|
@ -204,6 +205,8 @@ class AudioRegionView : public RegionView
|
||||||
AutomationLine::VisibleAspects automation_line_visibility () const;
|
AutomationLine::VisibleAspects automation_line_visibility () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
ArdourCanvas::SurfaceGroup *curve_surface;
|
||||||
|
|
||||||
void setup_fade_handle_positions ();
|
void setup_fade_handle_positions ();
|
||||||
|
|
||||||
void parameter_changed (std::string const &);
|
void parameter_changed (std::string const &);
|
||||||
|
|
|
||||||
|
|
@ -318,8 +318,10 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
window_space = item_to_window (Duple(_points.front().x, draw.height()));
|
window_space = item_to_window (Duple(_points.front().x, draw.height()));
|
||||||
context->line_to (window_space.x, window_space.y);
|
context->line_to (window_space.x, window_space.y);
|
||||||
context->close_path();
|
context->close_path();
|
||||||
|
context->set_operator(Cairo::OPERATOR_SOURCE);
|
||||||
setup_fill_context(context);
|
setup_fill_context(context);
|
||||||
context->fill ();
|
context->fill ();
|
||||||
|
context->set_operator(Cairo::OPERATOR_OVER);
|
||||||
break;
|
break;
|
||||||
case Outside:
|
case Outside:
|
||||||
context->stroke_preserve ();
|
context->stroke_preserve ();
|
||||||
|
|
@ -328,8 +330,10 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
window_space = item_to_window (Duple(_points.front().x, 0.0));
|
window_space = item_to_window (Duple(_points.front().x, 0.0));
|
||||||
context->line_to (window_space.x, window_space.y);
|
context->line_to (window_space.x, window_space.y);
|
||||||
context->close_path();
|
context->close_path();
|
||||||
|
context->set_operator(Cairo::OPERATOR_SOURCE);
|
||||||
setup_fill_context(context);
|
setup_fill_context(context);
|
||||||
context->fill ();
|
context->fill ();
|
||||||
|
context->set_operator(Cairo::OPERATOR_OVER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -403,7 +407,9 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
context->line_to (window_space.x, window_space.y);
|
context->line_to (window_space.x, window_space.y);
|
||||||
context->close_path();
|
context->close_path();
|
||||||
setup_fill_context(context);
|
setup_fill_context(context);
|
||||||
|
context->set_operator(Cairo::OPERATOR_SOURCE);
|
||||||
context->fill ();
|
context->fill ();
|
||||||
|
context->set_operator(Cairo::OPERATOR_OVER);
|
||||||
break;
|
break;
|
||||||
case Outside:
|
case Outside:
|
||||||
context->stroke_preserve ();
|
context->stroke_preserve ();
|
||||||
|
|
@ -412,8 +418,10 @@ Curve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
||||||
window_space = item_to_window (Duple (samples[left].x, 0.0));
|
window_space = item_to_window (Duple (samples[left].x, 0.0));
|
||||||
context->line_to (window_space.x, window_space.y);
|
context->line_to (window_space.x, window_space.y);
|
||||||
context->close_path();
|
context->close_path();
|
||||||
|
context->set_operator(Cairo::OPERATOR_SOURCE);
|
||||||
setup_fill_context(context);
|
setup_fill_context(context);
|
||||||
context->fill ();
|
context->fill ();
|
||||||
|
context->set_operator(Cairo::OPERATOR_OVER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
context->restore ();
|
context->restore ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue