Note that newer libsub version is required.
[dcpomatic.git] / src / wx / dcp_panel.cc
index d1de9aff7cd2512a40aa408bed2100feb8487106..f4ba74cdefbbcefd433379a26698af0bac33f9c5 100644 (file)
@@ -500,6 +500,9 @@ DCPPanel::film_changed(FilmProperty p)
        case FilmProperty::CONTENT:
                setup_dcp_name ();
                setup_sensitivity ();
+               /* Maybe we now have ATMOS content which changes our minimum_allowed_audio_channels */
+               setup_audio_channels_choice(_audio_channels, minimum_allowed_audio_channels());
+               film_changed(FilmProperty::AUDIO_CHANNELS);
                break;
        case FilmProperty::AUDIO_LANGUAGE:
        {
@@ -527,6 +530,7 @@ DCPPanel::film_changed(FilmProperty p)
        case FilmProperty::TWO_D_VERSION_OF_THREE_D:
        case FilmProperty::CHAIN:
        case FilmProperty::LUMINANCE:
+       case FilmProperty::TERRITORY_TYPE:
                setup_dcp_name ();
                break;
        default:
@@ -544,6 +548,7 @@ DCPPanel::film_content_changed (int property)
            property == TextContentProperty::LANGUAGE ||
            property == TextContentProperty::LANGUAGE_IS_ADDITIONAL ||
            property == TextContentProperty::TYPE ||
+           property == TextContentProperty::DCP_TRACK ||
            property == VideoContentProperty::CUSTOM_RATIO ||
            property == VideoContentProperty::CUSTOM_SIZE ||
            property == VideoContentProperty::BURNT_SUBTITLE_LANGUAGE ||
@@ -682,7 +687,7 @@ DCPPanel::setup_sensitivity ()
        _metadata->Enable               (_generally_sensitive);
        _frame_rate_choice->Enable      (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->contains_atmos_content());
        _frame_rate_spin->Enable        (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->contains_atmos_content());
-       _audio_channels->Enable         (_generally_sensitive && _film && !_film->references_dcp_audio() && !_film->contains_atmos_content());
+       _audio_channels->Enable         (_generally_sensitive && _film && !_film->references_dcp_audio());
        _audio_processor->Enable        (_generally_sensitive && _film && !_film->references_dcp_audio());
        _j2k_bandwidth->Enable          (_generally_sensitive && _film && !_film->references_dcp_video());
        _container->Enable              (_generally_sensitive && _film && !_film->references_dcp_video());
@@ -722,6 +727,10 @@ DCPPanel::use_isdcf_name_toggled ()
 void
 DCPPanel::setup_dcp_name ()
 {
+       if (!_film) {
+               return;
+       }
+
        _dcp_name->SetLabel (std_to_wx(_film->dcp_name(true)));
        _dcp_name->SetToolTip (std_to_wx(_film->dcp_name(true)));
 }
@@ -905,8 +914,13 @@ int
 DCPPanel::minimum_allowed_audio_channels () const
 {
        int min = 2;
-       if (_film && _film->audio_processor ()) {
-               min = _film->audio_processor()->out_channels ();
+       if (_film) {
+               if (_film->audio_processor()) {
+                       min = _film->audio_processor()->out_channels();
+               }
+               if (_film->contains_atmos_content()) {
+                       min = std::max(min, 14);
+               }
        }
 
        if (min % 2 == 1) {