C++11 tidying.
[dcpomatic.git] / src / lib / hints.cc
index 4d3b2d95ee91161fddbde42a84fe3ab17c5e5322..64122db8d5bab6be1ab41a6d14d5c68933a66d2a 100644 (file)
 */
 
 
+#include "audio_analysis.h"
+#include "audio_content.h"
+#include "audio_processor.h"
+#include "compose.hpp"
+#include "content.h"
+#include "cross.h"
 #include "dcp_content_type.h"
-#include "hints.h"
-#include "types.h"
 #include "film.h"
-#include "content.h"
-#include "video_content.h"
-#include "text_content.h"
-#include "audio_processor.h"
 #include "font.h"
 #include "font_data.h"
+#include "hints.h"
+#include "player.h"
 #include "ratio.h"
-#include "audio_analysis.h"
-#include "compose.hpp"
+#include "text_content.h"
+#include "types.h"
 #include "util.h"
-#include "cross.h"
-#include "player.h"
+#include "video_content.h"
 #include "writer.h"
 #include <dcp/cpl.h>
 #include <dcp/raw_convert.h>
@@ -156,7 +157,7 @@ Hints::check_unusual_container ()
 {
        auto const film_container = film()->container()->id();
        if (film_container != "185" && film_container != "239") {
-               hint (_("Your DCP uses an unusual container ratio.  This may cause problems on some projectors.  If possible, use Flat or Scope for the DCP container ratio"));
+               hint (_("Your DCP uses an unusual container ratio.  This may cause problems on some projectors.  If possible, use Flat or Scope for the DCP container ratio."));
        }
 }
 
@@ -399,6 +400,7 @@ try
        check_ffec_and_ffmc_in_smpte_feature ();
        check_out_of_range_markers ();
        check_text_languages ();
+       check_audio_language ();
 
        if (check_loudness_done) {
                emit (bind(boost::ref(Progress), _("Examining subtitles and closed captions")));
@@ -636,3 +638,20 @@ Hints::check_text_languages ()
                }
        }
 }
+
+
+void
+Hints::check_audio_language ()
+{
+       auto content = film()->content();
+       auto mapped_audio =
+               std::find_if(content.begin(), content.end(), [](shared_ptr<const Content> c) {
+                       return c->audio && !c->audio->mapping().mapped_output_channels().empty();
+               });
+
+       if (mapped_audio != content.end() && !film()->audio_language()) {
+               hint (_("Some of your content has audio but you have not set the audio language.  It is advisable to set the audio language "
+                       "in the \"DCP\" tab unless your audio has no spoken parts."));
+       }
+}
+