#include "content_panel.h"
#include "audio_dialog.h"
#include "lib/config.h"
+#include "lib/ffmpeg_audio_stream.h"
#include "lib/ffmpeg_content.h"
#include "lib/cinema_sound_processor.h"
#include "lib/job_manager.h"
if (ac.size() == 1) {
_mapping->set (ac.front()->audio->mapping());
_mapping->set_input_channels (ac.front()->audio->channel_names ());
+
+ vector<AudioMappingView::Group> groups;
+ int c = 0;
+ BOOST_FOREACH (shared_ptr<const AudioStream> i, ac.front()->audio->streams()) {
+ shared_ptr<const FFmpegAudioStream> f = dynamic_pointer_cast<const FFmpegAudioStream> (i);
+ string name = "";
+ if (f) {
+ name = f->name;
+ if (f->codec_name) {
+ name += " (" + f->codec_name.get() + ")";
+ }
+ }
+ groups.push_back (AudioMappingView::Group (c, c + i->channels() - 1, name));
+ c += i->channels ();
+ }
+ _mapping->set_input_groups (groups);
+
} else {
_mapping->set (AudioMapping ());
}
d->set_reference_audio (_reference->GetValue ());
}
+
+void
+AudioPanel::set_film (shared_ptr<Film>)
+{
+ /* We are changing film, so destroy any audio dialog for the old one */
+ if (_audio_dialog) {
+ _audio_dialog->Destroy ();
+ _audio_dialog = 0;
+ }
+}