X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.h;h=12c79ea5a374cabe566d751e9f5c250db71b22ba;hb=a16523af5f70b60f4890f198f6214177077a9c1d;hp=bdf2480fcd5ae08bd9108f730421835a89072931;hpb=9da0bac018e0e7dcad0c1aafaa7f6be6d434da96;p=dcpomatic.git diff --git a/src/lib/util.h b/src/lib/util.h index bdf2480fc..12c79ea5a 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington + Copyright (C) 2012-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -29,9 +29,11 @@ #include "dcpomatic_time.h" #include "audio_mapping.h" #include +#include #include #include #include +#include #include #include #include @@ -61,15 +63,20 @@ namespace dcp { #define CLOSED_CAPTION_LINES 3 /** Maximum line length of closed caption viewers */ #define CLOSED_CAPTION_LENGTH 30 +/* We are mis-using genre here, as only some metadata tags are written/read. + I tried the use_metadata_tags option but it didn't seem to make any difference. +*/ +#define SWAROOP_ID_TAG "genre" extern std::string program_name; extern bool is_batch_converter; struct AVSubtitle; class AudioBuffers; +class TextDecoder; extern std::string seconds_to_hms (int); -extern std::string time_to_hmsf (DCPTime time, Frame rate); +extern std::string time_to_hmsf (dcpomatic::DCPTime time, Frame rate); extern std::string seconds_to_approximate_hms (int); extern double seconds (struct timeval); extern void dcpomatic_setup (); @@ -100,9 +107,28 @@ extern boost::shared_ptr remap (boost::shared_ptr decoder); +extern bool show_jobs_on_console (bool progress); +extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, boost::function); #ifdef DCPOMATIC_VARIANT_SWAROOP extern boost::shared_ptr read_swaroop_chain (boost::filesystem::path path); extern void write_swaroop_chain (boost::shared_ptr chain, boost::filesystem::path output); #endif +template +std::list +vector_to_list (std::vector v) +{ + std::list l; + BOOST_FOREACH (T& i, v) { + l.push_back (i); + } + return l; +} + +extern double db_to_linear (double db); +extern double linear_to_db (double linear); + #endif