+
+void
+FilmEditor::show_audio_clicked (wxCommandEvent &)
+{
+ if (_audio_dialog) {
+ _audio_dialog->Destroy ();
+ _audio_dialog = 0;
+ }
+
+ _audio_dialog = new AudioDialog (this);
+ _audio_dialog->Show ();
+ _audio_dialog->set_film (_film);
+}
+
+void
+FilmEditor::best_dcp_frame_rate_clicked (wxCommandEvent &)
+{
+ if (!_film) {
+ return;
+ }
+
+ _film->set_dcp_frame_rate (best_dcp_frame_rate (_film->source_frame_rate ()));
+}
+
+void
+FilmEditor::setup_show_audio_sensitivity ()
+{
+ _show_audio->Enable (_film && _film->has_audio ());
+}
+
+void
+FilmEditor::setup_scaling_description ()
+{
+ wxString d;
+
+ int lines = 0;
+
+ if (_film->size().width && _film->size().height) {
+ d << wxString::Format (
+ _("Original video is %dx%d (%.2f:1)\n"),
+ _film->size().width, _film->size().height,
+ float (_film->size().width) / _film->size().height
+ );
+ ++lines;
+ }
+
+ Crop const crop = _film->crop ();
+ if (crop.left || crop.right || crop.top || crop.bottom) {
+ libdcp::Size const cropped = _film->cropped_size (_film->size ());
+ d << wxString::Format (
+ _("Cropped to %dx%d (%.2f:1)\n"),
+ cropped.width, cropped.height,
+ float (cropped.width) / cropped.height
+ );
+ ++lines;
+ }
+
+ Format const * format = _film->format ();
+ if (format) {
+ int const padding = format->dcp_padding (_film);
+ libdcp::Size scaled = format->dcp_size ();
+ scaled.width -= padding * 2;
+ d << wxString::Format (
+ _("Scaled to %dx%d (%.2f:1)\n"),
+ scaled.width, scaled.height,
+ float (scaled.width) / scaled.height
+ );
+ ++lines;
+
+ if (padding) {
+ d << wxString::Format (
+ _("Padded with black to %dx%d (%.2f:1)\n"),
+ format->dcp_size().width, format->dcp_size().height,
+ float (format->dcp_size().width) / format->dcp_size().height
+ );
+ ++lines;
+ }
+ }
+
+ for (int i = lines; i < 4; ++i) {
+ d << wxT ("\n ");
+ }
+
+ _scaling_description->SetLabel (d);
+}