swaroop: fix sense of skippable property.
[dcpomatic.git] / src / wx / closed_captions_dialog.cc
index c07961cc8200f681393798a216bf04ac54fe049e..b81414bed9f72b37a0e638cf6545a19440685fae 100644 (file)
@@ -33,7 +33,8 @@ using boost::weak_ptr;
 using boost::optional;
 
 ClosedCaptionsDialog::ClosedCaptionsDialog (wxWindow* parent)
-       : wxDialog (parent, wxID_ANY, _("Closed captions"), wxDefaultPosition, wxDefaultSize,
+        /* XXX: empirical and probably unhelpful default size here; needs to be related to font metrics */
+       : wxDialog (parent, wxID_ANY, _("Closed captions"), wxDefaultPosition, wxSize(640, (640 / 10) + 64),
 #ifdef DCPOMATIC_OSX
                /* I can't get wxFRAME_FLOAT_ON_PARENT to work on OS X, and although wxSTAY_ON_TOP keeps
                   the window above all others (and not just our own) it's better than nothing for now.
@@ -103,18 +104,18 @@ private:
 void
 ClosedCaptionsDialog::update (DCPTime time)
 {
-       if (_current_in_lines && _current->second.to > time) {
+       if (_current_in_lines && _current->period.to > time) {
                /* Current one is fine */
                return;
        }
 
-       if (_current && _current->second.to < time) {
+       if (_current && _current->period.to < time) {
                /* Current one has finished; clear out */
                for (int j = 0; j < CLOSED_CAPTION_LINES; ++j) {
                        _lines[j] = "";
                }
                Refresh ();
-               _current = optional<pair<PlayerText, DCPTimePeriod> >();
+               _current = optional<TextRingBuffers::Data>();
        }
 
        if (!_current) {
@@ -125,10 +126,10 @@ ClosedCaptionsDialog::update (DCPTime time)
                _current_in_lines = false;
        }
 
-       if (_current && _current->second.contains(time)) {
+       if (_current && _current->period.contains(time)) {
                /* We need to set this new one up */
 
-               list<StringText> to_show = _current->first.string;
+               list<StringText> to_show = _current->text.string;
 
                for (int j = 0; j < CLOSED_CAPTION_LINES; ++j) {
                        _lines[j] = "";
@@ -152,7 +153,7 @@ ClosedCaptionsDialog::update (DCPTime time)
 void
 ClosedCaptionsDialog::clear ()
 {
-       _current = optional<pair<PlayerText, DCPTimePeriod> >();
+       _current = optional<TextRingBuffers::Data>();
        _current_in_lines = false;
        Refresh ();
 }