summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-04 23:33:28 +0000
committerCarl Hetherington <cth@carlh.net>2022-04-29 00:07:13 +0200
commit08b44e380c8be3a8cb2dacbd94049f09942dabc1 (patch)
tree9b460bcea45857f5eea1bba2360680e814ad64f3 /src/wx
parente06941199da90359f41ce80c276752bc0f172d7e (diff)
Allow 96kHz audio as an advanced option (#1789).
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/dcp_panel.cc22
-rw-r--r--src/wx/dcp_panel.h5
-rw-r--r--src/wx/full_config_dialog.cc13
3 files changed, 37 insertions, 3 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index ab6bd22b5..e4cc0c558 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -479,6 +479,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:
@@ -624,6 +627,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));
}
@@ -892,6 +896,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 ();
@@ -899,9 +906,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;
@@ -917,6 +928,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;
@@ -1019,3 +1034,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 c13ec7ed0..e39a10f09 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -1420,10 +1420,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"));
@@ -1528,6 +1529,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));
@@ -1563,6 +1565,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);
@@ -1610,6 +1613,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());
@@ -1678,6 +1686,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;