using std::string;
using std::vector;
using std::wstring;
-using boost::thread;
-using boost::optional;
-using boost::lexical_cast;
using boost::bad_lexical_cast;
+using boost::lexical_cast;
+using boost::optional;
using boost::scoped_array;
+using boost::thread;
using dcp::Size;
-using dcp::raw_convert;
using dcp::locale_convert;
+using dcp::raw_convert;
using namespace dcpomatic;
static boost::thread::id ui_thread;
static boost::filesystem::path backtrace_file;
+
/** Convert some number of seconds to a string representation
* in hours, minutes and seconds.
*
return buffer;
}
+
string
time_to_hmsf (DCPTime time, Frame rate)
{
return buffer;
}
+
/** @param s Number of seconds.
* @return String containing an approximate description of s (e.g. "about 2 hours")
*/
return ap;
}
+
double
seconds (struct timeval t)
{
return t.tv_sec + (double (t.tv_usec) / 1e6);
}
+
#ifdef DCPOMATIC_WINDOWS
/** Resolve symbol name and source location given the path to the executable */
return system(addr2line_cmd);
}
+
DCPOMATIC_DISABLE_WARNINGS
/** This is called when C signals occur on Windows (e.g. SIGSEGV)
* (NOT C++ exceptions!). We write a backtrace to backtrace_file by dark means.
DCPOMATIC_ENABLE_WARNINGS
#endif
+
void
set_backtrace_file (boost::filesystem::path p)
{
backtrace_file = p;
}
+
/** This is called when there is an unhandled exception. Any
* backtrace in this function is useless on Windows as the stack has
* already been unwound from the throw; we have the gdb wrap hack to
abort();
}
+
void
dcpomatic_setup_path_encoding ()
{
#endif
}
+
/** Call the required functions to set up DCP-o-matic's static arrays, etc.
* Must be called from the UI thread, if there is one.
*/
ui_thread = boost::this_thread::get_id ();
}
+
#ifdef DCPOMATIC_WINDOWS
boost::filesystem::path
mo_path ()
}
#endif
+
#ifdef DCPOMATIC_OSX
boost::filesystem::path
mo_path ()
}
#endif
+
void
dcpomatic_setup_gettext_i18n (string lang)
{
#endif
}
+
/** Compute a digest of the first and last `size' bytes of a set of files. */
string
digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size)
return a - (a % t);
}
+
/** Trip an assert if the caller is not in the UI thread */
void
ensure_ui_thread ()
DCPOMATIC_ASSERT (boost::this_thread::get_id() == ui_thread);
}
+
string
audio_channel_name (int c)
{
return channels[c];
}
+
string
short_audio_channel_name (int c)
{
);
}
+
bool
valid_sound_file (boost::filesystem::path f)
{
return (ext == ".wav" || ext == ".mp3" || ext == ".aif" || ext == ".aiff");
}
+
bool
valid_j2k_file (boost::filesystem::path f)
{
return (ext == ".j2k" || ext == ".j2c" || ext == ".jp2");
}
+
string
tidy_for_filename (string f)
{
return f;
}
+
dcp::Size
fit_ratio_within (float ratio, dcp::Size full_frame)
{
return dcp::Size (full_frame.width, lrintf (full_frame.width / ratio));
}
+
void *
wrapped_av_malloc (size_t s)
{
return p;
}
+
map<string, string>
split_get_request (string url)
{
return r;
}
+
string
video_asset_filename (shared_ptr<dcp::PictureAsset> asset, int reel_index, int reel_count, optional<string> summary)
{
return Config::instance()->dcp_asset_filename_format().get(values, "_" + asset->id() + ".mxf");
}
+
string
audio_asset_filename (shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count, optional<string> summary)
{
return boost::locale::conv::utf_to_utf<char>(out);
}
+
/** @param mapped List of mapped audio channels from a Film.
* @param channels Total number of channels in the Film.
* @return First: number of non-LFE soundtrack channels (L/R/C/Ls/Rs/Lc/Rc/Bsl/Bsr), second: number of LFE channels.
return make_pair (non_lfe, lfe);
}
+
shared_ptr<AudioBuffers>
remap (shared_ptr<const AudioBuffers> input, int output_channels, AudioMapping map)
{
return mapped;
}
+
Eyes
increment_eyes (Eyes e)
{
return Eyes::LEFT;
}
+
void
checked_fwrite (void const * ptr, size_t size, FILE* stream, boost::filesystem::path path)
{
}
}
+
void
checked_fread (void* ptr, size_t size, FILE* stream, boost::filesystem::path path)
{
}
}
+
size_t
utf8_strlen (string s)
{
return N;
}
+
string
day_of_week_to_string (boost::gregorian::greg_weekday d)
{
return d.as_long_string ();
}
+
/** @param size Size of picture that the subtitle will be overlaid onto */
void
emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, shared_ptr<TextDecoder> decoder)
decoder->emit_bitmap (period, image, rect);
}
+
bool
show_jobs_on_console (bool progress)
{
return error;
}
+
/** XXX: could use mmap? */
void
copy_in_bits (boost::filesystem::path from, boost::filesystem::path to, std::function<void (float)> progress)
free (buffer);
}
+
double
db_to_linear (double db)
{
return pow(10, db / 20);
}
+
double
linear_to_db (double linear)
{