Don't give automation region views left/right trim handles. Fixes #3428.
authorCarl Hetherington <carl@carlh.net>
Wed, 1 Sep 2010 22:35:46 +0000 (22:35 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 1 Sep 2010 22:35:46 +0000 (22:35 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7727 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/automation_region_view.cc
gtk2_ardour/region_view.cc
gtk2_ardour/region_view.h
gtk2_ardour/time_axis_view_item.cc
gtk2_ardour/time_axis_view_item.h

index 2cc3059350cc76b503bbae66b46724185ecd21c6..4b98a485de270d26cc4216e5b50bf404e45938b6 100644 (file)
@@ -41,7 +41,7 @@ AutomationRegionView::AutomationRegionView(ArdourCanvas::Group*
                                            boost::shared_ptr<ARDOUR::AutomationList> list,
                                            double                                    spu,
                                            Gdk::Color const &                        basic_color)
-       : RegionView(parent, time_axis, region, spu, basic_color)
+       : RegionView(parent, time_axis, region, spu, basic_color, true)
        , _parameter(param)
 {
        if (list) {
index 890c16def6d4f4df72586b996e6c2f776d798c33..12bd3e4ebe0940a87743f18c74c64acb939f843d 100644 (file)
@@ -64,8 +64,9 @@ RegionView::RegionView (ArdourCanvas::Group*              parent,
                         TimeAxisView&                     tv,
                         boost::shared_ptr<ARDOUR::Region> r,
                         double                            spu,
-                        Gdk::Color const &                basic_color)
-       : TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), false,
+                        Gdk::Color const &                basic_color,
+                       bool                              automation)
+       : TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), false, automation,
                            TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
                                                          TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame))
        , _region (r)
index 1cf392b534e2d845a26147179442e2809c620cc2..02c08ae022b0e2a3e2e248de4f426f67d989b8e2 100644 (file)
@@ -45,7 +45,8 @@ class RegionView : public TimeAxisViewItem
                    TimeAxisView&        time_view,
                    boost::shared_ptr<ARDOUR::Region> region,
                    double               samples_per_unit,
-                   Gdk::Color const &   basic_color);
+                   Gdk::Color const &   basic_color,
+                   bool                 automation = false);
 
        RegionView (const RegionView& other);
        RegionView (const RegionView& other, boost::shared_ptr<ARDOUR::Region> other_region);
index 164e4d2420eabd11551e1f68eb76f2caa061e134..309b4dd1cb88510f03413ef5c7a25e389d0f0828 100644 (file)
@@ -83,19 +83,23 @@ TimeAxisViewItem::set_constant_heights ()
  * Construct a new TimeAxisViewItem.
  *
  * @param it_name the unique name of this item
- * @param parant the parent canvas group
+ * @param parent the parent canvas group
  * @param tv the TimeAxisView we are going to be added to
  * @param spu samples per unit
  * @param base_color
  * @param start the start point of this item
  * @param duration the duration of this item
+ * @param recording true if this is a recording region view
+ * @param automation true if this is an automation region view
  */
-TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
-                                  nframes64_t start, nframes64_t duration, bool recording,
-                                  Visibility vis)
+TimeAxisViewItem::TimeAxisViewItem(
+       const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color const & base_color,
+       nframes64_t start, nframes64_t duration, bool recording, bool automation, Visibility vis
+       )
        : trackview (tv)
        , _height (1.0)
        , _recregion (recording)
+       , _automation (automation)
 {
        group = new ArdourCanvas::Group (parent);
 
@@ -107,6 +111,7 @@ TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
        , PBD::ScopedConnectionList()
        , trackview (other.trackview)
        , _recregion (other._recregion)
+       , _automation (other._automation)
 {
 
        Gdk::Color c;
@@ -167,10 +172,9 @@ TimeAxisViewItem::init (
                frame->property_outline_pixels() = 1;
                frame->property_outline_what() = 0xF;
                
-               if(_recregion){
+               if (_recregion) {
                        frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
-               }
-               else {
+               } else {
                        frame->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_TimeAxisFrame.get();
                }
                
@@ -204,7 +208,7 @@ TimeAxisViewItem::init (
        }
 
        /* create our grab handles used for trimming/duration etc */
-       if (!_recregion) {
+       if (!_recregion && !_automation) {
                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());
index 16b558c47b6ef22ce5f5b77d849b40d24181d089..65f112bc902cd7bef3c7e4d76c26637ee5bf062e 100644 (file)
@@ -141,7 +141,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
        
 protected:
        TimeAxisViewItem(const std::string &, ArdourCanvas::Group&, TimeAxisView&, double, Gdk::Color const &,
-                        nframes64_t, nframes64_t, bool recording = false, Visibility v = Visibility (0));
+                        nframes64_t, nframes64_t, bool recording = false, bool automation = false, Visibility v = Visibility (0));
        
        TimeAxisViewItem (const TimeAxisViewItem&);
        
@@ -237,6 +237,7 @@ protected:
        double _height;
        Visibility visibility;
        bool _recregion;
+       bool _automation; ///< true if this is an automation region view
        
 }; /* class TimeAxisViewItem */