#include <cassert>
#include <algorithm>
+#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <gtkmm.h>
using namespace ArdourCanvas;
static const int32_t sync_mark_width = 9;
+static double const handle_size = 6; /* height of fade handles */
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
Gdk::Color const & basic_color)
if (!_recregion) {
fade_in_handle = new ArdourCanvas::SimpleRect (*group);
fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
- fade_in_handle->property_outline_pixels() = 0;
+ fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
fade_in_handle->set_data ("regionview", this);
fade_out_handle = new ArdourCanvas::SimpleRect (*group);
fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
- fade_out_handle->property_outline_pixels() = 0;
+ fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
fade_out_handle->set_data ("regionview", this);
AudioRegionView::region_changed (const PropertyChange& what_changed)
{
ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed);
- // cerr << "AudioRegionView::region_changed() called" << endl;
RegionView::region_changed (what_changed);
if (what_changed.contains (ARDOUR::Properties::fade_out_active)) {
fade_out_active_changed ();
}
+ if (what_changed.contains (ARDOUR::Properties::fade_in_is_xfade)) {
+ fade_in_changed ();
+ }
+ if (what_changed.contains (ARDOUR::Properties::fade_out_is_xfade)) {
+ fade_out_changed ();
+ }
if (what_changed.contains (ARDOUR::Properties::envelope_active)) {
envelope_active_changed ();
}
{
/* position of fade handle offset from the top of the region view */
double const handle_pos = 2;
- /* height of fade handles */
- double const handle_height = 5;
if (fade_in_handle) {
fade_in_handle->property_y1() = handle_pos;
- fade_in_handle->property_y2() = handle_pos + handle_height;
+ fade_in_handle->property_y2() = handle_pos + handle_size;
}
if (fade_out_handle) {
fade_out_handle->property_y1() = handle_pos;
- fade_out_handle->property_y2() = handle_pos + handle_height;
+ fade_out_handle->property_y2() = handle_pos + handle_size;
}
}
/* Put the fade in handle so that its left side is at the end-of-fade line */
fade_in_handle->property_x1() = handle_center;
- fade_in_handle->property_x2() = handle_center + 6;
+ fade_in_handle->property_x2() = handle_center + handle_size;
if (pwidth < 5) {
fade_in_shape->hide();
}
}
+framepos_t
+AudioRegionView::get_fade_in_shape_width ()
+{
+ return audio_region()->fade_in()->back()->when;
+}
+
+framepos_t
+AudioRegionView::get_fade_out_shape_width ()
+{
+ return audio_region()->fade_out()->back()->when;
+}
+
+
void
AudioRegionView::set_samples_per_unit (gdouble spu)
{
}
if (fade_in_handle && !internal_editing) {
+ fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 255);
fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
+ fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 255);
fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
}
}
}
if (fade_in_handle) {
+ fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
+ fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
}
}
}
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]);
double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1.0;
ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);