Synchronise content list / timeline selection when the content list selection changes.
[dcpomatic.git] / src / wx / timeline.cc
index 8a61eccb07e39b3736fa527f313079fd80b46018..8dee9610fff24f33907f1866451ae71b1e6a7571 100644 (file)
@@ -462,3 +462,14 @@ Timeline::selected_content () const
 
        return sel;
 }
+
+void
+Timeline::set_selection (ContentList selection)
+{
+       for (TimelineViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
+               shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (*i);
+               if (cv) {
+                       cv->set_selected (find (selection.begin(), selection.end(), cv->content ()) != selection.end ());
+               }
+       }
+}