#include "compose.hpp"
#include "dcp_decoder.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "text_content.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
int const DCPContentProperty::TEXTS = 606;
int const DCPContentProperty::CPL = 607;
-#define LOG_GENERAL(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
DCPContent::DCPContent (boost::filesystem::path p)
: _encrypted (false)
, _needs_assets (false)
void
DCPContent::read_directory (boost::filesystem::path p)
{
- LOG_GENERAL ("DCPContent::read_directory reads %1", p.string());
- for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
- if (boost::filesystem::is_regular_file (i->path())) {
- LOG_GENERAL ("Inside there's regular file %1", i->path().string());
- add_path (i->path());
- } else if (boost::filesystem::is_directory (i->path ())) {
- LOG_GENERAL ("Inside there's directory %1", i->path().string());
- read_directory (i->path());
- }
- }
+ read_sub_directory (p);
bool have_assetmap = false;
BOOST_FOREACH (boost::filesystem::path i, paths()) {
}
}
+void
+DCPContent::read_sub_directory (boost::filesystem::path p)
+{
+ LOG_GENERAL ("DCPContent::read_sub_directory reads %1", p.string());
+ for (boost::filesystem::directory_iterator i(p); i != boost::filesystem::directory_iterator(); ++i) {
+ if (boost::filesystem::is_regular_file (i->path())) {
+ LOG_GENERAL ("Inside there's regular file %1", i->path().string());
+ add_path (i->path());
+ } else if (boost::filesystem::is_directory (i->path ())) {
+ LOG_GENERAL ("Inside there's directory %1", i->path().string());
+ read_sub_directory (i->path());
+ }
+ }
+}
+
void
DCPContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
{
AudioStreamPtr as (new AudioStream (examiner->audio_frame_rate(), examiner->audio_length(), examiner->audio_channels()));
audio->set_stream (as);
AudioMapping m = as->mapping ();
- film->make_audio_mapping_default (m);
+ m.make_default (film ? film->audio_processor() : 0);
as->set_mapping (m);
}
return DCPTime::from_frames (llrint(video->length() * frc.factor()), film->video_frame_rate());
}
+DCPTime
+DCPContent::approximate_length () const
+{
+ if (!video) {
+ return DCPTime();
+ }
+ return DCPTime::from_frames (video->length(), 24);
+}
+
string
DCPContent::identifier () const
{
void
DCPContent::add_properties (shared_ptr<const Film> film, list<UserProperty>& p) const
{
- Content::add_properties (p);
+ Content::add_properties (film, p);
if (video) {
video->add_properties (p);
}