Move some updates from content_change to player_change.
[dcpomatic.git] / src / wx / film_viewer.cc
index cc25ccdd5fbbd152f74d9ff6fecf087bcbb2a08f..1993f00117aae3c13a6a45458c74ce9334d550b3 100644 (file)
@@ -180,12 +180,11 @@ FilmViewer::set_film (shared_ptr<Film> film)
        _player->set_play_referenced ();
 
        _film->Change.connect (boost::bind (&FilmViewer::film_change, this, _1, _2));
-       _film->ContentChange.connect (boost::bind(&FilmViewer::content_change, this, _1, _3));
        _film->LengthChange.connect (boost::bind(&FilmViewer::film_length_change, this));
        _player->Change.connect (boost::bind (&FilmViewer::player_change, this, _1, _2, _3));
 
-       film_change (CHANGE_TYPE_DONE, Film::VIDEO_FRAME_RATE);
-       film_change (CHANGE_TYPE_DONE, Film::THREE_D);
+       film_change (ChangeType::DONE, Film::Property::VIDEO_FRAME_RATE);
+       film_change (ChangeType::DONE, Film::Property::THREE_D);
        film_length_change ();
 
        /* Keep about 1 second's worth of history samples */
@@ -217,7 +216,7 @@ FilmViewer::recreate_butler ()
                        Config::instance()->audio_mapping(_audio_channels),
                        _audio_channels,
                        bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24),
-                       VIDEO_RANGE_FULL,
+                       VideoRange::FULL,
                        false,
                        true
                        )
@@ -376,7 +375,7 @@ FilmViewer::stop ()
 void
 FilmViewer::player_change (ChangeType type, int property, bool frequent)
 {
-       if (type != CHANGE_TYPE_DONE || frequent) {
+       if (type != ChangeType::DONE || frequent) {
                return;
        }
 
@@ -402,22 +401,26 @@ FilmViewer::player_change (ChangeType type, int property, bool frequent)
        if (!refreshed) {
                slow_refresh ();
        }
+
+       if (property == TextContentProperty::USE || property == TextContentProperty::TYPE || property == TextContentProperty::DCP_TRACK) {
+               _closed_captions_dialog->update_tracks (_film);
+       }
 }
 
 void
 FilmViewer::film_change (ChangeType type, Film::Property p)
 {
-       if (type != CHANGE_TYPE_DONE) {
+       if (type != ChangeType::DONE) {
                return;
        }
 
-       if (p == Film::AUDIO_CHANNELS) {
+       if (p == Film::Property::AUDIO_CHANNELS) {
                recreate_butler ();
-       } else if (p == Film::VIDEO_FRAME_RATE) {
+       } else if (p == Film::Property::VIDEO_FRAME_RATE) {
                _video_view->set_video_frame_rate (_film->video_frame_rate());
-       } else if (p == Film::THREE_D) {
+       } else if (p == Film::Property::THREE_D) {
                _video_view->set_three_d (_film->three_d());
-       } else if (p == Film::CONTENT) {
+       } else if (p == Film::Property::CONTENT) {
                _closed_captions_dialog->update_tracks (_film);
        }
 }
@@ -463,8 +466,8 @@ FilmViewer::set_coalesce_player_changes (bool c)
        _coalesce_player_changes = c;
 
        if (!c) {
-               BOOST_FOREACH (int i, _pending_player_changes) {
-                       player_change (CHANGE_TYPE_DONE, i, false);
+               for (auto i: _pending_player_changes) {
+                       player_change (ChangeType::DONE, i, false);
                }
                _pending_player_changes.clear ();
        }
@@ -622,7 +625,7 @@ FilmViewer::average_latency () const
         }
 
         Frame total = 0;
-        BOOST_FOREACH (Frame i, _latency_history) {
+        for (auto i: _latency_history) {
                 total += i;
         }
 
@@ -707,19 +710,6 @@ FilmViewer::gets () const
 }
 
 
-void
-FilmViewer::content_change (ChangeType type, int property)
-{
-       if (type != CHANGE_TYPE_DONE) {
-               return;
-       }
-
-       if (property == TextContentProperty::USE || property == TextContentProperty::TYPE || property == TextContentProperty::DCP_TRACK) {
-               _closed_captions_dialog->update_tracks (_film);
-       }
-}
-
-
 void
 FilmViewer::image_changed (shared_ptr<PlayerVideo> pv)
 {