diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-25 09:41:36 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-25 09:41:36 +0000 |
| commit | ee77b3cf5f59f775e75e628aa28e8f2f9f941530 (patch) | |
| tree | bbf9ab4ef1f0f633591889cbbd6b7b65de8f5a57 /src/wx/subtitle_view.cc | |
| parent | e6f28e7cda23c1ba3c49cc1bf2dc1491c2f87160 (diff) | |
It builds.
Diffstat (limited to 'src/wx/subtitle_view.cc')
| -rw-r--r-- | src/wx/subtitle_view.cc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc index f6fbd9a9a..adbc4a625 100644 --- a/src/wx/subtitle_view.cc +++ b/src/wx/subtitle_view.cc @@ -18,7 +18,7 @@ */ #include "lib/subrip_decoder.h" -#include "lib/decoded.h" +#include "lib/content_subtitle.h" #include "subtitle_view.h" using std::list; @@ -63,25 +63,16 @@ SubtitleView::SubtitleView (wxWindow* parent, shared_ptr<SubRipContent> content) } shared_ptr<SubRipDecoder> decoder (new SubRipDecoder (content)); + list<shared_ptr<ContentTextSubtitle> > subs = decoder->get_text_subtitles (ContentTime(), ContentTime::max ()); int n = 0; - while (1) { - shared_ptr<Decoded> dec = decoder->peek (); - if (!dec) { - break; - } - - shared_ptr<DecodedTextSubtitle> sub = dynamic_pointer_cast<DecodedTextSubtitle> (dec); - assert (sub); - - for (list<dcp::SubtitleString>::const_iterator i = sub->subs.begin(); i != sub->subs.end(); ++i) { + for (list<shared_ptr<ContentTextSubtitle> >::const_iterator i = subs.begin(); i != subs.end(); ++i) { + for (list<dcp::SubtitleString>::const_iterator j = (*i)->subs.begin(); j != (*i)->subs.end(); ++j) { wxListItem list_item; list_item.SetId (n); _list->InsertItem (list_item); - _list->SetItem (n, 2, i->text ()); + _list->SetItem (n, 2, j->text ()); ++n; } - - decoder->consume (); } SetSizerAndFit (sizer); |
