#include <algorithm>
#include <boost/scoped_array.hpp>
-#include <boost/scoped_ptr.hpp>
#include <gtkmm.h>
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;
}
fade_in_handle->property_x2() = handle_center + handle_size;
if (pwidth < 5) {
+ hide_start_xfade();
fade_in_shape->hide();
return;
}
fade_in_shape->property_points() = *points;
delete points;
+ redraw_start_xfade_to ( ar, width);
+
/* ensure trim handle stays on top */
if (frame_handle_start) {
frame_handle_start->raise_to_top();
}
+
}
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;
}
/* don't show shape if its too small */
if (pwidth < 5) {
+ hide_end_xfade();
fade_out_shape->hide();
return;
}
fade_out_shape->property_points() = *points;
delete points;
+ redraw_end_xfade_to (ar, width);
+
/* ensure trim handle stays on top */
if (frame_handle_end) {
frame_handle_end->raise_to_top();
}
+
}
framepos_t
}
editor->present ();
- editor->set_position (Gtk::WIN_POS_MOUSE);
editor->show_all();
}
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;
}
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;
}
}
Points* points = get_canvas_points ("xfade edit redraw", npoints);
- boost::scoped_ptr<float> vec (new float[npoints]);
+ boost::scoped_array<float> vec (new float[npoints]);
ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);