X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.h;h=f5218653dafb05e106e11546da72c14ad79ac825;hb=951d70db4f81b5ddd4093f11853637c8ecbe63c5;hp=bdf2480fcd5ae08bd9108f730421835a89072931;hpb=9da0bac018e0e7dcad0c1aafaa7f6be6d434da96;p=dcpomatic.git diff --git a/src/lib/util.h b/src/lib/util.h index bdf2480fc..f5218653d 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -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,23 @@ extern boost::shared_ptr remap (boost::shared_ptr decoder); #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; +} + #endif