Remove fade handles from recording regions. Fixes #3322.
authorCarl Hetherington <carl@carlh.net>
Mon, 19 Jul 2010 23:26:10 +0000 (23:26 +0000)
committerCarl Hetherington <carl@carlh.net>
Mon, 19 Jul 2010 23:26:10 +0000 (23:26 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7444 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_region_view.cc
gtk2_ardour/audio_region_view.h
gtk2_ardour/marker_view.cc
gtk2_ardour/region_view.cc
gtk2_ardour/time_axis_view_item.cc
gtk2_ardour/time_axis_view_item.h

index e1aaf2a7a78f2d3629e5e139f4c218f15654acb9..138601bf07044a29a8a35c1d1e2c12e30e9922ce 100644 (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
index 270f9821463c5d6330552a69df60e0861507caab..82bc2a08ea031666a4ad5acd99397a301781ae78 100644 (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;
 
index 23397d6776e96597264e0ee0d28c21091775c8e7..a0e8f2bbf0c95a847c768b852760345f8c653992 100644 (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) ;
index bbe854a6a34044b03d1ba23dc508d08bbb95b42d..8a9767bb029a40a8d2b13b5a1034dea087bc0366 100644 (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));
-
-               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));
+               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_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 ();
+       }
 }
index 6fd4be08a5bec4c0622c35039afa19eacd4c82a9..164e4d2420eabd11551e1f68eb76f2caa061e134 100644 (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;
index 090df5ccca485f99f0ebe5fccba43a5eaa6616a6..16b558c47b6ef22ce5f5b77d849b40d24181d089 100644 (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;