X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Futil.h;h=013eabe120678c415f28e176a115ed729a12eae3;hb=6cac49dc50dae6b173135df101d532f20031ca70;hp=ceb30701c3bbb956819bd60f30f3116e67021e87;hpb=a5d004b0773f633401528392fc28e66d70e13ac8;p=dcpomatic.git diff --git a/src/lib/util.h b/src/lib/util.h index ceb30701c..013eabe12 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -118,10 +118,12 @@ extern size_t utf8_strlen (std::string s); extern std::string day_of_week_to_string (boost::gregorian::greg_weekday d); extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, std::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); +extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function); extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container); extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm); extern boost::filesystem::path default_font_file (); +extern std::string to_upper (std::string s); +extern void start_of_thread (std::string name); template std::list @@ -148,4 +150,12 @@ list_to_vector (std::list v) extern double db_to_linear (double db); extern double linear_to_db (double linear); + +template +T clamp (T val, T minimum, T maximum) +{ + return std::max(std::min(val, maximum), minimum); +} + + #endif