#include "content_panel.h"
#include "dcpomatic_button.h"
#include "gain_calculator_dialog.h"
-#include "language_tag_widget.h"
#include "static_text.h"
#include "wx_util.h"
#include "lib/config.h"
AudioPanel::AudioPanel (ContentPanel* p)
: ContentSubPanel (p, _("Audio"))
, _audio_dialog (0)
+{
+
+}
+
+
+void
+AudioPanel::create ()
{
_reference = new CheckBox (this, _("Use this DCP's audio as OV and make VF"));
_reference_note = new StaticText (this, wxT(""));
/// TRANSLATORS: this is an abbreviation for milliseconds, the unit of time
_delay_ms_label = create_label (this, _("ms"), false);
- _enable_language = new wxCheckBox (this, wxID_ANY, _("Language"));
- _language = new LanguageTagWidget (this, _("Language used for the dialogue in this content"), boost::none);
-
_mapping = new AudioMappingView (this, _("Content"), _("content"), _("DCP"), _("DCP"));
_sizer->Add (_mapping, 1, wxEXPAND | wxALL, 6);
_reference->Bind (wxEVT_CHECKBOX, boost::bind (&AudioPanel::reference_clicked, this));
_show->Bind (wxEVT_BUTTON, boost::bind (&AudioPanel::show_clicked, this));
_gain_calculate_button->Bind (wxEVT_BUTTON, boost::bind (&AudioPanel::gain_calculate_button_clicked, this));
- _enable_language->Bind (wxEVT_CHECKBOX, boost::bind (&AudioPanel::enable_language_clicked, this));
- _language->Changed.connect (boost::bind(&AudioPanel::language_changed, this));
_mapping_connection = _mapping->Changed.connect (boost::bind (&AudioPanel::mapping_changed, this, _1));
_active_jobs_connection = JobManager::instance()->ActiveJobsChanged.connect (boost::bind (&AudioPanel::active_jobs_changed, this, _1, _2));
add_to_grid ();
+
+ _sizer->Layout ();
}
void
s->Add (_delay_ms_label, 0, wxALIGN_CENTER_VERTICAL);
_grid->Add (s, wxGBPosition(r, 1));
++r;
-
- s = new wxBoxSizer (wxHORIZONTAL);
- s->Add (_enable_language, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_GAP);
- s->Add (_language->sizer(), 1, wxALIGN_CENTER_VERTICAL | wxRIGHT);
- _grid->Add (s, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND);
- ++r;
}
AudioPanel::~AudioPanel ()
}
setup_description ();
setup_peak ();
- _sizer->Layout ();
+ layout ();
} else if (property == AudioContentProperty::GAIN) {
setup_peak ();
} else if (property == DCPContentProperty::REFERENCE_AUDIO) {
setup_sensitivity ();
} else if (property == ContentProperty::VIDEO_FRAME_RATE) {
setup_description ();
- } else if (property == AudioContentProperty::LANGUAGE) {
- if (ac.size() == 1 && ac.front()->audio->language()) {
- _enable_language->SetValue (true);
- _language->set (ac.front()->audio->language());
- } else {
- _enable_language->SetValue (false);
- _language->set (boost::none);
- }
}
}
film_content_changed (AudioContentProperty::STREAMS);
film_content_changed (AudioContentProperty::GAIN);
- film_content_changed (AudioContentProperty::LANGUAGE);
film_content_changed (DCPContentProperty::REFERENCE_AUDIO);
setup_sensitivity ();
_delay->wrapped()->Enable (!ref);
_mapping->Enable (!ref && single);
_description->Enable (!ref && single);
- _enable_language->Enable (!ref && single);
- _language->enable (!ref && single && _enable_language->GetValue());
}
void
}
}
-
-void
-AudioPanel::enable_language_clicked ()
-{
- setup_sensitivity ();
- auto sel = _parent->selected_audio ();
- if (sel.size() == 1) {
- sel.front()->audio->set_language (_enable_language->GetValue() ? _language->get() : boost::none);
- }
-}
-
-
-void
-AudioPanel::language_changed ()
-{
- auto sel = _parent->selected_audio ();
- if (sel.size() == 1) {
- sel.front()->audio->set_language (_language->get());
- }
-}
-