, _end_xfade_visible (false)
, _amplitude_above_axis(1.0)
, fade_color(0)
+ , trim_fade_in_drag_active(false)
+ , trim_fade_out_drag_active(false)
{
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
}
, _end_xfade_visible (false)
, _amplitude_above_axis(1.0)
, fade_color(0)
+ , trim_fade_in_drag_active(false)
+ , trim_fade_out_drag_active(false)
{
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
}
, _end_xfade_visible (false)
, _amplitude_above_axis (other._amplitude_above_axis)
, fade_color(0)
+ , trim_fade_in_drag_active(false)
+ , trim_fade_out_drag_active(false)
{
Gdk::Color c;
int r,g,b,a;
if (fade_out_handle) { fade_out_handle->hide(); }
if (fade_in_trim_handle) { fade_in_trim_handle->hide(); }
if (fade_out_trim_handle) { fade_out_trim_handle->hide(); }
+ if (start_xfade_rect) { start_xfade_rect->set_outline (false); }
+ if (end_xfade_rect) { end_xfade_rect->set_outline (false); }
}
AnalysisFeatureList analysis_features = _region->transients();
fade_in_trim_handle->set_x1 (handle_size);
}
+ if (fade_in_handle->visible()) {
+ //see comment for drag_start
+ entered(false);
+ }
+
if (pwidth < 5) {
hide_start_xfade();
return;
/* points *MUST* be in anti-clockwise order */
Points points;
- Points::size_type npoints;
Points::size_type pi;
boost::shared_ptr<const Evoral::ControlList> list (audio_region()->fade_in());
Evoral::ControlList::const_iterator x;
double length = list->length();
- npoints = list->size();
points.assign (list->size(), Duple());
fade_out_trim_handle->set_x1 (1 + trim_handle_right);
}
+ if (fade_out_handle->visible()) {
+ //see comment for drag_start
+ entered(false);
+ }
/* don't show shape if its too small */
if (pwidth < 5) {
/* points *MUST* be in anti-clockwise order */
Points points;
- Points::size_type npoints;
Points::size_type pi;
boost::shared_ptr<const Evoral::ControlList> list (audio_region()->fade_out());
Evoral::ControlList::const_iterator x;
double length = list->length();
- npoints = list->size();
points.assign (list->size(), Duple());
CANVAS_DEBUG_NAME (start_xfade_rect, string_compose ("xfade start rect for %1", region()->name()));
start_xfade_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_CrossfadeLine());
start_xfade_rect->set_fill (false);
- start_xfade_rect->set_outline (true);
+ start_xfade_rect->set_outline (false);
+ start_xfade_rect->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::RIGHT));
start_xfade_rect->set_outline_width (0.5);
start_xfade_rect->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_start_xfade_event), start_xfade_rect, this));
start_xfade_rect->set_data ("regionview", this);
}
- start_xfade_rect->set (ArdourCanvas::Rect (0.0, 0.0, rect_width + TimeAxisViewItem::RIGHT_EDGE_SHIFT, effective_height));
+ start_xfade_rect->set (ArdourCanvas::Rect (0.0, 0.0, rect_width, effective_height));
/* fade out line */
CANVAS_DEBUG_NAME (end_xfade_rect, string_compose ("xfade end rect for %1", region()->name()));
end_xfade_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_CrossfadeLine());
end_xfade_rect->set_fill (false);
- end_xfade_rect->set_outline (true);
+ end_xfade_rect->set_outline (false);
+ end_xfade_rect->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT));
end_xfade_rect->set_outline_width (0.5);
end_xfade_rect->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_end_xfade_event), end_xfade_rect, this));
end_xfade_rect->set_data ("regionview", this);
}
if (!internal_editing) {
+ if (start_xfade_rect) {
+ start_xfade_rect->set_outline (true);
+ }
+ if (end_xfade_rect) {
+ end_xfade_rect->set_outline (true);
+ }
if (fade_in_handle) {
fade_in_handle->show ();
fade_in_handle->raise_to_top ();
fade_out_handle->raise_to_top ();
}
if (fade_in_trim_handle) {
- fade_in_trim_handle->show ();
- fade_in_trim_handle->raise_to_top ();
+ boost::shared_ptr<AudioRegion> ar (audio_region());
+ if (!ar->locked() && (ar->fade_in()->back()->when > 64 || (ar->can_trim() & Trimmable::FrontTrimEarlier))) {
+ fade_in_trim_handle->show ();
+ fade_in_trim_handle->raise_to_top ();
+ } else {
+ fade_in_trim_handle->hide ();
+ }
}
if (fade_out_trim_handle) {
- fade_out_trim_handle->show ();
- fade_out_trim_handle->raise_to_top ();
+ boost::shared_ptr<AudioRegion> ar (audio_region());
+ if (!ar->locked() && (ar->fade_out()->back()->when > 64 || (ar->can_trim() & Trimmable::EndTrimLater))) {
+ fade_out_trim_handle->show ();
+ fade_out_trim_handle->raise_to_top ();
+ } else {
+ fade_out_trim_handle->hide ();
+ }
}
}
}
if (fade_out_handle) { fade_out_handle->hide(); }
if (fade_in_trim_handle) { fade_in_trim_handle->hide(); }
if (fade_out_trim_handle) { fade_out_trim_handle->hide(); }
+ if (start_xfade_rect) { start_xfade_rect->set_outline (false); }
+ if (end_xfade_rect) { end_xfade_rect->set_outline (false); }
}
void
ArdourCanvas::color_to_rgba (fill, r, g, b, a);
fill = ArdourCanvas::rgba_to_color (r, g, b, 0.85); /* magic number, not user controllable */
outline = ARDOUR_UI::config()->get_canvasvar_WaveForm();
-
- if (!Config->get_show_name_highlight()) {
- /* recolor name text because it needs to contrast with
- the waveform background, not the name highlight.
- */
- }
}
wave->set_fill_color (fill);
AudioRegionView::set_fade_visibility (bool yn)
{
if (yn) {
- if (fade_in_handle) { fade_in_handle->show(); }
- if (fade_out_handle) { fade_out_handle->show(); }
- if (fade_in_trim_handle) { fade_in_trim_handle->show(); }
- if (fade_out_trim_handle) { fade_out_trim_handle->show(); }
- } else {
+ if (start_xfade_curve) { start_xfade_curve->show (); }
+ if (end_xfade_curve) { end_xfade_curve->show (); }
+ if (start_xfade_rect) { start_xfade_rect->show (); }
+ if (end_xfade_rect) { end_xfade_rect->show (); }
+ } else {
+ if (start_xfade_curve) { start_xfade_curve->hide(); }
+ if (end_xfade_curve) { end_xfade_curve->hide(); }
if (fade_in_handle) { fade_in_handle->hide(); }
if (fade_out_handle) { fade_out_handle->hide(); }
if (fade_in_trim_handle) { fade_in_trim_handle->hide(); }
if (fade_out_trim_handle) { fade_out_trim_handle->hide(); }
+ if (start_xfade_rect) { start_xfade_rect->hide (); }
+ if (end_xfade_rect) { end_xfade_rect->hide (); }
+ if (start_xfade_rect) { start_xfade_rect->set_outline (false); }
+ if (end_xfade_rect) { end_xfade_rect->set_outline (false); }
}
}
AudioRegionView::drag_end ()
{
TimeAxisViewItem::drag_end ();
-
//see comment for drag_start
+
+ if (fade_in_handle && fade_in_handle->visible()) {
+ // lenght of region or fade changed, re-check
+ // if fade_in_trim_handle or fade_out_trim_handle should
+ // be visible. -- If the fade_in_handle is visible
+ // we have focus and are not in internal edit mode.
+ entered(false);
+ }
}
void