X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fclosed_captions_dialog.h;h=1f0e450ff3203bc632ec2601d898af05a57963c6;hb=e9ae050b0b15c91c3f591ad84938e60d271357b3;hp=ca19cc95ad97b0205c3955502a24dded4f5cdf1f;hpb=bd763364d9c96928f3bd6bd5fe46ebe1a06e6d0a;p=dcpomatic.git diff --git a/src/wx/closed_captions_dialog.h b/src/wx/closed_captions_dialog.h index ca19cc95a..1f0e450ff 100644 --- a/src/wx/closed_captions_dialog.h +++ b/src/wx/closed_captions_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -19,24 +19,38 @@ */ #include "lib/dcpomatic_time.h" -#include "lib/player_caption.h" +#include "lib/player.h" +#include "lib/text_ring_buffers.h" +#include "lib/warnings.h" +DCPOMATIC_DISABLE_WARNINGS #include +DCPOMATIC_ENABLE_WARNINGS -class ClosedCaptionsView : public wxDialog +class Butler; +class FilmViewer; + +class ClosedCaptionsDialog : public wxDialog { public: - ClosedCaptionsView (wxWindow* parent); + explicit ClosedCaptionsDialog (wxWindow* parent, FilmViewer* viewer); - void refresh (DCPTime); - void caption (PlayerCaption, DCPTimePeriod); void clear (); + void update_tracks (std::shared_ptr film); + void set_butler (std::weak_ptr); private: + void shown (wxShowEvent); + void update (); void paint (); + void track_selected (); - typedef std::pair Caption; - std::list _captions; + FilmViewer* _viewer; + wxPanel* _display; + wxChoice* _track; + boost::optional _current; + bool _current_in_lines; std::vector _lines; - static int const _num_lines; - static int const _num_chars_per_line; + std::vector _tracks; + std::weak_ptr _butler; + wxTimer _timer; };