13
0

Remove fade handles from recording regions. Fixes #3322.

git-svn-id: svn://localhost/ardour2/branches/3.0@7444 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-07-19 23:26:10 +00:00
parent 61dd34e435
commit 064c6287cd
6 changed files with 57 additions and 31 deletions

View File

@ -179,7 +179,7 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
fade_out_shape->property_fill_color_rgba() = fade_color;
fade_out_shape->set_data ("regionview", this);
{
if (!_recregion) {
uint32_t r,g,b,a;
UINT_TO_RGBA(fill_color,&r,&g,&b,&a);
@ -231,9 +231,15 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
reset_width_dependent_items (_pixel_width);
fade_in_shape->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_event), fade_in_shape, this));
fade_in_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_handle_event), fade_in_handle, this));
if (fade_in_handle) {
fade_in_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_handle_event), fade_in_handle, this));
}
fade_out_shape->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_event), fade_out_shape, this));
fade_out_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_handle_event), fade_out_handle, this));
if (fade_out_handle) {
fade_out_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_handle_event), fade_out_handle, this));
}
set_colors ();
@ -650,7 +656,9 @@ AudioRegionView::reset_fade_in_shape_width (nframes_t width)
delete points;
/* ensure trim handle stays on top */
frame_handle_start->raise_to_top();
if (frame_handle_start) {
frame_handle_start->raise_to_top();
}
}
void
@ -741,7 +749,9 @@ AudioRegionView::reset_fade_out_shape_width (nframes_t width)
delete points;
/* ensure trim handle stays on top */
frame_handle_end->raise_to_top();
if (frame_handle_end) {
frame_handle_end->raise_to_top();
}
}
void
@ -1399,8 +1409,10 @@ AudioRegionView::update_coverage_frames (LayerDisplay d)
{
RegionView::update_coverage_frames (d);
fade_in_handle->raise_to_top ();
fade_out_handle->raise_to_top ();
if (fade_in_handle) {
fade_in_handle->raise_to_top ();
fade_out_handle->raise_to_top ();
}
}
void

View File

@ -137,8 +137,8 @@ class AudioRegionView : public RegionView
ArdourCanvas::SimpleLine* zero_line;
ArdourCanvas::Polygon* fade_in_shape;
ArdourCanvas::Polygon* fade_out_shape;
ArdourCanvas::SimpleRect* fade_in_handle;
ArdourCanvas::SimpleRect* fade_out_handle;
ArdourCanvas::SimpleRect* fade_in_handle; ///< fade in handle, or 0
ArdourCanvas::SimpleRect* fade_out_handle; ///< fade out handle, or 0
AudioRegionGainLine * gain_line;

View File

@ -64,8 +64,10 @@ MarkerView::MarkerView(ArdourCanvas::Group *parent,
// hook up our canvas events
frame_handle_start->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_markerview_start_handle_event), frame_handle_start, this));
frame_handle_end->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_markerview_end_handle_event), frame_handle_end, this));
if (frame_handle_start) {
frame_handle_start->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_markerview_start_handle_event), frame_handle_start, this));
frame_handle_end->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_markerview_end_handle_event), frame_handle_end, this));
}
group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_markerview_item_view_event), group, this));
set_position(start, this) ;

View File

@ -157,16 +157,19 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
name_highlight->set_data ("regionview", this);
name_highlight->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_name_highlight_event), name_highlight, this));
frame_handle_start->set_data ("regionview", this);
frame_handle_start->set_data ("isleft", (void*) 1);
frame_handle_start->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_start, this));
if (frame_handle_start) {
frame_handle_start->set_data ("regionview", this);
frame_handle_start->set_data ("isleft", (void*) 1);
frame_handle_start->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_start, this));
frame_handle_start->raise_to_top();
}
frame_handle_end->set_data ("regionview", this);
frame_handle_end->set_data ("isleft", (void*) 0);
frame_handle_end->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_end, this));
frame_handle_start->raise_to_top();
frame_handle_end->raise_to_top();
if (frame_handle_end) {
frame_handle_end->set_data ("regionview", this);
frame_handle_end->set_data ("isleft", (void*) 0);
frame_handle_end->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_frame_handle_event), frame_handle_end, this));
frame_handle_end->raise_to_top();
}
}
if (name_pixbuf) {
@ -673,6 +676,8 @@ RegionView::update_coverage_frames (LayerDisplay d)
cr->property_x2() = trackview.editor().frame_to_pixel (end - position);
}
frame_handle_start->raise_to_top ();
frame_handle_end->raise_to_top ();
if (frame_handle_start) {
frame_handle_start->raise_to_top ();
frame_handle_end->raise_to_top ();
}
}

View File

@ -204,11 +204,14 @@ TimeAxisViewItem::init (
}
/* create our grab handles used for trimming/duration etc */
frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
frame_handle_start->property_outline_what() = 0x0;
frame_handle_end = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
frame_handle_end->property_outline_what() = 0x0;
if (!_recregion) {
frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
frame_handle_start->property_outline_what() = 0x0;
frame_handle_end = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
frame_handle_end->property_outline_what() = 0x0;
} else {
frame_handle_start = frame_handle_end = 0;
}
set_color (base_color);
@ -527,8 +530,10 @@ TimeAxisViewItem::set_height (double height)
if (frame) {
frame->property_y2() = height - 1;
frame_handle_start->property_y2() = height - 1;
frame_handle_end->property_y2() = height - 1;
if (frame_handle_start) {
frame_handle_start->property_y2() = height - 1;
frame_handle_end->property_y2() = height - 1;
}
}
vestigial_frame->property_y2() = height - 1;

View File

@ -229,8 +229,10 @@ protected:
ArdourCanvas::SimpleRect* frame;
ArdourCanvas::Pixbuf* name_pixbuf;
ArdourCanvas::SimpleRect* name_highlight;
ArdourCanvas::SimpleRect* frame_handle_start;
ArdourCanvas::SimpleRect* frame_handle_end;
/* with these two values, if frame_handle_start == 0 then frame_handle_end will also be 0 */
ArdourCanvas::SimpleRect* frame_handle_start; ///< `frame' (fade) handle for the start of the item, or 0
ArdourCanvas::SimpleRect* frame_handle_end; ///< `frame' (fade) handle for the end of the item, or 0
double _height;
Visibility visibility;