Always sign DCPs (#1760).
[dcpomatic.git] / src / wx / dcp_panel.cc
index a7f4f45e9f88b6e68055aecfa3c55fbcc9dc443a..d8ddd1bca1be538e3dddc9ca500f82770ce06b37 100644 (file)
@@ -97,7 +97,6 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> v
        _dcp_content_type_label = create_label (_panel, _("Content Type"), true);
        _dcp_content_type = new wxChoice (_panel, wxID_ANY);
 
-       _signed = new CheckBox (_panel, _("Signed"));
        _encrypted = new CheckBox (_panel, _("Encrypted"));
 
         wxClientDC dc (_panel);
@@ -134,7 +133,6 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> v
        _edit_isdcf_button->Bind     (wxEVT_BUTTON,   boost::bind (&DCPPanel::edit_isdcf_button_clicked, this));
        _copy_isdcf_name_button->Bind(wxEVT_BUTTON,   boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this));
        _dcp_content_type->Bind      (wxEVT_CHOICE,   boost::bind (&DCPPanel::dcp_content_type_changed, this));
-       _signed->Bind                (wxEVT_CHECKBOX, boost::bind (&DCPPanel::signed_toggled, this));
        _encrypted->Bind             (wxEVT_CHECKBOX, boost::bind (&DCPPanel::encrypted_toggled, this));
        _edit_key->Bind              (wxEVT_BUTTON,   boost::bind (&DCPPanel::edit_key_clicked, this));
        _reel_type->Bind             (wxEVT_CHOICE,   boost::bind (&DCPPanel::reel_type_changed, this));
@@ -203,12 +201,6 @@ DCPPanel::add_to_grid ()
        _grid->Add (_dcp_content_type, wxGBPosition (r, 1));
        ++r;
 
-       _signed->Show (full);
-       if (full) {
-               _grid->Add (_signed, wxGBPosition (r, 0), wxGBSpan (1, 2));
-               ++r;
-       }
-
        _grid->Add (_encrypted, wxGBPosition (r, 0), wxGBSpan (1, 2));
        ++r;
 
@@ -297,16 +289,6 @@ DCPPanel::j2k_bandwidth_changed ()
        _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000);
 }
 
-void
-DCPPanel::signed_toggled ()
-{
-       if (!_film) {
-               return;
-       }
-
-       _film->set_signed (_signed->GetValue ());
-}
-
 void
 DCPPanel::encrypted_toggled ()
 {
@@ -425,18 +407,12 @@ DCPPanel::film_changed (int p)
                checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
                setup_dcp_name ();
                break;
-       case Film::SIGNED:
-               checked_set (_signed, _film->is_signed ());
-               break;
        case Film::ENCRYPTED:
                checked_set (_encrypted, _film->encrypted ());
                if (_film->encrypted ()) {
-                       _film->set_signed (true);
-                       _signed->Enable (false);
                        _key->Enable (_generally_sensitive);
                        _edit_key->Enable (_generally_sensitive);
                } else {
-                       _signed->Enable (_generally_sensitive);
                        _key->Enable (false);
                        _edit_key->Enable (false);
                }
@@ -641,7 +617,6 @@ DCPPanel::set_film (shared_ptr<Film> film)
        film_changed (Film::DCP_CONTENT_TYPE);
        film_changed (Film::CONTAINER);
        film_changed (Film::RESOLUTION);
-       film_changed (Film::SIGNED);
        film_changed (Film::ENCRYPTED);
        film_changed (Film::KEY);
        film_changed (Film::J2K_BANDWIDTH);
@@ -680,7 +655,6 @@ DCPPanel::setup_sensitivity ()
        if (_film && _film->encrypted ()) {
                si = false;
        }
-       _signed->Enable (si);
 
        _encrypted->Enable              (_generally_sensitive);
        _key->Enable                    (_generally_sensitive && _film && _film->encrypted ());
@@ -783,6 +757,12 @@ DCPPanel::config_changed (Config::Property p)
                _audio_grid->Clear ();
                add_audio_panel_to_grid ();
                _audio_grid->Layout ();
+       } else if (p == Config::SHOW_EXPERIMENTAL_AUDIO_PROCESSORS) {
+               _audio_processor->Clear ();
+               add_audio_processors ();
+               if (_film) {
+                       film_changed (Film::AUDIO_PROCESSOR);
+               }
        }
 }
 
@@ -931,10 +911,10 @@ wxPanel *
 DCPPanel::make_audio_panel ()
 {
        wxPanel* panel = new wxPanel (_notebook);
-       wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+       _audio_panel_sizer = new wxBoxSizer (wxVERTICAL);
        _audio_grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
-       sizer->Add (_audio_grid, 0, wxALL, 8);
-       panel->SetSizer (sizer);
+       _audio_panel_sizer->Add (_audio_grid, 0, wxALL, 8);
+       panel->SetSizer (_audio_panel_sizer);
 
        _channels_label = create_label (panel, _("Channels"), true);
        _audio_channels = new wxChoice (panel, wxID_ANY);
@@ -942,10 +922,7 @@ DCPPanel::make_audio_panel ()
 
        _processor_label = create_label (panel, _("Processor"), true);
        _audio_processor = new wxChoice (panel, wxID_ANY);
-       _audio_processor->Append (_("None"), new wxStringClientData (N_("none")));
-       BOOST_FOREACH (AudioProcessor const * ap, AudioProcessor::all ()) {
-               _audio_processor->Append (std_to_wx (ap->name ()), new wxStringClientData (std_to_wx (ap->id ())));
-       }
+       add_audio_processors ();
 
        _show_audio = new Button (panel, _("Show audio..."));
 
@@ -1017,7 +994,7 @@ DCPPanel::show_audio_clicked ()
                _audio_dialog = 0;
        }
 
-       AudioDialog* d = new AudioDialog (_panel, _film);
+       AudioDialog* d = new AudioDialog (_panel, _film, _viewer);
        d->Show ();
 }
 
@@ -1040,3 +1017,13 @@ DCPPanel::reel_length_changed ()
 
        _film->set_reel_length (_reel_length->GetValue() * 1000000000LL);
 }
+
+void
+DCPPanel::add_audio_processors ()
+{
+       _audio_processor->Append (_("None"), new wxStringClientData (N_("none")));
+       BOOST_FOREACH (AudioProcessor const * ap, AudioProcessor::visible()) {
+               _audio_processor->Append (std_to_wx(ap->name()), new wxStringClientData(std_to_wx(ap->id())));
+       }
+       _audio_panel_sizer->Layout();
+}