Add a stored list of DKDMs to the creator rather than just a load button (#767).
[dcpomatic.git] / src / wx / film_viewer.cc
index ead1cf9aee227717d26413ada1071c4e4ff16182..5ca147b747b932be49c035c51b6e9477bffac12e 100644 (file)
@@ -70,6 +70,8 @@ FilmViewer::FilmViewer (wxWindow* p)
        , _frame_number (new wxStaticText (this, wxID_ANY, wxT("")))
        , _timecode (new wxStaticText (this, wxID_ANY, wxT("")))
        , _play_button (new wxToggleButton (this, wxID_ANY, _("Play")))
+       , _coalesce_player_changes (false)
+       , _pending_player_change (false)
        , _last_get_accurate (true)
 {
 #ifndef __WXOSX__
@@ -435,6 +437,11 @@ FilmViewer::player_changed (bool frequent)
                return;
        }
 
+       if (_coalesce_player_changes) {
+               _pending_player_change = true;
+               return;
+       }
+
        calculate_sizes ();
        refresh ();
        update_position_label ();
@@ -469,3 +476,26 @@ FilmViewer::refresh ()
 {
        get (_position, _last_get_accurate);
 }
+
+void
+FilmViewer::set_position (DCPTime p)
+{
+       _position = p;
+       get (_position, true);
+       update_position_label ();
+       update_position_slider ();
+}
+
+void
+FilmViewer::set_coalesce_player_changes (bool c)
+{
+       _coalesce_player_changes = c;
+
+       if (c) {
+               _pending_player_change = false;
+       } else {
+               if (_pending_player_change) {
+                       player_changed (false);
+               }
+       }
+}