#include <glib.h>
#include <openjpeg.h>
#include <pangomm/init.h>
+#ifdef DCPOMATIC_IMAGE_MAGICK
#include <magick/MagickCore.h>
+#else
+#include <magick/common.h>
+#include <magick/magick_config.h>
+#endif
#include <magick/version.h>
#include <dcp/version.h>
#include <dcp/util.h>
if (hours) {
if (m > 30 && !minutes) {
- ap << (h + 1) << N_(" ") << _("hours");
+ /* TRANSLATORS: h here is an abbreviation for hours */
+ ap << (h + 1) << _("h");
} else {
- ap << h << N_(" ");
- if (h == 1) {
- ap << _("hour");
- } else {
- ap << _("hours");
- }
+ /* TRANSLATORS: h here is an abbreviation for hours */
+ ap << h << _("h");
}
if (minutes | seconds) {
if (minutes) {
/* Minutes */
if (s > 30 && !seconds) {
- ap << (m + 1) << N_(" ") << _("minutes");
+ /* TRANSLATORS: m here is an abbreviation for minutes */
+ ap << (m + 1) << _("m");
} else {
- ap << m << N_(" ");
- if (m == 1) {
- ap << _("minute");
- } else {
- ap << _("minutes");
- }
+ /* TRANSLATORS: m here is an abbreviation for minutes */
+ ap << m << _("m");
}
if (seconds) {
if (seconds) {
/* Seconds */
- ap << s << N_(" ");
- if (s == 1) {
- ap << _("second");
- } else {
- ap << _("seconds");
- }
+ /* TRANSLATORS: s here is an abbreviation for seconds */
+ ap << s << _("s");
}
return ap.str ();
}
#endif
+void
+set_backtrace_file (boost::filesystem::path p)
+{
+ backtrace_file = p;
+}
+
/* From http://stackoverflow.com/questions/2443135/how-do-i-find-where-an-exception-was-thrown-in-c */
void
terminate ()
dcpomatic_setup ()
{
#ifdef DCPOMATIC_WINDOWS
- backtrace_file /= g_get_user_config_dir ();
- backtrace_file /= "backtrace.txt";
+ boost::filesystem::path p = g_get_user_config_dir ();
+ p /= "backtrace.txt";
+ set_backtrace_file (p);
SetUnhandledExceptionFilter(exception_handler);
/* Dark voodoo which, I think, gets boost::filesystem::path to
_acceptor->async_accept (_socket, boost::lambda::var(ec) = boost::lambda::_1);
do {
_io_service.run_one ();
- } while (ec == boost::asio::error::would_block );
+ } while (ec == boost::asio::error::would_block);
delete _acceptor;
_acceptor = 0;
return (ext == ".tif" || ext == ".tiff" || ext == ".jpg" || ext == ".jpeg" || ext == ".png" || ext == ".bmp" || ext == ".tga" || ext == ".dpx");
}
+bool
+valid_j2k_file (boost::filesystem::path f)
+{
+ string ext = f.extension().string();
+ transform (ext.begin(), ext.end(), ext.begin(), ::tolower);
+ return (ext == ".j2k" || ext == ".j2c");
+}
+
string
tidy_for_filename (string f)
{