diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-11 01:25:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-11 11:58:15 +0100 |
| commit | c370a1f38215f6461cf4366e6885757e7aa2b96a (patch) | |
| tree | 6d660895988652297260c2434115b903032bc60d /src/wx/text_view.cc | |
| parent | 23b60bec13fa8f0b88c34922a169aa0084d99476 (diff) | |
Separate out management of controls.
Diffstat (limited to 'src/wx/text_view.cc')
| -rw-r--r-- | src/wx/text_view.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/wx/text_view.cc b/src/wx/text_view.cc index 442335b92..16ec2213f 100644 --- a/src/wx/text_view.cc +++ b/src/wx/text_view.cc @@ -18,6 +18,9 @@ */ +#include "text_view.h" +#include "film_viewer.h" +#include "wx_util.h" #include "lib/string_text_file_decoder.h" #include "lib/content_text.h" #include "lib/video_decoder.h" @@ -26,17 +29,15 @@ #include "lib/config.h" #include "lib/string_text_file_content.h" #include "lib/text_decoder.h" -#include "text_view.h" -#include "control_film_viewer.h" -#include "wx_util.h" using std::list; using boost::shared_ptr; +using boost::weak_ptr; using boost::bind; using boost::dynamic_pointer_cast; TextView::TextView ( - wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<TextContent> text, shared_ptr<Decoder> decoder, ControlFilmViewer* viewer + wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<TextContent> text, shared_ptr<Decoder> decoder, weak_ptr<FilmViewer> viewer ) : wxDialog (parent, wxID_ANY, _("Captions"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , _content (content) @@ -135,7 +136,9 @@ TextView::subtitle_selected (wxListEvent& ev) } DCPOMATIC_ASSERT (ev.GetIndex() < int(_start_times.size())); - shared_ptr<Content> locked = _content.lock (); - DCPOMATIC_ASSERT (locked); - _film_viewer->set_position (locked, _start_times[ev.GetIndex()]); + shared_ptr<Content> lc = _content.lock (); + DCPOMATIC_ASSERT (lc); + shared_ptr<FilmViewer> fv = _film_viewer.lock (); + DCPOMATIC_ASSERT (fv); + fv->set_position (lc, _start_times[ev.GetIndex()]); } |
