Fix various problems with the closed caption viewer not being updated properly.
[dcpomatic.git] / src / wx / closed_captions_dialog.cc
index afcf5fa876f97b35d0cf66bf9765cf379e0afa13..625652b8c30d2a4dc6dde2326b6ea8b0cfd43134 100644 (file)
@@ -205,6 +205,12 @@ ClosedCaptionsDialog::update ()
                Refresh ();
                _current_in_lines = true;
        }
+
+       if (!_current && _tracks.empty()) {
+               for (int i = 0; i < CLOSED_CAPTION_LINES; ++i) {
+                       _lines[i] = wxString();
+               }
+       }
 }
 
 void
@@ -215,8 +221,15 @@ ClosedCaptionsDialog::clear ()
        Refresh ();
 }
 
+
+void
+ClosedCaptionsDialog::set_butler (weak_ptr<Butler> butler)
+{
+       _butler = butler;
+}
+
 void
-ClosedCaptionsDialog::set_film_and_butler (shared_ptr<Film> film, weak_ptr<Butler> butler)
+ClosedCaptionsDialog::update_tracks (shared_ptr<const Film> film)
 {
        _tracks.clear ();
 
@@ -239,5 +252,5 @@ ClosedCaptionsDialog::set_film_and_butler (shared_ptr<Film> film, weak_ptr<Butle
                _track->SetSelection (0);
        }
 
-       _butler = butler;
+       track_selected ();
 }