- for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
- (*i)->content_selection_changed ();
+ BOOST_FOREACH (ContentSubPanel* i, _panels) {
+ i->content_selection_changed ();
+ }
+
+ optional<DCPTime> go_to;
+ BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ DCPTime p;
+ p = i->position();
+ if (dynamic_pointer_cast<TextCaptionFileContent>(i) && i->paths_valid()) {
+ /* Rather special case; if we select a text subtitle file jump to its
+ first subtitle.
+ */
+ TextCaptionFile ts (dynamic_pointer_cast<TextCaptionFileContent>(i));
+ if (ts.first()) {
+ p += DCPTime(ts.first().get(), _film->active_frame_rate_change(i->position()));
+ }
+ }
+ if (!go_to || p < go_to.get()) {
+ go_to = p;
+ }
+ }
+
+ if (go_to && Config::instance()->jump_to_selected ()) {
+ _film_viewer->set_position (go_to.get().ceil(_film->video_frame_rate()));
+ }
+
+ if (_timeline_dialog) {
+ _timeline_dialog->set_selection (selected ());