Refresh ();
_current_in_lines = true;
}
+
+ if (!_current && _tracks.empty()) {
+ for (int i = 0; i < CLOSED_CAPTION_LINES; ++i) {
+ _lines[i] = wxString();
+ }
+ }
}
void
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 ();
_track->SetSelection (0);
}
- _butler = butler;
+ track_selected ();
}
#include "lib/config.h"
#include "lib/compose.hpp"
#include "lib/dcpomatic_log.h"
+#include "lib/text_content.h"
extern "C" {
#include <libavutil/pixfmt.h>
}
_player->set_play_referenced ();
_film->Change.connect (boost::bind (&FilmViewer::film_change, this, _1, _2));
+ _film->ContentChange.connect (boost::bind(&FilmViewer::content_change, this, _1, _3));
_player->Change.connect (boost::bind (&FilmViewer::player_change, this, _1, _2, _3));
/* Keep about 1 second's worth of history samples */
_butler->disable_audio ();
}
- _closed_captions_dialog->set_film_and_butler (_film, _butler);
+ _closed_captions_dialog->set_butler (_butler);
if (was_running) {
start ();
{
if (type == CHANGE_TYPE_DONE && p == Film::AUDIO_CHANNELS) {
recreate_butler ();
+ } else if (p == Film::CONTENT) {
+ _closed_captions_dialog->update_tracks (_film);
}
}
{
_pad_black = p;
}
+
+void
+FilmViewer::content_change (ChangeType type, int property)
+{
+ if (type != CHANGE_TYPE_DONE) {
+ return;
+ }
+
+ if (property == TextContentProperty::USE || property == TextContentProperty::TYPE || property == TextContentProperty::DCP_TRACK) {
+ _closed_captions_dialog->update_tracks (_film);
+ }
+}
void get ();
void display_player_video ();
void film_change (ChangeType, Film::Property);
+ void content_change (ChangeType, int property);
void recreate_butler ();
void config_changed (Config::Property);
bool maybe_draw_background_image (wxPaintDC& dc);