/*
- Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2016 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
#include "lib/job_manager.h"
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
+#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
+using std::list;
using boost::shared_ptr;
using boost::bind;
using boost::optional;
AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<AudioContent> content)
: wxDialog (parent, wxID_ANY, _("Audio"), wxDefaultPosition, wxSize (640, 512), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxFULL_REPAINT_ON_RESIZE)
, _film (film)
+ , _content (content)
, _channels (film->audio_channels ())
, _plot (0)
{
++i;
}
- if (i == _channels && _channel_checkbox[0]) {
- _channel_checkbox[0]->SetValue (true);
- _plot->set_channel_visible (0, true);
+ if (i == _channels) {
+ /* Nothing checked; check mapped ones */
+
+ list<int> mapped;
+ shared_ptr<AudioContent> content = _content.lock ();
+
+ if (content) {
+ mapped = content->audio_mapping().mapped_output_channels ();
+ } else {
+ mapped = film->mapped_audio_channels ();
+ }
+
+ BOOST_FOREACH (int i, mapped) {
+ if (_channel_checkbox[i]) {
+ _channel_checkbox[i]->SetValue (true);
+ _plot->set_channel_visible (i, true);
+ }
+ }
}
i = 0;
}
}
+ /* XXX: check whether it's ok to add dB gain to these quantities */
+
if (static_cast<bool>(_analysis->integrated_loudness ())) {
- _integrated_loudness->SetLabel (wxString::Format (_("Integrated loudness %.2f LUFS"), _analysis->integrated_loudness().get()));
+ _integrated_loudness->SetLabel (
+ wxString::Format (
+ _("Integrated loudness %.2f LUFS"),
+ _analysis->integrated_loudness().get() + _analysis->gain_correction (_playlist)
+ )
+ );
}
if (static_cast<bool>(_analysis->loudness_range ())) {
- _loudness_range->SetLabel (wxString::Format (_("Loudness range %.2f LRA"), _analysis->loudness_range().get()));
+ _loudness_range->SetLabel (
+ wxString::Format (
+ _("Loudness range %.2f LU"),
+ _analysis->loudness_range().get() + _analysis->gain_correction (_playlist)
+ )
+ );
}
}