using libdcp::Size;
using libdcp::Signer;
-int const Film::state_version = 5;
+/* 5 -> 6
+ * AudioMapping XML changed.
+ * 6 -> 7
+ * Subtitle offset changed to subtitle y offset, and subtitle x offset added.
+ */
+int const Film::state_version = 7;
/** Construct a Film object in a given directory.
*
#else
log()->log ("libdcp built in optimised mode.");
#endif
+
+#ifdef DCPOMATIC_WINDOWS
+ OSVERSIONINFO info;
+ info.dwOSVersionInfoSize = sizeof (info);
+ GetVersionEx (&info);
+ log()->log (String::compose ("Windows version %1.%2.%3 SP %4", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber, info.szCSDVersion));
+#endif
+
log()->log (String::compose ("CPU: %1, %2 processors", cpu_info(), boost::thread::hardware_concurrency ()));
list<pair<string, string> > const m = mount_info ();
for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) {
return _playlist->has_subtitles ();
}
-OutputVideoFrame
+VideoFrame
Film::best_video_frame_rate () const
{
return _playlist->best_dcp_frame_rate ();
}
-bool
-Film::content_paths_valid () const
-{
- return _playlist->content_paths_valid ();
-}
-
FrameRateChange
Film::active_frame_rate_change (DCPTime t) const
{
signal_changed (CONTENT);
}
-OutputAudioFrame
+AudioFrame
Film::time_to_audio_frames (DCPTime t) const
{
return t * audio_frame_rate () / TIME_HZ;
}
-OutputVideoFrame
+VideoFrame
Film::time_to_video_frames (DCPTime t) const
{
return t * video_frame_rate () / TIME_HZ;
}
DCPTime
-Film::audio_frames_to_time (OutputAudioFrame f) const
+Film::audio_frames_to_time (AudioFrame f) const
{
return f * TIME_HZ / audio_frame_rate ();
}
DCPTime
-Film::video_frames_to_time (OutputVideoFrame f) const
+Film::video_frames_to_time (VideoFrame f) const
{
return f * TIME_HZ / video_frame_rate ();
}
-OutputAudioFrame
+AudioFrame
Film::audio_frame_rate () const
{
/* XXX */
return kdms;
}
+
+/** @return The approximate disk space required to encode a DCP of this film with the
+ * current settings, in bytes.
+ */
+uint64_t
+Film::required_disk_space () const
+{
+ return uint64_t (j2k_bandwidth() / 8) * length() / TIME_HZ;
+}
+
+/** This method checks the disk that the Film is on and tries to decide whether or not
+ * there will be enough space to make a DCP for it. If so, true is returned; if not,
+ * false is returned and required and availabe are filled in with the amount of disk space
+ * required and available respectively (in Gb).
+ *
+ * Note: the decision made by this method isn't, of course, 100% reliable.
+ */
+bool
+Film::should_be_enough_disk_space (double& required, double& available) const
+{
+ boost::filesystem::space_info s = boost::filesystem::space (internal_video_mxf_dir ());
+ required = double (required_disk_space ()) / 1073741824.0f;
+ available = double (s.available) / 1073741824.0f;
+ return (available - required) > 1;
+}