summaryrefslogtreecommitdiff
path: root/src/wx/caption_view.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-07-21 15:16:18 +0100
committerCarl Hetherington <cth@carlh.net>2018-07-21 15:16:18 +0100
commitcbd4450197a083bf58bda510e626f73ba583cb66 (patch)
tree2be308772512539570beab36beab02bde72d6d4b /src/wx/caption_view.cc
parent1013175d5f6adfa0e6a7442e4c9aebb893787748 (diff)
Basics of multiple captions per content so that DCPContent can
hold subs and closed captions.
Diffstat (limited to 'src/wx/caption_view.cc')
-rw-r--r--src/wx/caption_view.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wx/caption_view.cc b/src/wx/caption_view.cc
index c57f9161e..e6e63efff 100644
--- a/src/wx/caption_view.cc
+++ b/src/wx/caption_view.cc
@@ -35,7 +35,7 @@ using boost::shared_ptr;
using boost::bind;
using boost::dynamic_pointer_cast;
-CaptionView::CaptionView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<Decoder> decoder, FilmViewer* viewer)
+CaptionView::CaptionView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<CaptionContent> caption, shared_ptr<Decoder> decoder, FilmViewer* viewer)
: wxDialog (parent, wxID_ANY, _("Captions"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, _content (content)
, _film_viewer (viewer)
@@ -85,8 +85,14 @@ CaptionView::CaptionView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
_subs = 0;
_frc = film->active_frame_rate_change (content->position());
- decoder->caption->PlainStart.connect (bind (&CaptionView::data_start, this, _1));
- decoder->caption->Stop.connect (bind (&CaptionView::data_stop, this, _1));
+
+ /* Find the decoder that is being used for our CaptionContent and attach to it */
+ BOOST_FOREACH (shared_ptr<CaptionDecoder> i, decoder->caption) {
+ if (i->content() == caption) {
+ i->PlainStart.connect (bind (&CaptionView::data_start, this, _1));
+ i->Stop.connect (bind (&CaptionView::data_stop, this, _1));
+ }
+ }
while (!decoder->pass ()) {}
SetSizerAndFit (sizer);
}