Fix some leftovers on creating a new film.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Apr 2013 20:25:25 +0000 (21:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Apr 2013 20:25:25 +0000 (21:25 +0100)
branch-notes
src/wx/film_editor.cc

index 7298973aec56c580371f2162637cc23ffedf1534..99338e8bf8b142eb7b16e4146c803aab585d05e6 100644 (file)
@@ -1,8 +1,3 @@
-doesn't reset content details, length, dcp frame rate on new film.
-
-no subs in viewer on e.g. creating new arrietty_EN-EN; player does not enable them in its decoder unless
-the film has them turned on.
-
 audio map view is screwed up on windows, apparently not extended to full height
 
 crash on analyse audio
 audio map view is screwed up on windows, apparently not extended to full height
 
 crash on analyse audio
index 7e37509115359ddd54a67857092f117a9688db6e..f9ca8609b4298fee872d28c73adba9bede6ea537 100644 (file)
@@ -617,6 +617,7 @@ FilmEditor::film_changed (Film::Property p)
                setup_subtitle_control_sensitivity ();
                setup_streams ();
                setup_show_audio_sensitivity ();
                setup_subtitle_control_sensitivity ();
                setup_streams ();
                setup_show_audio_sensitivity ();
+               setup_length ();
                break;
        case Film::TRUST_CONTENT_HEADERS:
                checked_set (_trust_content_headers, _film->trust_content_headers ());
                break;
        case Film::TRUST_CONTENT_HEADERS:
                checked_set (_trust_content_headers, _film->trust_content_headers ());
@@ -697,15 +698,20 @@ FilmEditor::film_changed (Film::Property p)
                setup_dcp_name ();
                break;
        case Film::DCP_FRAME_RATE:
                setup_dcp_name ();
                break;
        case Film::DCP_FRAME_RATE:
+       {
+               bool done = false;
                for (unsigned int i = 0; i < _dcp_frame_rate->GetCount(); ++i) {
                        if (wx_to_std (_dcp_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->dcp_frame_rate())) {
                for (unsigned int i = 0; i < _dcp_frame_rate->GetCount(); ++i) {
                        if (wx_to_std (_dcp_frame_rate->GetString(i)) == boost::lexical_cast<string> (_film->dcp_frame_rate())) {
-                               if (_dcp_frame_rate->GetSelection() != int(i)) {
-                                       _dcp_frame_rate->SetSelection (i);
-                                       break;
-                               }
+                               checked_set (_dcp_frame_rate, i);
+                               done = true;
+                               break;
                        }
                }
 
                        }
                }
 
+               if (!done) {
+                       checked_set (_dcp_frame_rate, -1);
+               }
+
                if (_film->video_frame_rate()) {
                        _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->video_frame_rate ()) != _film->dcp_frame_rate ());
                } else {
                if (_film->video_frame_rate()) {
                        _best_dcp_frame_rate->Enable (best_dcp_frame_rate (_film->video_frame_rate ()) != _film->dcp_frame_rate ());
                } else {
@@ -713,6 +719,7 @@ FilmEditor::film_changed (Film::Property p)
                }
                setup_frame_rate_description ();
                break;
                }
                setup_frame_rate_description ();
                break;
+       }
        case Film::AUDIO_MAPPING:
                _audio_mapping->set_mapping (_film->audio_mapping ());
                break;
        case Film::AUDIO_MAPPING:
                _audio_mapping->set_mapping (_film->audio_mapping ());
                break;
@@ -905,6 +912,8 @@ FilmEditor::set_film (shared_ptr<Film> f)
        film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAM);
        film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAMS);
        film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAM);
        film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::SUBTITLE_STREAM);
        film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAMS);
        film_content_changed (boost::shared_ptr<Content> (), FFmpegContentProperty::AUDIO_STREAM);
+
+       setup_content_information ();
 }
 
 /** Updates the sensitivity of lots of widgets to a given value.
 }
 
 /** Updates the sensitivity of lots of widgets to a given value.