2016-02-01 Carl Hetherington <cth@carlh.net>
+ * Synchronise content list / timeline selection when
+ the content list selection changes.
+
* Move the preview to the start of a piece of content
when selecting it (suggested by Carsten Kurz).
if (go_to) {
_film_viewer->set_position (go_to.get ());
}
+
+ if (_timeline_dialog) {
+ _timeline_dialog->set_selection (selected ());
+ }
}
void
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 ());
+ }
+ }
+}
return _snap;
}
+ void set_selection (ContentList selection);
+
private:
void paint ();
void left_down (wxMouseEvent &);
_sequence_video->SetValue (film->sequence_video ());
}
}
+
+void
+TimelineDialog::set_selection (ContentList selection)
+{
+ _timeline.set_selection (selection);
+}
public:
TimelineDialog (ContentPanel *, boost::shared_ptr<Film>);
+ void set_selection (ContentList selection);
+
private:
void snap_toggled ();
void sequence_video_toggled ();