#include "lib/text_content.h"
#include "lib/util.h"
#include "lib/video_content.h"
-#include "lib/warnings.h"
#include <dcp/locale_convert.h>
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
#include <wx/gbsizer.h>
#include <wx/notebook.h>
#include <wx/spinctrl.h>
#include <wx/wx.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
#include <boost/lexical_cast.hpp>
_notebook = new wxNotebook (_panel, wxID_ANY);
_sizer->Add (_notebook, 1, wxEXPAND | wxTOP, 6);
- _notebook->AddPage (make_video_panel (), _("Video"), false);
- _notebook->AddPage (make_audio_panel (), _("Audio"), false);
-
_name->Bind (wxEVT_TEXT, boost::bind(&DCPPanel::name_changed, this));
_use_isdcf_name->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::use_isdcf_name_toggled, this));
_copy_isdcf_name_button->Bind(wxEVT_BUTTON, boost::bind(&DCPPanel::copy_isdcf_name_button_clicked, this));
break;
case Film::Property::CONTENT:
setup_dcp_name ();
- setup_sensitivity ();
break;
case Film::Property::AUDIO_LANGUAGE:
{
checked_set (_enable_audio_language, static_cast<bool>(al));
checked_set (_audio_language, al ? std_to_wx(al->to_string()) : wxT(""));
setup_dcp_name ();
- setup_sensitivity ();
break;
}
+ case Film::Property::AUDIO_FRAME_RATE:
+ if (_audio_sample_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:
property == DCPContentProperty::REFERENCE_AUDIO ||
property == DCPContentProperty::REFERENCE_TEXT) {
setup_dcp_name ();
- setup_sensitivity ();
}
}
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));
}
DCPPanel::set_general_sensitivity (bool s)
{
_generally_sensitive = s;
- setup_sensitivity ();
-}
-
-
-void
-DCPPanel::setup_sensitivity ()
-{
- _name->Enable (_generally_sensitive);
- _use_isdcf_name->Enable (_generally_sensitive);
- _dcp_content_type->Enable (_generally_sensitive);
- _copy_isdcf_name_button->Enable (_generally_sensitive);
- _enable_audio_language->Enable (_generally_sensitive);
- _audio_language->Enable (_enable_audio_language->GetValue());
- _edit_audio_language->Enable (_enable_audio_language->GetValue());
- _encrypted->Enable (_generally_sensitive);
- _reel_type->Enable (_generally_sensitive && _film && !_film->references_dcp_video() && !_film->references_dcp_audio());
- _reel_length->Enable (_generally_sensitive && _film && _film->reel_type() == ReelType::BY_LENGTH);
- _markers->Enable (_generally_sensitive && _film && !_film->interop());
- _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_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());
- _best_frame_rate->Enable (
- _generally_sensitive &&
- _film &&
- _film->best_video_frame_rate () != _film->video_frame_rate() &&
- !_film->references_dcp_video() &&
- !_film->contains_atmos_content()
- );
- _resolution->Enable (_generally_sensitive && _film && !_film->references_dcp_video());
- _three_d->Enable (_generally_sensitive && _film && !_film->references_dcp_video());
-
- _standard->Enable (
- _generally_sensitive &&
- _film &&
- !_film->references_dcp_video() &&
- !_film->references_dcp_audio() &&
- !_film->contains_atmos_content()
- );
-
- _reencode_j2k->Enable (_generally_sensitive && _film);
- _show_audio->Enable (_generally_sensitive && _film);
}
-
void
DCPPanel::use_isdcf_name_toggled ()
{
_audio_channels = new wxChoice (panel, wxID_ANY);
setup_audio_channels_choice (_audio_channels, minimum_allowed_audio_channels ());
+ if (Config::instance()->allow_96khz_audio()) {
+ _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 ();
_show_audio = new Button (panel, _("Show graph of audio levels..."));
_audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::audio_channels_changed, this));
+ if (_audio_sample_rate) {
+ _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));
+ if (_audio_sample_rate) {
+ _audio_sample_rate->Append (_("48kHz"));
+ _audio_sample_rate->Append (_("96kHz"));
+ }
+
add_audio_panel_to_grid ();
return panel;
_audio_grid->Add (_audio_channels, wxGBPosition (r, 1));
++r;
+ if (_audio_sample_rate_label && _audio_sample_rate) {
+ 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;
void
DCPPanel::enable_audio_language_toggled ()
{
- setup_sensitivity ();
if (_enable_audio_language->GetValue()) {
auto al = wx_to_std (_audio_language->GetLabel());
_film->set_audio_language (al.empty() ? dcp::LanguageTag("en-US") : dcp::LanguageTag(al));
d->Destroy ();
}
+
+void
+DCPPanel::audio_sample_rate_changed ()
+{
+ if (_audio_sample_rate) {
+ _film->set_audio_frame_rate (_audio_sample_rate->GetSelection() == 0 ? 48000 : 96000);
+ }
+}
+