Fix controls in main DoM.
authorCarl Hetherington <cth@carlh.net>
Tue, 27 Nov 2018 22:40:05 +0000 (22:40 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 27 Nov 2018 22:40:05 +0000 (22:40 +0000)
src/tools/dcpomatic.cc
src/wx/controls.cc
src/wx/controls.h

index bd0c40e..7197ee8 100644 (file)
@@ -439,6 +439,7 @@ public:
                _film = film;
                _film_viewer->set_film (_film);
                _film_editor->set_film (_film);
+               _controls->set_film (_film);
                if (_video_waveform_dialog) {
                        _video_waveform_dialog->Destroy ();
                        _video_waveform_dialog = 0;
index 9fcdbd6..dd47aa1 100644 (file)
@@ -362,6 +362,7 @@ Controls::set_film (shared_ptr<Film> film)
        }
 
        _film = film;
+       _film_change_connection = _film->Change.connect (boost::bind(&Controls::film_change, this, _1, _2));
 
        setup_sensitivity ();
 
@@ -374,3 +375,13 @@ Controls::film () const
 {
        return _film;
 }
+
+void
+Controls::film_change (ChangeType type, Film::Property p)
+{
+       if (type == CHANGE_TYPE_DONE && p == Film::CONTENT) {
+               setup_sensitivity ();
+               update_position_label ();
+               update_position_slider ();
+       }
+}
index d70eb94..fd6181d 100644 (file)
@@ -87,6 +87,7 @@ private:
        void outline_content_changed ();
        void eye_changed ();
        void position_changed ();
+       void film_change (ChangeType, Film::Property);
 
        typedef std::pair<boost::shared_ptr<dcp::CPL>, boost::filesystem::path> CPL;
 
@@ -104,6 +105,7 @@ private:
 
        ClosedCaptionsDialog* _closed_captions_dialog;
 
+       boost::signals2::scoped_connection _film_change_connection;
        boost::signals2::scoped_connection _config_changed_connection;
 };