d588620e70bf15da29cc242e4ae8d86977e8f36a from master; fix hang if you cancel a paused...
[dcpomatic.git] / src / wx / wx_util.cc
index ea8255f8169a9ae7fbddf01c5e771ed1dbc7bac1..9c13cfbcb69e741cbff7f8d8e42c8804bf62494e 100644 (file)
@@ -271,11 +271,9 @@ dcpomatic_setup_i18n ()
                locale->AddCatalogLookupPathPrefix (std_to_wx (mo_path().string()));
 #endif         
 
-#ifdef DCPOMATIC_POSIX
+#ifdef DCPOMATIC_LINUX
                locale->AddCatalogLookupPathPrefix (LINUX_LOCALE_PREFIX);
-#endif
 
-#ifdef DCPOMATIC_LINUX
                /* We have to include the wxWidgets .mo in our distribution,
                   so we rename it to avoid clashes with any other installation
                   of wxWidgets.
@@ -332,3 +330,17 @@ context_translation (wxString s)
 
        return t;
 }
+
+wxString
+time_to_timecode (DCPTime t, float fps)
+{
+       double w = t.seconds ();
+       int const h = (w / 3600);
+       w -= h * 3600;
+       int const m = (w / 60);
+       w -= m * 60;
+       int const s = floor (w);
+       w -= s;
+       int const f = rint (w * fps);
+       return wxString::Format (wxT("%02d:%02d:%02d.%02d"), h, m, s, f);
+}