, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
+ , fade_position_line(0)
, gain_line(0)
, _amplitude_above_axis(1.0)
, _flags(0)
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
+ , fade_position_line(0)
, gain_line(0)
, _amplitude_above_axis(1.0)
, _flags(0)
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
+ , fade_position_line(0)
, gain_line(0)
, _amplitude_above_axis(1.0)
, _flags(0)
, fade_out_shape(0)
, fade_in_handle(0)
, fade_out_handle(0)
+ , fade_position_line(0)
, gain_line(0)
, _amplitude_above_axis(1.0)
, _flags(0)
fade_out_handle->property_outline_pixels() = 0;
fade_out_handle->set_data ("regionview", this);
+
+ fade_position_line = new ArdourCanvas::SimpleLine (*group);
+ fade_position_line->property_color_rgba() = 0xBBBBBBAA;
+ fade_position_line->property_y1() = 7;
+ fade_position_line->property_y2() = _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1;
+
+ fade_position_line->hide();
}
setup_fade_handle_positions ();
void
AudioRegionView::fade_in_active_changed ()
{
-// uint32_t r,g,b,a;
-// uint32_t col;
-// UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
-
if (audio_region()->fade_in_active()) {
fade_in_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,90); // FIXME make a themeable colour
fade_in_shape->property_width_pixels() = 1;
- fade_in_shape->property_outline_color_rgba() = RGBA_TO_UINT(180,180,180,190); // FIXME make a themeable colour
} else {
fade_in_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,20); // FIXME make a themeable colour
fade_in_shape->property_width_pixels() = 1;
- fade_in_shape->property_outline_color_rgba() = RGBA_TO_UINT(45,45,45,150); // FIXME make a themeable colour
}
}
void
AudioRegionView::fade_out_active_changed ()
{
-// uint32_t r,g,b,a;
-// uint32_t col;
-// UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
-
if (audio_region()->fade_out_active()) {
fade_out_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,90); // FIXME make a themeable colour
fade_out_shape->property_width_pixels() = 1;
- fade_out_shape->property_outline_color_rgba() = RGBA_TO_UINT(180,180,180,200); // FIXME make a themeable colour
} else {
fade_out_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,20); // FIXME make a themeable colour
fade_out_shape->property_width_pixels() = 1;
- fade_out_shape->property_outline_color_rgba() = RGBA_TO_UINT(45,45,45,200); // FIXME make a themeable colour
}
}
}
if (fade_in_handle) {
- if (pixel_width <= 6.0) {
+ if (pixel_width <= 6.0 || _height < 5.0 || !trackview.session()->config.get_show_region_fades()) {
fade_in_handle->hide();
fade_out_handle->hide();
- } else {
- if (_height < 5.0) {
- fade_in_handle->hide();
- fade_out_handle->hide();
- } else {
- if (trackview.session()->config.get_show_region_fades()) {
- fade_in_handle->show();
- fade_out_handle->show();
- }
- }
+ }
+ else {
+ fade_in_handle->show();
+ fade_out_handle->show();
}
}
width = std::max ((nframes_t) 64, width);
Points* points;
+
double pwidth = width / samples_per_unit;
uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
double h;
handle_center = pwidth;
if (handle_center > 7.0) {
- handle_center -= 3.0;
+ handle_center -= 2.0;
} else {
handle_center = 3.0;
}
points = get_canvas_points ("fade in shape", npoints + 3);
if (_height >= NAME_HIGHLIGHT_THRESH) {
- h = _height - NAME_HIGHLIGHT_SIZE;
+ h = _height - NAME_HIGHLIGHT_SIZE - 2;
} else {
h = _height;
}
handle_center = (_region->length() - width) / samples_per_unit;
if (handle_center > 7.0) {
- handle_center -= 3.0;
+ handle_center -= 2.0;
} else {
handle_center = 3.0;
}
audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, curve, npoints);
if (_height >= NAME_HIGHLIGHT_THRESH) {
- h = _height - NAME_HIGHLIGHT_SIZE;
+ h = _height - NAME_HIGHLIGHT_SIZE - 2;
} else {
h = _height;
}
double xdelta = pwidth/npoints;
for (pi = 0, pc = 0; pc < npoints; ++pc) {
- (*points)[pi].set_x(_pixel_width - 1 - pwidth + (pc*xdelta));
+ (*points)[pi].set_x(_pixel_width - pwidth + (pc * xdelta));
(*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
}
editor->show_all();
}
+
+void
+AudioRegionView::show_fade_line (nframes64_t pos)
+{
+ fade_position_line->property_x1() = trackview.editor().frame_to_pixel (pos);
+ fade_position_line->property_x2() = trackview.editor().frame_to_pixel (pos);
+ fade_position_line->show ();
+ fade_position_line->raise_to_top ();
+}
+
+void
+AudioRegionView::hide_fade_line ()
+{
+ fade_position_line->hide ();
+}
+
+
void
AudioRegionView::transients_changed ()
{
{
Drag::start_grab (event, cursor);
- AudioRegionView* a = dynamic_cast<AudioRegionView*> (_primary);
- boost::shared_ptr<AudioRegion> const r = a->audio_region ();
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
+ boost::shared_ptr<AudioRegion> const r = arv->audio_region ();
_pointer_frame_offset = grab_frame() - ((nframes64_t) r->fade_in()->back()->when + r->position());
_editor->show_verbose_duration_cursor (r->position(), r->position() + r->fade_in()->back()->when, 10);
+ arv->show_fade_line((nframes64_t) r->fade_in()->back()->when);
}
void
}
tmp->reset_fade_in_shape_width (fade_length);
+ tmp->show_fade_line((nframes64_t) fade_length);
}
_editor->show_verbose_duration_cursor (region->position(), region->position() + fade_length, 10);
tmp->audio_region()->set_fade_in_length (fade_length);
tmp->audio_region()->set_fade_in_active (true);
+ tmp->hide_fade_line();
XMLNode &after = alist->get_state();
_editor->session()->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &after));
}
tmp->reset_fade_in_shape_width (tmp->audio_region()->fade_in()->back()->when);
+ tmp->hide_fade_line();
}
}
{
Drag::start_grab (event, cursor);
- AudioRegionView* a = dynamic_cast<AudioRegionView*> (_primary);
- boost::shared_ptr<AudioRegion> r = a->audio_region ();
+ AudioRegionView* arv = dynamic_cast<AudioRegionView*> (_primary);
+ boost::shared_ptr<AudioRegion> r = arv->audio_region ();
_pointer_frame_offset = grab_frame() - (r->length() - (nframes64_t) r->fade_out()->back()->when + r->position());
_editor->show_verbose_duration_cursor (r->last_frame() - r->fade_out()->back()->when, r->last_frame(), 10);
+
+ arv->show_fade_line(r->length() - r->fade_out()->back()->when);
}
void
}
tmp->reset_fade_out_shape_width (fade_length);
+ tmp->show_fade_line(region->length() - fade_length);
}
_editor->show_verbose_duration_cursor (region->last_frame() - fade_length, region->last_frame(), 10);
tmp->audio_region()->set_fade_out_length (fade_length);
tmp->audio_region()->set_fade_out_active (true);
+ tmp->hide_fade_line();
XMLNode &after = alist->get_state();
_editor->session()->add_command(new MementoCommand<AutomationList>(*alist.get(), &before, &after));
}
tmp->reset_fade_out_shape_width (tmp->audio_region()->fade_out()->back()->when);
+ tmp->hide_fade_line();
}
}