2 Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "dcp_panel.h"
22 #include "key_dialog.h"
23 #include "isdcf_metadata_dialog.h"
24 #include "audio_dialog.h"
25 #include "lib/ratio.h"
26 #include "lib/config.h"
27 #include "lib/dcp_content_type.h"
30 #include "lib/ffmpeg_content.h"
31 #include "lib/audio_processor.h"
32 #include "lib/dcp_content.h"
34 #include <dcp/raw_convert.h>
36 #include <wx/notebook.h>
37 #include <wx/gbsizer.h>
38 #include <wx/spinctrl.h>
39 #include <boost/lexical_cast.hpp>
40 #include <boost/foreach.hpp>
50 using boost::lexical_cast;
51 using boost::shared_ptr;
53 DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> film)
56 , _generally_sensitive (true)
58 _panel = new wxPanel (n);
59 _sizer = new wxBoxSizer (wxVERTICAL);
60 _panel->SetSizer (_sizer);
62 wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
63 _sizer->Add (grid, 0, wxEXPAND | wxALL, 8);
67 add_label_to_sizer (grid, _panel, _("Name"), true, wxGBPosition (r, 0));
68 _name = new wxTextCtrl (_panel, wxID_ANY);
69 grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND | wxLEFT | wxRIGHT);
72 int flags = wxALIGN_CENTER_VERTICAL;
74 flags |= wxALIGN_RIGHT;
77 _use_isdcf_name = new wxCheckBox (_panel, wxID_ANY, _("Use ISDCF name"));
78 grid->Add (_use_isdcf_name, wxGBPosition (r, 0), wxDefaultSpan, flags);
81 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
82 _edit_isdcf_button = new wxButton (_panel, wxID_ANY, _("Details..."));
83 s->Add (_edit_isdcf_button, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP);
84 _copy_isdcf_name_button = new wxButton (_panel, wxID_ANY, _("Copy as name"));
85 s->Add (_copy_isdcf_name_button, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_X_GAP);
86 grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND);
90 /* wxST_ELLIPSIZE_MIDDLE works around a bug in GTK2 and/or wxWidgets, see
91 http://trac.wxwidgets.org/ticket/12539
93 _dcp_name = new wxStaticText (
94 _panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize,
95 wxALIGN_CENTRE_HORIZONTAL | wxST_NO_AUTORESIZE | wxST_ELLIPSIZE_MIDDLE
98 grid->Add (_dcp_name, wxGBPosition(r, 0), wxGBSpan (1, 2), wxALIGN_CENTER_VERTICAL | wxEXPAND);
101 add_label_to_sizer (grid, _panel, _("Content Type"), true, wxGBPosition (r, 0));
102 _dcp_content_type = new wxChoice (_panel, wxID_ANY);
103 grid->Add (_dcp_content_type, wxGBPosition (r, 1));
106 _notebook = new wxNotebook (_panel, wxID_ANY);
107 _sizer->Add (_notebook, 1, wxEXPAND | wxTOP, 6);
109 _notebook->AddPage (make_video_panel (), _("Video"), false);
110 _notebook->AddPage (make_audio_panel (), _("Audio"), false);
112 _signed = new wxCheckBox (_panel, wxID_ANY, _("Signed"));
113 grid->Add (_signed, wxGBPosition (r, 0), wxGBSpan (1, 2));
116 _encrypted = new wxCheckBox (_panel, wxID_ANY, _("Encrypted"));
117 grid->Add (_encrypted, wxGBPosition (r, 0), wxGBSpan (1, 2));
120 wxClientDC dc (_panel);
121 wxSize size = dc.GetTextExtent (wxT ("GGGGGGGG..."));
125 add_label_to_sizer (grid, _panel, _("Key"), true, wxGBPosition (r, 0));
126 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
127 _key = new wxStaticText (_panel, wxID_ANY, "", wxDefaultPosition, size);
128 s->Add (_key, 1, wxALIGN_CENTER_VERTICAL);
129 _edit_key = new wxButton (_panel, wxID_ANY, _("Edit..."));
131 grid->Add (s, wxGBPosition (r, 1));
135 add_label_to_sizer (grid, _panel, _("Reels"), true, wxGBPosition (r, 0));
136 _reel_type = new wxChoice (_panel, wxID_ANY);
137 grid->Add (_reel_type, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
140 add_label_to_sizer (grid, _panel, _("Reel length"), true, wxGBPosition (r, 0));
143 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
144 _reel_length = new wxSpinCtrl (_panel, wxID_ANY);
145 s->Add (_reel_length);
146 add_label_to_sizer (s, _panel, _("GB"), false);
147 grid->Add (s, wxGBPosition (r, 1));
151 add_label_to_sizer (grid, _panel, _("Standard"), true, wxGBPosition (r, 0));
152 _standard = new wxChoice (_panel, wxID_ANY);
153 grid->Add (_standard, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
156 _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::name_changed, this));
157 _use_isdcf_name->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::use_isdcf_name_toggled, this));
158 _edit_isdcf_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this));
159 _copy_isdcf_name_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this));
160 _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::dcp_content_type_changed, this));
161 _signed->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::signed_toggled, this));
162 _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::encrypted_toggled, this));
163 _edit_key->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_key_clicked, this));
164 _reel_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::reel_type_changed, this));
165 _reel_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::reel_length_changed, this));
166 _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::standard_changed, this));
168 vector<DCPContentType const *> const ct = DCPContentType::all ();
169 for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) {
170 _dcp_content_type->Append (std_to_wx ((*i)->pretty_name ()));
173 _reel_type->Append (_("Single reel"));
174 _reel_type->Append (_("Split by video content"));
175 _reel_type->Append (_("Custom"));
177 _reel_length->SetRange (1, 64);
179 _standard->Append (_("SMPTE"));
180 _standard->Append (_("Interop"));
182 Config::instance()->Changed.connect (boost::bind (&DCPPanel::config_changed, this));
186 DCPPanel::edit_key_clicked ()
188 KeyDialog* d = new KeyDialog (_panel, _film->key ());
189 if (d->ShowModal () == wxID_OK) {
190 _film->set_key (d->key ());
196 DCPPanel::name_changed ()
202 _film->set_name (string (_name->GetValue().mb_str()));
206 DCPPanel::j2k_bandwidth_changed ()
212 _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1000000);
216 DCPPanel::signed_toggled ()
222 _film->set_signed (_signed->GetValue ());
226 DCPPanel::encrypted_toggled ()
232 _film->set_encrypted (_encrypted->GetValue ());
235 /** Called when the frame rate choice widget has been changed */
237 DCPPanel::frame_rate_choice_changed ()
243 _film->set_video_frame_rate (
244 boost::lexical_cast<int> (
245 wx_to_std (_frame_rate_choice->GetString (_frame_rate_choice->GetSelection ()))
250 /** Called when the frame rate spin widget has been changed */
252 DCPPanel::frame_rate_spin_changed ()
258 _film->set_video_frame_rate (_frame_rate_spin->GetValue ());
262 DCPPanel::audio_channels_changed ()
268 _film->set_audio_channels (dcp::raw_convert<int> (string_client_data (_audio_channels->GetClientObject (_audio_channels->GetSelection ()))));
272 DCPPanel::resolution_changed ()
278 _film->set_resolution (_resolution->GetSelection() == 0 ? RESOLUTION_2K : RESOLUTION_4K);
282 DCPPanel::standard_changed ()
288 _film->set_interop (_standard->GetSelection() == 1);
292 DCPPanel::film_changed (int p)
297 case Film::CONTAINER:
301 checked_set (_name, _film->name());
304 case Film::DCP_CONTENT_TYPE:
305 checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ()));
309 checked_set (_signed, _film->is_signed ());
311 case Film::ENCRYPTED:
312 checked_set (_encrypted, _film->encrypted ());
313 if (_film->encrypted ()) {
314 _film->set_signed (true);
315 _signed->Enable (false);
316 _key->Enable (_generally_sensitive);
317 _edit_key->Enable (_generally_sensitive);
319 _signed->Enable (_generally_sensitive);
320 _key->Enable (false);
321 _edit_key->Enable (false);
325 checked_set (_key, _film->key().hex().substr (0, 8) + "...");
327 case Film::RESOLUTION:
328 checked_set (_resolution, _film->resolution() == RESOLUTION_2K ? 0 : 1);
332 case Film::J2K_BANDWIDTH:
333 checked_set (_j2k_bandwidth, _film->j2k_bandwidth() / 1000000);
335 case Film::USE_ISDCF_NAME:
337 checked_set (_use_isdcf_name, _film->use_isdcf_name ());
339 _edit_isdcf_button->Enable (_film->use_isdcf_name ());
342 case Film::ISDCF_METADATA:
345 case Film::VIDEO_FRAME_RATE:
348 for (unsigned int i = 0; i < _frame_rate_choice->GetCount(); ++i) {
349 if (wx_to_std (_frame_rate_choice->GetString(i)) == boost::lexical_cast<string> (_film->video_frame_rate())) {
350 checked_set (_frame_rate_choice, i);
357 checked_set (_frame_rate_choice, -1);
360 checked_set (_frame_rate_spin, _film->video_frame_rate ());
362 _best_frame_rate->Enable (_film->best_video_frame_rate () != _film->video_frame_rate ());
365 case Film::AUDIO_CHANNELS:
366 if (_film->audio_channels () < minimum_allowed_audio_channels ()) {
367 _film->set_audio_channels (minimum_allowed_audio_channels ());
369 checked_set (_audio_channels, dcp::raw_convert<string> (max (minimum_allowed_audio_channels(), _film->audio_channels ())));
374 checked_set (_three_d, _film->three_d ());
378 checked_set (_standard, _film->interop() ? 1 : 0);
381 case Film::AUDIO_PROCESSOR:
382 if (_film->audio_processor ()) {
383 checked_set (_audio_processor, _film->audio_processor()->id());
385 checked_set (_audio_processor, 0);
387 setup_audio_channels_choice ();
388 film_changed (Film::AUDIO_CHANNELS);
390 case Film::REEL_TYPE:
391 checked_set (_reel_type, _film->reel_type ());
392 _reel_length->Enable (_film->reel_type() == REELTYPE_BY_LENGTH);
394 case Film::REEL_LENGTH:
395 checked_set (_reel_length, _film->reel_length() / 1000000000LL);
403 DCPPanel::film_content_changed (int property)
405 if (property == AudioContentProperty::AUDIO_STREAMS ||
406 property == SubtitleContentProperty::USE_SUBTITLES ||
407 property == VideoContentProperty::VIDEO_SCALE ||
408 property == DCPContentProperty::REFERENCE_VIDEO ||
409 property == DCPContentProperty::REFERENCE_AUDIO ||
410 property == DCPContentProperty::REFERENCE_SUBTITLE) {
417 DCPPanel::setup_container ()
420 vector<Ratio const *> ratios = Ratio::all ();
421 vector<Ratio const *>::iterator i = ratios.begin ();
422 while (i != ratios.end() && *i != _film->container ()) {
427 if (i == ratios.end()) {
428 checked_set (_container, -1);
429 checked_set (_container_size, wxT (""));
431 checked_set (_container, n);
432 dcp::Size const size = fit_ratio_within (_film->container()->ratio(), _film->full_frame ());
433 checked_set (_container_size, wxString::Format ("%dx%d", size.width, size.height));
439 /** Called when the container widget has been changed */
441 DCPPanel::container_changed ()
447 int const n = _container->GetSelection ();
449 vector<Ratio const *> ratios = Ratio::all ();
450 DCPOMATIC_ASSERT (n < int (ratios.size()));
451 _film->set_container (ratios[n]);
455 /** Called when the DCP content type widget has been changed */
457 DCPPanel::dcp_content_type_changed ()
463 int const n = _dcp_content_type->GetSelection ();
464 if (n != wxNOT_FOUND) {
465 _film->set_dcp_content_type (DCPContentType::from_index (n));
470 DCPPanel::set_film (shared_ptr<Film> film)
474 film_changed (Film::NAME);
475 film_changed (Film::USE_ISDCF_NAME);
476 film_changed (Film::CONTENT);
477 film_changed (Film::DCP_CONTENT_TYPE);
478 film_changed (Film::CONTAINER);
479 film_changed (Film::RESOLUTION);
480 film_changed (Film::SIGNED);
481 film_changed (Film::ENCRYPTED);
482 film_changed (Film::KEY);
483 film_changed (Film::J2K_BANDWIDTH);
484 film_changed (Film::ISDCF_METADATA);
485 film_changed (Film::VIDEO_FRAME_RATE);
486 film_changed (Film::AUDIO_CHANNELS);
487 film_changed (Film::SEQUENCE_VIDEO);
488 film_changed (Film::THREE_D);
489 film_changed (Film::INTEROP);
490 film_changed (Film::AUDIO_PROCESSOR);
491 film_changed (Film::REEL_TYPE);
492 film_changed (Film::REEL_LENGTH);
496 DCPPanel::set_general_sensitivity (bool s)
499 _use_isdcf_name->Enable (s);
500 _edit_isdcf_button->Enable (s);
501 _dcp_content_type->Enable (s);
502 _copy_isdcf_name_button->Enable (s);
505 if (_film && _film->encrypted ()) {
508 _signed->Enable (si);
510 _encrypted->Enable (s);
511 _key->Enable (s && _film && _film->encrypted ());
512 _edit_key->Enable (s && _film && _film->encrypted ());
513 _reel_type->Enable (s);
514 _reel_length->Enable (s && _film && _film->reel_type() == REELTYPE_BY_LENGTH);
515 _frame_rate_choice->Enable (s);
516 _frame_rate_spin->Enable (s);
517 _audio_channels->Enable (s);
518 _audio_processor->Enable (s);
519 _j2k_bandwidth->Enable (s);
520 _container->Enable (s);
521 _best_frame_rate->Enable (s && _film && _film->best_video_frame_rate () != _film->video_frame_rate ());
522 _resolution->Enable (s);
523 _three_d->Enable (s);
524 _standard->Enable (s);
528 DCPPanel::use_isdcf_name_toggled ()
534 _film->set_use_isdcf_name (_use_isdcf_name->GetValue ());
538 DCPPanel::edit_isdcf_button_clicked ()
544 ISDCFMetadataDialog* d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata (), _film->three_d ());
546 _film->set_isdcf_metadata (d->isdcf_metadata ());
551 DCPPanel::setup_dcp_name ()
553 _dcp_name->SetLabel (std_to_wx (_film->dcp_name (true)));
557 DCPPanel::best_frame_rate_clicked ()
563 _film->set_video_frame_rate (_film->best_video_frame_rate ());
567 DCPPanel::three_d_changed ()
573 _film->set_three_d (_three_d->GetValue ());
577 DCPPanel::config_changed ()
579 _j2k_bandwidth->SetRange (1, Config::instance()->maximum_j2k_bandwidth() / 1000000);
580 setup_frame_rate_widget ();
584 DCPPanel::setup_frame_rate_widget ()
586 if (Config::instance()->allow_any_dcp_frame_rate ()) {
587 _frame_rate_choice->Hide ();
588 _frame_rate_spin->Show ();
590 _frame_rate_choice->Show ();
591 _frame_rate_spin->Hide ();
594 _frame_rate_sizer->Layout ();
598 DCPPanel::make_video_panel ()
600 wxPanel* panel = new wxPanel (_notebook);
601 wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
602 wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
603 sizer->Add (grid, 0, wxALL, 8);
604 panel->SetSizer (sizer);
608 add_label_to_sizer (grid, panel, _("Container"), true, wxGBPosition (r, 0));
610 wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL);
611 _container = new wxChoice (panel, wxID_ANY);
612 s->Add (_container, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP);
613 _container_size = new wxStaticText (panel, wxID_ANY, wxT (""));
614 s->Add (_container_size, 1, wxLEFT | wxALIGN_CENTER_VERTICAL);
615 grid->Add (s, wxGBPosition (r,1 ), wxDefaultSpan, wxEXPAND);
619 add_label_to_sizer (grid, panel, _("Frame Rate"), true, wxGBPosition (r, 0));
621 _frame_rate_sizer = new wxBoxSizer (wxHORIZONTAL);
622 _frame_rate_choice = new wxChoice (panel, wxID_ANY);
623 _frame_rate_sizer->Add (_frame_rate_choice, 1, wxALIGN_CENTER_VERTICAL);
624 _frame_rate_spin = new wxSpinCtrl (panel, wxID_ANY);
625 _frame_rate_sizer->Add (_frame_rate_spin, 1, wxALIGN_CENTER_VERTICAL);
626 setup_frame_rate_widget ();
627 _best_frame_rate = new wxButton (panel, wxID_ANY, _("Use best"));
628 _frame_rate_sizer->Add (_best_frame_rate, 1, wxALIGN_CENTER_VERTICAL);
629 grid->Add (_frame_rate_sizer, wxGBPosition (r, 1));
633 _three_d = new wxCheckBox (panel, wxID_ANY, _("3D"));
634 grid->Add (_three_d, wxGBPosition (r, 0), wxGBSpan (1, 2));
637 add_label_to_sizer (grid, panel, _("Resolution"), true, wxGBPosition (r, 0));
638 _resolution = new wxChoice (panel, wxID_ANY);
639 grid->Add (_resolution, wxGBPosition (r, 1));
643 add_label_to_sizer (grid, panel, _("JPEG2000 bandwidth"), true, wxGBPosition (r, 0));
644 wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
645 _j2k_bandwidth = new wxSpinCtrl (panel, wxID_ANY);
646 s->Add (_j2k_bandwidth, 1);
647 add_label_to_sizer (s, panel, _("Mbit/s"), false);
648 grid->Add (s, wxGBPosition (r, 1));
652 _container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::container_changed, this));
653 _frame_rate_choice->Bind(wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::frame_rate_choice_changed, this));
654 _frame_rate_spin->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::frame_rate_spin_changed, this));
655 _best_frame_rate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::best_frame_rate_clicked, this));
656 _j2k_bandwidth->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
657 /* Also listen to wxEVT_COMMAND_TEXT_UPDATED so that typing numbers directly in is always noticed */
658 _j2k_bandwidth->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::j2k_bandwidth_changed, this));
659 _resolution->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::resolution_changed, this));
660 _three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::three_d_changed, this));
662 vector<Ratio const *> const ratio = Ratio::all ();
663 for (vector<Ratio const *>::const_iterator i = ratio.begin(); i != ratio.end(); ++i) {
664 _container->Append (std_to_wx ((*i)->nickname ()));
667 list<int> const dfr = Config::instance()->allowed_dcp_frame_rates ();
668 for (list<int>::const_iterator i = dfr.begin(); i != dfr.end(); ++i) {
669 _frame_rate_choice->Append (std_to_wx (boost::lexical_cast<string> (*i)));
672 _j2k_bandwidth->SetRange (1, Config::instance()->maximum_j2k_bandwidth() / 1000000);
673 _frame_rate_spin->SetRange (1, 480);
675 _resolution->Append (_("2K"));
676 _resolution->Append (_("4K"));
682 DCPPanel::minimum_allowed_audio_channels () const
685 if (_film && _film->audio_processor ()) {
686 min = _film->audio_processor()->out_channels ();
697 DCPPanel::setup_audio_channels_choice ()
699 vector<pair<string, string> > items;
700 for (int i = minimum_allowed_audio_channels(); i <= 12; i += 2) {
701 items.push_back (make_pair (dcp::raw_convert<string> (i), dcp::raw_convert<string> (i)));
704 checked_set (_audio_channels, items);
708 DCPPanel::make_audio_panel ()
710 wxPanel* panel = new wxPanel (_notebook);
711 wxSizer* sizer = new wxBoxSizer (wxVERTICAL);
712 wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
713 sizer->Add (grid, 0, wxALL, 8);
714 panel->SetSizer (sizer);
718 add_label_to_sizer (grid, panel, _("Channels"), true, wxGBPosition (r, 0));
719 _audio_channels = new wxChoice (panel, wxID_ANY);
720 setup_audio_channels_choice ();
721 grid->Add (_audio_channels, wxGBPosition (r, 1));
724 add_label_to_sizer (grid, panel, _("Processor"), true, wxGBPosition (r, 0));
725 _audio_processor = new wxChoice (panel, wxID_ANY);
726 _audio_processor->Append (_("None"), new wxStringClientData (N_("none")));
727 BOOST_FOREACH (AudioProcessor const * ap, AudioProcessor::all ()) {
728 _audio_processor->Append (std_to_wx (ap->name ()), new wxStringClientData (std_to_wx (ap->id ())));
730 grid->Add (_audio_processor, wxGBPosition (r, 1));
733 _show_audio = new wxButton (panel, wxID_ANY, _("Show audio..."));
734 grid->Add (_show_audio, wxGBPosition (r, 0), wxGBSpan (1, 2));
737 _audio_channels->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::audio_channels_changed, this));
738 _audio_processor->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::audio_processor_changed, this));
739 _show_audio->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::show_audio_clicked, this));
745 DCPPanel::copy_isdcf_name_button_clicked ()
747 _film->set_name (_film->isdcf_name (false));
748 _film->set_use_isdcf_name (false);
752 DCPPanel::audio_processor_changed ()
758 string const s = string_client_data (_audio_processor->GetClientObject (_audio_processor->GetSelection ()));
759 _film->set_audio_processor (AudioProcessor::from_id (s));
763 DCPPanel::show_audio_clicked ()
770 _audio_dialog->Destroy ();
774 AudioDialog* d = new AudioDialog (_panel, _film);
779 DCPPanel::reel_type_changed ()
785 _film->set_reel_type (static_cast<ReelType> (_reel_type->GetSelection ()));
789 DCPPanel::reel_length_changed ()
795 _film->set_reel_length (_reel_length->GetValue() * 1000000000LL);