summaryrefslogtreecommitdiff
path: root/src/lib/hints.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-29 09:14:20 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-29 20:53:49 +0200
commit39fb8198febde1937019db1c300ec363aab5aa56 (patch)
tree52bc32134e8ae2b5587b3a62130baa9acf815b60 /src/lib/hints.cc
parentb249700e1da7dd6631a8b4440587f4093a2bdef1 (diff)
C++11 tidying.
Diffstat (limited to 'src/lib/hints.cc')
-rw-r--r--src/lib/hints.cc15
1 files changed, 10 insertions, 5 deletions
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<const Film> 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<boost::filesystem::path> 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)
{