diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-01-04 23:33:28 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-01-06 22:01:28 +0000 |
| commit | 89d4090c6b1bdf889c2302b92e1f4bf33cf7cf05 (patch) | |
| tree | 4ce39b074a163ebdf8befa6f2ad0326296e0a310 /src/wx | |
| parent | 90be9c89248be5e80b91e9926a6f38c73501bcb6 (diff) | |
Allow 96kHz audio as an advanced option (#1789).
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/dcp_panel.cc | 22 | ||||
| -rw-r--r-- | src/wx/dcp_panel.h | 5 | ||||
| -rw-r--r-- | src/wx/full_config_dialog.cc | 13 |
3 files changed, 37 insertions, 3 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 61dfd7507..4db0d7a4c 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -478,6 +478,9 @@ DCPPanel::film_changed (Film::Property p) setup_sensitivity (); break; } + case Film::Property::AUDIO_FRAME_RATE: + checked_set (_audio_sample_rate, _film->audio_frame_rate() == 48000 ? 0 : 1); + break; case Film::Property::CONTENT_VERSIONS: case Film::Property::VERSION_NUMBER: case Film::Property::RELEASE_TERRITORY: @@ -623,6 +626,7 @@ DCPPanel::set_film (shared_ptr<Film> film) film_changed (Film::Property::REEL_LENGTH); film_changed (Film::Property::REENCODE_J2K); film_changed (Film::Property::AUDIO_LANGUAGE); + film_changed (Film::Property::AUDIO_FRAME_RATE); set_general_sensitivity(static_cast<bool>(_film)); } @@ -891,6 +895,9 @@ DCPPanel::make_audio_panel () _audio_channels = new wxChoice (panel, wxID_ANY); setup_audio_channels_choice (_audio_channels, minimum_allowed_audio_channels ()); + _audio_sample_rate_label = create_label (panel, _("Sample rate"), true); + _audio_sample_rate = new wxChoice (panel, wxID_ANY); + _processor_label = create_label (panel, _("Processor"), true); _audio_processor = new wxChoice (panel, wxID_ANY); add_audio_processors (); @@ -898,9 +905,13 @@ DCPPanel::make_audio_panel () _show_audio = new Button (panel, _("Show graph of audio levels...")); _audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_channels_changed, this)); + _audio_sample_rate->Bind (wxEVT_CHOICE, boost::bind(&DCPPanel::audio_sample_rate_changed, this)); _audio_processor->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_processor_changed, this)); _show_audio->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::show_audio_clicked, this)); + _audio_sample_rate->Append (_("48kHz")); + _audio_sample_rate->Append (_("96kHz")); + add_audio_panel_to_grid (); return panel; @@ -916,6 +927,10 @@ DCPPanel::add_audio_panel_to_grid () _audio_grid->Add (_audio_channels, wxGBPosition (r, 1)); ++r; + add_label_to_sizer (_audio_grid, _audio_sample_rate_label, true, wxGBPosition(r, 0)); + _audio_grid->Add (_audio_sample_rate, wxGBPosition(r, 1)); + ++r; + add_label_to_sizer (_audio_grid, _processor_label, true, wxGBPosition (r, 0)); _audio_grid->Add (_audio_processor, wxGBPosition (r, 1)); ++r; @@ -1018,3 +1033,10 @@ DCPPanel::edit_audio_language_clicked () d->Destroy (); } + +void +DCPPanel::audio_sample_rate_changed () +{ + _film->set_audio_frame_rate (_audio_sample_rate->GetSelection() == 0 ? 48000 : 96000); +} + diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index 9da7a6929..2e7555487 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2022 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -88,6 +88,7 @@ private: void reencode_j2k_changed (); void enable_audio_language_toggled (); void edit_audio_language_clicked (); + void audio_sample_rate_changed (); void setup_frame_rate_widget (); void setup_container (); @@ -136,6 +137,8 @@ private: wxSizer* _frame_rate_sizer; wxStaticText* _channels_label; wxChoice* _audio_channels; + wxStaticText* _audio_sample_rate_label; + wxChoice* _audio_sample_rate; wxStaticText* _processor_label; wxChoice* _audio_processor; wxButton* _show_audio; diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index db499f575..aa7ddecc1 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -1357,10 +1357,11 @@ private: _allow_any_container = new CheckBox (_panel, _("Allow full-frame and non-standard container ratios")); table->Add (_allow_any_container, 1, wxEXPAND | wxALL); - table->AddSpacer (0); - restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to see all ratios)"), false); restart->SetFont (font); + + _allow_96khz_audio = new CheckBox (_panel, _("Allow creation of DCPs with 96kHz audio")); + table->Add (_allow_96khz_audio, 1, wxEXPAND | wxALL); table->AddSpacer (0); _show_experimental_audio_processors = new CheckBox (_panel, _("Show experimental audio processors")); @@ -1465,6 +1466,7 @@ private: _video_display_mode->Bind (wxEVT_CHOICE, boost::bind(&AdvancedPage::video_display_mode_changed, this)); _allow_any_dcp_frame_rate->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this)); _allow_any_container->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_container_changed, this)); + _allow_96khz_audio->Bind (wxEVT_CHECKBOX, boost::bind(&AdvancedPage::allow_96khz_audio_changed, this)); _show_experimental_audio_processors->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::show_experimental_audio_processors_changed, this)); _only_servers_encode->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::only_servers_encode_changed, this)); _frames_in_memory_multiplier->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::frames_in_memory_multiplier_changed, this)); @@ -1500,6 +1502,7 @@ private: } checked_set (_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate ()); checked_set (_allow_any_container, config->allow_any_container ()); + checked_set (_allow_96khz_audio, config->allow_96khz_audio()); checked_set (_show_experimental_audio_processors, config->show_experimental_audio_processors ()); checked_set (_only_servers_encode, config->only_servers_encode ()); checked_set (_log_general, config->log_types() & LogEntry::TYPE_GENERAL); @@ -1547,6 +1550,11 @@ private: Config::instance()->set_allow_any_container(_allow_any_container->GetValue()); } + void allow_96khz_audio_changed () + { + Config::instance()->set_allow_96hhz_audio(_allow_96khz_audio->GetValue()); + } + void show_experimental_audio_processors_changed () { Config::instance()->set_show_experimental_audio_processors(_show_experimental_audio_processors->GetValue()); @@ -1615,6 +1623,7 @@ private: wxSpinCtrl* _frames_in_memory_multiplier = nullptr; wxCheckBox* _allow_any_dcp_frame_rate = nullptr; wxCheckBox* _allow_any_container = nullptr; + wxCheckBox* _allow_96khz_audio = nullptr; wxCheckBox* _show_experimental_audio_processors = nullptr; wxCheckBox* _only_servers_encode = nullptr; NameFormatEditor* _dcp_metadata_filename_format = nullptr; |
