return vector<string> (n.begin(), n.begin() + audio_channels ());
}
-
-int
-Film::audio_channels () const
-{
- int minimum = 0;
- if (_audio_processor) {
- minimum = _audio_processor->out_channels ();
- }
-
- if (minimum % 2 == 1) {
- ++minimum;
- }
-
- return max (minimum, _audio_channels);
-}
return _video_frame_rate;
}
- int audio_channels () const;
+ int audio_channels () const {
+ return _audio_channels;
+ }
bool three_d () const {
return _three_d;
int _video_frame_rate;
/** The date that we should use in a ISDCF name */
boost::gregorian::date _isdcf_date;
- /** Number of audio channels requested for the DCP; this will be overridden
- if we are using an audio processor which outputs more channels.
- */
+ /** Number of audio channels requested for the DCP */
int _audio_channels;
/** If true, the DCP will be written in 3D mode; otherwise in 2D.
This will be regardless of what content is on the playlist.
using std::string;
using std::vector;
using std::pair;
+using std::max;
using std::make_pair;
using boost::lexical_cast;
using boost::shared_ptr;
break;
}
case Film::AUDIO_CHANNELS:
- checked_set (_audio_channels, dcp::raw_convert<string> (_film->audio_channels ()));
- setup_dcp_name ();
+ if (_film->audio_channels () < minimum_allowed_audio_channels ()) {
+ _film->set_audio_channels (minimum_allowed_audio_channels ());
+ } else {
+ checked_set (_audio_channels, dcp::raw_convert<string> (max (minimum_allowed_audio_channels(), _film->audio_channels ())));
+ setup_dcp_name ();
+ }
break;
case Film::THREE_D:
checked_set (_three_d, _film->three_d ());
return panel;
}
-void
-DCPPanel::setup_audio_channels_choice ()
+int
+DCPPanel::minimum_allowed_audio_channels () const
{
int min = 2;
if (_film && _film->audio_processor ()) {
++min;
}
+ return min;
+}
+
+void
+DCPPanel::setup_audio_channels_choice ()
+{
vector<pair<string, string> > items;
- for (int i = min; i <= 12; i += 2) {
+ for (int i = minimum_allowed_audio_channels(); i <= 12; i += 2) {
items.push_back (make_pair (dcp::raw_convert<string> (i), dcp::raw_convert<string> (i)));
}
void setup_dcp_name ();
void setup_audio_channels_choice ();
+ int minimum_allowed_audio_channels () const;
+
wxPanel* make_general_panel ();
wxPanel* make_video_panel ();
wxPanel* make_audio_panel ();