}
if (!boost::filesystem::exists (_content->audio_analysis_path())) {
+ _plot->set_analysis (shared_ptr<AudioAnalysis> ());
_analysis_finished_connection = _content->analyse_audio (bind (&AudioDialog::analysis_finished, this));
return;
}
a.reset (new AudioAnalysis (_content->audio_analysis_path ()));
_plot->set_analysis (a);
- if (_channel_checkbox[0]) {
+ /* Set up some defaults if no check boxes are checked */
+
+ int i = 0;
+ while (i < MAX_DCP_AUDIO_CHANNELS && (!_channel_checkbox[i] || !_channel_checkbox[i]->GetValue ())) {
+ ++i;
+ }
+
+ if (i == MAX_DCP_AUDIO_CHANNELS && _channel_checkbox[0]) {
_channel_checkbox[0]->SetValue (true);
+ _plot->set_channel_visible (0, true);
}
- _plot->set_channel_visible (0, true);
- for (int i = 0; i < AudioPoint::COUNT; ++i) {
- _type_checkbox[i]->SetValue (true);
- _plot->set_type_visible (i, true);
+ i = 0;
+ while (i < AudioPoint::COUNT && !_type_checkbox[i]->GetValue ()) {
+ i++;
+ }
+
+ if (i == AudioPoint::COUNT) {
+ for (int i = 0; i < AudioPoint::COUNT; ++i) {
+ _type_checkbox[i]->SetValue (true);
+ _plot->set_type_visible (i, true);
+ }
}
}
++c;
}
- assert (c < MAX_DCP_AUDIO_CHANNELS);
+ DCPOMATIC_ASSERT (c < MAX_DCP_AUDIO_CHANNELS);
_plot->set_channel_visible (c, _channel_checkbox[c]->GetValue ());
}
{
if (p == AudioContentProperty::AUDIO_GAIN) {
_plot->set_gain (_content->audio_gain ());
+ } else if (p == AudioContentProperty::AUDIO_MAPPING) {
+ try_to_load_analysis ();
}
}
++t;
}
- assert (t < AudioPoint::COUNT);
+ DCPOMATIC_ASSERT (t < AudioPoint::COUNT);
_plot->set_type_visible (t, _type_checkbox[t]->GetValue ());
}