X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fhints.cc;h=4d3b2d95ee91161fddbde42a84fe3ab17c5e5322;hb=8963f0007af1a312017b9627c18b82ec2a577591;hp=52debf3ef313c44f3d4b745810e2964fe28cb28e;hpb=c370c651eba466f5073384de8b304a2625c64b89;p=dcpomatic.git diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 52debf3ef..4d3b2d95e 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -18,6 +18,7 @@ */ + #include "dcp_content_type.h" #include "hints.h" #include "types.h" @@ -45,6 +46,7 @@ #include "i18n.h" + using std::cout; using std::make_shared; using std::max; @@ -82,12 +84,14 @@ Hints::Hints (weak_ptr weak_film) } + void Hints::start () { _thread = boost::thread (bind(&Hints::thread, this)); } + Hints::~Hints () { boost::this_thread::disable_interruption dis; @@ -256,7 +260,7 @@ Hints::check_big_font_files () for (auto i: film()->content()) { for (auto j: i->text) { for (auto k: j->fonts()) { - optional const p = k->file (); + auto const p = k->file (); if (p && boost::filesystem::file_size(p.get()) >= (MAX_FONT_FILE_SIZE - SIZE_SLACK)) { big_font_files = true; } @@ -276,7 +280,7 @@ Hints::check_vob () { int vob = 0; for (auto i: film()->content()) { - if (boost::algorithm::starts_with (i->path(0).filename().string(), "VTS_")) { + if (boost::algorithm::starts_with(i->path(0).filename().string(), "VTS_")) { ++vob; } } @@ -330,8 +334,8 @@ Hints::check_loudness () ch = ch.substr (0, ch.length() - 2); - if (!ch.empty ()) { - hint (String::compose ( + if (!ch.empty()) { + hint(String::compose( _("Your audio level is very high (on %1). You should reduce the gain of your audio content."), ch ) @@ -445,7 +449,7 @@ try bool ccap_mxf_too_big = false; bool subs_mxf_too_big = false; - boost::filesystem::path dcp_dir = film->dir("hints") / dcpomatic::get_process_id(); + auto dcp_dir = film->dir("hints") / dcpomatic::get_process_id(); boost::filesystem::remove_all (dcp_dir); _writer->finish (film->dir("hints") / dcpomatic::get_process_id()); @@ -491,6 +495,7 @@ catch (...) store_current (); } + void Hints::hint (string h) {