DCP audio channel counts between 2 and 16 inclusive.
2015-03-25 Carl Hetherington <cth@carlh.net>
+ * Hand-apply ec3e6abf817b84d589f0782b01f5059dd3bf0953; only allow
+ even DCP audio channel counts between 2 and 16 inclusive.
+
* Hand-apply 3e3d3e46a74af7b3e6431033c7c80bd058c02cf6update;
full/play length in the timing panel when the DCP frame rate is
changed.
_signed = f.optional_bool_child("Signed").get_value_or (true);
_encrypted = f.bool_child ("Encrypted");
_audio_channels = f.number_child<int> ("AudioChannels");
+ /* We used to allow odd numbers (and zero) channels, but it's just not worth
+ the pain.
+ */
+ if (_audio_channels == 0) {
+ _audio_channels = 2;
+ } else if ((_audio_channels % 2) == 1) {
+ _audio_channels++;
+ }
_sequence_video = f.bool_child ("SequenceVideo");
_three_d = f.bool_child ("ThreeD");
_interop = f.bool_child ("Interop");
return;
}
- _film->set_audio_channels (_audio_channels->GetValue ());
+ _film->set_audio_channels ((_audio_channels->GetSelection () + 1) * 2);
}
void
break;
}
case Film::AUDIO_CHANNELS:
- checked_set (_audio_channels, _film->audio_channels ());
+ checked_set (_audio_channels, (_film->audio_channels () / 2) - 1);
setup_dcp_name ();
break;
case Film::THREE_D:
int r = 0;
add_label_to_grid_bag_sizer (grid, panel, _("Channels"), true, wxGBPosition (r, 0));
- _audio_channels = new wxSpinCtrl (panel, wxID_ANY);
+ _audio_channels = new wxChoice (panel, wxID_ANY);
+ for (int i = 2; i <= 16; i += 2) {
+ _audio_channels->Append (wxString::Format ("%d", i));
+ }
grid->Add (_audio_channels, wxGBPosition (r, 1));
++r;
- _audio_channels->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::audio_channels_changed, this));
-
- _audio_channels->SetRange (0, MAX_DCP_AUDIO_CHANNELS);
+ _audio_channels->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::audio_channels_changed, this));
return panel;
}
wxChoice* _frame_rate_choice;
wxSpinCtrl* _frame_rate_spin;
wxSizer* _frame_rate_sizer;
- wxSpinCtrl* _audio_channels;
+ wxChoice* _audio_channels;
wxButton* _best_frame_rate;
wxCheckBox* _three_d;
wxChoice* _resolution;
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by