Setup Butler::_prepare_only_proxy on construction.
[dcpomatic.git] / src / lib / util.h
index ceb30701c3bbb956819bd60f30f3116e67021e87..013eabe120678c415f28e176a115ed729a12eae3 100644 (file)
@@ -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<TextDecoder> decoder);
 extern bool show_jobs_on_console (bool progress);
-extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, boost::function<void (float)>);
+extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)>);
 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 <class T>
 std::list<T>
@@ -148,4 +150,12 @@ list_to_vector (std::list<T> v)
 extern double db_to_linear (double db);
 extern double linear_to_db (double linear);
 
+
+template <class T>
+T clamp (T val, T minimum, T maximum)
+{
+       return std::max(std::min(val, maximum), minimum);
+}
+
+
 #endif