vtl: send A/V offset to video-monitor when launched
[ardour.git] / gtk2_ardour / automation_streamview.cc
index 86388f527f93e7008bad6579ec8c426716220489..e477b7ce728f598de03d56032a4c557633acae0f 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "ardour/midi_region.h"
 #include "ardour/midi_source.h"
-#include "ardour/region_factory.h"
 
 #include "automation_streamview.h"
 #include "region_view.h"
@@ -95,8 +94,9 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
                        /* great. we already have an AutomationRegionView for this Region. use it again. */
                        AutomationRegionView* arv = dynamic_cast<AutomationRegionView*>(*i);;
 
-                       if (arv->line())
+                       if (arv->line()) {
                                arv->line()->set_list (list);
+                       }
                        (*i)->set_valid (true);
                        (*i)->enable_display(wfd);
                        display_region(arv);
@@ -131,7 +131,7 @@ AutomationStreamView::add_region_view_internal (boost::shared_ptr<Region> region
        if (line && line->the_list()) {
                line->the_list()->set_automation_state (automation_state ());
        }
-       
+
        RegionViewAdded (region_view);
 
        return region_view;
@@ -147,7 +147,7 @@ void
 AutomationStreamView::set_automation_state (AutoState state)
 {
        /* Setting the automation state for this view sets the state of all regions' lists to the same thing */
-       
+
        if (region_views.empty()) {
                _pending_automation_state = state;
        } else {
@@ -218,7 +218,7 @@ bool
 AutomationStreamView::has_automation () const
 {
        list<boost::shared_ptr<AutomationLine> > lines = get_lines ();
-       
+
        for (list<boost::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
                if ((*i)->npoints() > 0) {
                        return true;
@@ -235,7 +235,7 @@ void
 AutomationStreamView::set_interpolation (AutomationList::InterpolationStyle s)
 {
        list<boost::shared_ptr<AutomationLine> > lines = get_lines ();
-       
+
        for (list<boost::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
                (*i)->the_list()->set_interpolation (s);
        }
@@ -249,9 +249,10 @@ AutomationStreamView::interpolation () const
        }
 
        AutomationRegionView* v = dynamic_cast<AutomationRegionView*> (region_views.front());
-       assert (v);
-
-       return v->line()->the_list()->interpolation ();
+       if (v) {
+               return v->line()->the_list()->interpolation ();
+       }
+       return AutomationList::Linear;
 }
 
 /** Clear all automation displayed in this view */
@@ -259,7 +260,7 @@ void
 AutomationStreamView::clear ()
 {
        list<boost::shared_ptr<AutomationLine> > lines = get_lines ();
-       
+
        for (list<boost::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
                (*i)->clear ();
        }
@@ -286,7 +287,7 @@ void
 AutomationStreamView::set_selected_points (PointSelection& ps)
 {
        list<boost::shared_ptr<AutomationLine> > lines = get_lines ();
-       
+
        for (list<boost::shared_ptr<AutomationLine> >::iterator i = lines.begin(); i != lines.end(); ++i) {
                (*i)->set_selected_points (ps);
        }
@@ -296,7 +297,7 @@ list<boost::shared_ptr<AutomationLine> >
 AutomationStreamView::get_lines () const
 {
        list<boost::shared_ptr<AutomationLine> > lines;
-       
+
        for (list<RegionView*>::const_iterator i = region_views.begin(); i != region_views.end(); ++i) {
                AutomationRegionView* arv = dynamic_cast<AutomationRegionView*> (*i);
                assert (arv);
@@ -311,7 +312,7 @@ struct RegionPositionSorter {
                return a->region()->position() < b->region()->position();
        }
 };
-       
+
 
 /** @param pos Position, in session frames.
  *  @return AutomationLine to paste to for that position, or 0 if there is none appropriate.