#include <dcp/local_time.h>
#include <dcp/decrypted_kdm.h>
#include <dcp/raw_convert.h>
-#include <dcp/reel_mxf.h>
+#include <dcp/reel_file_asset.h>
#include <dcp/reel_asset.h>
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
, _use_isdcf_name (true)
, _dcp_content_type (Config::instance()->default_dcp_content_type ())
, _container (Config::instance()->default_container ())
- , _resolution (RESOLUTION_2K)
+ , _resolution (Resolution::TWO_K)
, _encrypted (false)
, _context_id (dcp::make_uuid ())
, _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ())
, _sequence (true)
, _interop (Config::instance()->default_interop ())
, _audio_processor (0)
- , _reel_type (REELTYPE_SINGLE)
+ , _reel_type (ReelType::SINGLE)
, _reel_length (2000000000)
, _reencode_j2k (false)
, _user_explicit_video_frame_rate (false)
, _audio_language (dcp::LanguageTag("en-US"))
, _release_territory (dcp::LanguageTag::RegionSubtag("US"))
, _version_number (1)
- , _status (dcp::FINAL)
- , _luminance (dcp::Luminance(4.5, dcp::Luminance::FOOT_LAMBERT))
+ , _status (dcp::Status::FINAL)
+ , _luminance (dcp::Luminance(4.5, dcp::Luminance::Unit::FOOT_LAMBERT))
, _state_version (current_state_version)
, _dirty (false)
, _tolerant (false)
}
}
- _reel_type = static_cast<ReelType> (f.optional_number_child<int>("ReelType").get_value_or (static_cast<int>(REELTYPE_SINGLE)));
+ _reel_type = static_cast<ReelType> (f.optional_number_child<int>("ReelType").get_value_or (static_cast<int>(ReelType::SINGLE)));
_reel_length = f.optional_number_child<int64_t>("ReelLength").get_value_or (2000000000);
_reencode_j2k = f.optional_bool_child("ReencodeJ2K").get_value_or(false);
_user_explicit_video_frame_rate = f.optional_bool_child("UserExplicitVideoFrameRate").get_value_or(false);
mapped.push_back (i);
}
} else {
- for (auto i: content ()) {
+ for (auto i: content()) {
if (i->audio) {
- auto c = i->audio->mapping().mapped_output_channels ();
- copy (c.begin(), c.end(), back_inserter (mapped));
+ auto c = i->audio->mapping().mapped_output_channels();
+ copy (c.begin(), c.end(), back_inserter(mapped));
}
}
/* XXX: this uses the first bit of content only */
/* Interior aspect ratio. The standard says we don't do this for trailers, for some strange reason */
- if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) {
+ if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::ContentKind::TRAILER) {
Ratio const* content_ratio = nullptr;
for (auto i: content ()) {
if (i->video) {
auto ccap = false;
for (auto i: content()) {
for (auto j: i->text) {
- if (j->type() == TEXT_OPEN_SUBTITLE && j->use() && !j->burn()) {
+ if (j->type() == TextType::OPEN_SUBTITLE && j->use() && !j->burn()) {
burnt_in = false;
- } else if (j->type() == TEXT_CLOSED_CAPTION && j->use()) {
+ } else if (j->type() == TextType::CLOSED_CAPTION && j->use()) {
ccap = true;
}
}
d += String::compose("_%1%2", ch.first, ch.second);
}
- if (audio_channels() > static_cast<int>(dcp::HI) && find(mapped.begin(), mapped.end(), dcp::HI) != mapped.end()) {
+ if (audio_channels() > static_cast<int>(dcp::Channel::HI) && find(mapped.begin(), mapped.end(), static_cast<int>(dcp::Channel::HI)) != mapped.end()) {
d += "-HI";
}
- if (audio_channels() > static_cast<int>(dcp::VI) && find(mapped.begin(), mapped.end(), dcp::VI) != mapped.end()) {
+ if (audio_channels() > static_cast<int>(dcp::Channel::VI) && find(mapped.begin(), mapped.end(), static_cast<int>(dcp::Channel::VI)) != mapped.end()) {
d += "-VI";
}
}
bool any_text = false;
- for (int i = 0; i < TEXT_COUNT; ++i) {
+ for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
if (dc->reference_text(static_cast<TextType>(i))) {
any_text = true;
}
void
Film::set_name (string n)
{
- ChangeSignaller<Film> ch (this, NAME);
+ FilmChangeSignaller ch (this, Property::NAME);
_name = n;
}
void
Film::set_use_isdcf_name (bool u)
{
- ChangeSignaller<Film> ch (this, USE_ISDCF_NAME);
+ FilmChangeSignaller ch (this, Property::USE_ISDCF_NAME);
_use_isdcf_name = u;
}
void
Film::set_dcp_content_type (DCPContentType const * t)
{
- ChangeSignaller<Film> ch (this, DCP_CONTENT_TYPE);
+ FilmChangeSignaller ch (this, Property::DCP_CONTENT_TYPE);
_dcp_content_type = t;
}
void
Film::set_container (Ratio const * c, bool explicit_user)
{
- ChangeSignaller<Film> ch (this, CONTAINER);
+ FilmChangeSignaller ch (this, Property::CONTAINER);
_container = c;
if (explicit_user) {
void
Film::set_resolution (Resolution r, bool explicit_user)
{
- ChangeSignaller<Film> ch (this, RESOLUTION);
+ FilmChangeSignaller ch (this, Property::RESOLUTION);
_resolution = r;
if (explicit_user) {
void
Film::set_j2k_bandwidth (int b)
{
- ChangeSignaller<Film> ch (this, J2K_BANDWIDTH);
+ FilmChangeSignaller ch (this, Property::J2K_BANDWIDTH);
_j2k_bandwidth = b;
}
void
Film::set_isdcf_metadata (ISDCFMetadata m)
{
- ChangeSignaller<Film> ch (this, ISDCF_METADATA);
+ FilmChangeSignaller ch (this, Property::ISDCF_METADATA);
_isdcf_metadata = m;
}
void
Film::set_video_frame_rate (int f, bool user_explicit)
{
- ChangeSignaller<Film> ch (this, VIDEO_FRAME_RATE);
+ FilmChangeSignaller ch (this, Property::VIDEO_FRAME_RATE);
_video_frame_rate = f;
if (user_explicit) {
_user_explicit_video_frame_rate = true;
void
Film::set_audio_channels (int c)
{
- ChangeSignaller<Film> ch (this, AUDIO_CHANNELS);
+ FilmChangeSignaller ch (this, Property::AUDIO_CHANNELS);
_audio_channels = c;
}
void
Film::set_three_d (bool t)
{
- ChangeSignaller<Film> ch (this, THREE_D);
+ FilmChangeSignaller ch (this, Property::THREE_D);
_three_d = t;
if (_three_d && _isdcf_metadata.two_d_version_of_three_d) {
- ChangeSignaller<Film> ch (this, ISDCF_METADATA);
+ FilmChangeSignaller ch (this, Property::ISDCF_METADATA);
_isdcf_metadata.two_d_version_of_three_d = false;
}
}
void
Film::set_interop (bool i)
{
- ChangeSignaller<Film> ch (this, INTEROP);
+ FilmChangeSignaller ch (this, Property::INTEROP);
_interop = i;
}
void
Film::set_audio_processor (AudioProcessor const * processor)
{
- ChangeSignaller<Film> ch1 (this, AUDIO_PROCESSOR);
- ChangeSignaller<Film> ch2 (this, AUDIO_CHANNELS);
+ FilmChangeSignaller ch1 (this, Property::AUDIO_PROCESSOR);
+ FilmChangeSignaller ch2 (this, Property::AUDIO_CHANNELS);
_audio_processor = processor;
}
void
Film::set_reel_type (ReelType t)
{
- ChangeSignaller<Film> ch (this, REEL_TYPE);
+ FilmChangeSignaller ch (this, Property::REEL_TYPE);
_reel_type = t;
}
void
Film::set_reel_length (int64_t r)
{
- ChangeSignaller<Film> ch (this, REEL_LENGTH);
+ FilmChangeSignaller ch (this, Property::REEL_LENGTH);
_reel_length = r;
}
void
Film::set_reencode_j2k (bool r)
{
- ChangeSignaller<Film> ch (this, REENCODE_J2K);
+ FilmChangeSignaller ch (this, Property::REENCODE_J2K);
_reencode_j2k = r;
}
void
Film::signal_change (ChangeType type, Property p)
{
- if (type == CHANGE_TYPE_DONE) {
+ if (type == ChangeType::DONE) {
_dirty = true;
- if (p == Film::CONTENT) {
+ if (p == Property::CONTENT) {
if (!_user_explicit_video_frame_rate) {
set_video_frame_rate (best_video_frame_rate());
}
emit (boost::bind (boost::ref (Change), type, p));
- if (p == Film::VIDEO_FRAME_RATE || p == Film::SEQUENCE) {
+ if (p == Property::VIDEO_FRAME_RATE || p == Property::SEQUENCE) {
/* We want to call Playlist::maybe_sequence but this must happen after the
main signal emission (since the butler will see that emission and un-suspend itself).
*/
snprintf(buffer, sizeof(buffer), "%08d_%08" PRId64, reel, frame);
string s (buffer);
- if (eyes == EYES_LEFT) {
+ if (eyes == Eyes::LEFT) {
s += ".L";
- } else if (eyes == EYES_RIGHT) {
+ } else if (eyes == Eyes::RIGHT) {
s += ".R";
}
void
Film::set_encrypted (bool e)
{
- ChangeSignaller<Film> ch (this, ENCRYPTED);
+ FilmChangeSignaller ch (this, Property::ENCRYPTED);
_encrypted = e;
}
if (!_user_explicit_resolution) {
if (video->size_after_crop().width > 2048 || video->size_after_crop().height > 1080) {
- set_resolution (RESOLUTION_4K, false);
+ set_resolution (Resolution::FOUR_K, false);
} else {
- set_resolution (RESOLUTION_2K, false);
+ set_resolution (Resolution::TWO_K, false);
}
}
}
Film::playlist_content_change (ChangeType type, weak_ptr<Content> c, int p, bool frequent)
{
if (p == ContentProperty::VIDEO_FRAME_RATE) {
- signal_change (type, Film::CONTENT);
+ signal_change (type, Property::CONTENT);
} else if (p == AudioContentProperty::STREAMS) {
- signal_change (type, Film::NAME);
+ signal_change (type, Property::NAME);
}
- if (type == CHANGE_TYPE_DONE) {
+ if (type == ChangeType::DONE) {
emit (boost::bind (boost::ref (ContentChange), type, c, p, frequent));
if (!frequent) {
check_settings_consistency ();
void
Film::playlist_change (ChangeType type)
{
- signal_change (type, CONTENT);
- signal_change (type, NAME);
+ signal_change (type, Property::CONTENT);
+ signal_change (type, Property::NAME);
- if (type == CHANGE_TYPE_DONE) {
+ if (type == ChangeType::DONE) {
check_settings_consistency ();
}
d->set_reference_audio(false);
change_made = true;
}
- if (d->reference_text(TEXT_OPEN_SUBTITLE) && !d->can_reference_text(shared_from_this(), TEXT_OPEN_SUBTITLE, why_not)) {
- d->set_reference_text(TEXT_OPEN_SUBTITLE, false);
+ if (d->reference_text(TextType::OPEN_SUBTITLE) && !d->can_reference_text(shared_from_this(), TextType::OPEN_SUBTITLE, why_not)) {
+ d->set_reference_text(TextType::OPEN_SUBTITLE, false);
change_made = true;
}
- if (d->reference_text(TEXT_CLOSED_CAPTION) && !d->can_reference_text(shared_from_this(), TEXT_CLOSED_CAPTION, why_not)) {
- d->set_reference_text(TEXT_CLOSED_CAPTION, false);
+ if (d->reference_text(TextType::CLOSED_CAPTION) && !d->can_reference_text(shared_from_this(), TextType::CLOSED_CAPTION, why_not)) {
+ d->set_reference_text(TextType::CLOSED_CAPTION, false);
change_made = true;
}
}
Film::playlist_order_changed ()
{
/* XXX: missing PENDING */
- signal_change (CHANGE_TYPE_DONE, CONTENT_ORDER);
+ signal_change (ChangeType::DONE, Property::CONTENT_ORDER);
}
int
return;
}
- ChangeSignaller<Film> cc (this, SEQUENCE);
+ FilmChangeSignaller cc (this, Property::SEQUENCE);
_sequence = s;
_playlist->set_sequence (s);
}
Film::full_frame () const
{
switch (_resolution) {
- case RESOLUTION_2K:
+ case Resolution::TWO_K:
return dcp::Size (2048, 1080);
- case RESOLUTION_4K:
+ case Resolution::FOUR_K:
return dcp::Size (4096, 2160);
}
}
}
- map<shared_ptr<const dcp::ReelMXF>, dcp::Key> keys;
+ map<shared_ptr<const dcp::ReelFileAsset>, dcp::Key> keys;
- for (auto i: cpl->reel_mxfs()) {
+ for (auto i: cpl->reel_file_assets()) {
if (!i->key_id()) {
continue;
}
auto const len = length();
switch (reel_type ()) {
- case REELTYPE_SINGLE:
+ case ReelType::SINGLE:
p.push_back (DCPTimePeriod (DCPTime (), len));
break;
- case REELTYPE_BY_VIDEO_CONTENT:
+ case ReelType::BY_VIDEO_CONTENT:
{
/* Collect all reel boundaries */
list<DCPTime> split_points;
last = t;
}
}
+
+ if (!p.empty()) {
+ p.back().to = split_points.back();
+ }
break;
}
- case REELTYPE_BY_LENGTH:
+ case ReelType::BY_LENGTH:
{
DCPTime current;
/* Integer-divide reel length by the size of one frame to give the number of frames per reel,
for (auto j: i->text) {
/* XXX: Empty DCPTextTrack ends up being a magic value here - the "unknown" or "not specified" track */
auto dtt = j->dcp_track().get_value_or(DCPTextTrack());
- if (j->type() == TEXT_CLOSED_CAPTION && find(tt.begin(), tt.end(), dtt) == tt.end()) {
+ if (j->type() == TextType::CLOSED_CAPTION && find(tt.begin(), tt.end(), dtt) == tt.end()) {
tt.push_back (dtt);
}
}
void
Film::set_marker (dcp::Marker type, DCPTime time)
{
- ChangeSignaller<Film> ch (this, MARKERS);
+ FilmChangeSignaller ch (this, Property::MARKERS);
_markers[type] = time;
}
void
Film::unset_marker (dcp::Marker type)
{
- ChangeSignaller<Film> ch (this, MARKERS);
+ FilmChangeSignaller ch (this, Property::MARKERS);
_markers.erase (type);
}
void
Film::clear_markers ()
{
- ChangeSignaller<Film> ch (this, MARKERS);
+ FilmChangeSignaller ch (this, Property::MARKERS);
_markers.clear ();
}
void
Film::set_ratings (vector<dcp::Rating> r)
{
- ChangeSignaller<Film> ch (this, RATINGS);
+ FilmChangeSignaller ch (this, Property::RATINGS);
_ratings = r;
}
void
Film::set_content_versions (vector<string> v)
{
- ChangeSignaller<Film> ch (this, CONTENT_VERSIONS);
+ FilmChangeSignaller ch (this, Property::CONTENT_VERSIONS);
_content_versions = v;
}
void
Film::set_name_language (dcp::LanguageTag lang)
{
- ChangeSignaller<Film> ch (this, NAME_LANGUAGE);
+ FilmChangeSignaller ch (this, Property::NAME_LANGUAGE);
_name_language = lang;
}
void
Film::set_audio_language (dcp::LanguageTag lang)
{
- ChangeSignaller<Film> ch (this, AUDIO_LANGUAGE);
+ FilmChangeSignaller ch (this, Property::AUDIO_LANGUAGE);
_audio_language = lang;
}
void
Film::set_release_territory (dcp::LanguageTag::RegionSubtag region)
{
- ChangeSignaller<Film> ch (this, RELEASE_TERRITORY);
+ FilmChangeSignaller ch (this, Property::RELEASE_TERRITORY);
_release_territory = region;
}
void
Film::set_status (dcp::Status s)
{
- ChangeSignaller<Film> ch (this, STATUS);
+ FilmChangeSignaller ch (this, Property::STATUS);
_status = s;
}
void
Film::set_version_number (int v)
{
- ChangeSignaller<Film> ch (this, VERSION_NUMBER);
+ FilmChangeSignaller ch (this, Property::VERSION_NUMBER);
_version_number = v;
}
void
Film::set_chain (string c)
{
- ChangeSignaller<Film> ch (this, CHAIN);
+ FilmChangeSignaller ch (this, Property::CHAIN);
_chain = c;
}
void
Film::set_distributor (string d)
{
- ChangeSignaller<Film> ch (this, DISTRIBUTOR);
+ FilmChangeSignaller ch (this, Property::DISTRIBUTOR);
_distributor = d;
}
void
Film::set_luminance (dcp::Luminance l)
{
- ChangeSignaller<Film> ch (this, LUMINANCE);
+ FilmChangeSignaller ch (this, Property::LUMINANCE);
_luminance = l;
}
void
Film::unset_subtitle_language ()
{
- ChangeSignaller<Film> ch (this, SUBTITLE_LANGUAGES);
+ FilmChangeSignaller ch (this, Property::SUBTITLE_LANGUAGES);
_subtitle_languages.clear();
}
void
Film::set_subtitle_languages (vector<dcp::LanguageTag> languages)
{
- ChangeSignaller<Film> ch (this, SUBTITLE_LANGUAGES);
+ FilmChangeSignaller ch (this, Property::SUBTITLE_LANGUAGES);
_subtitle_languages = languages;
}
void
Film::set_facility (string f)
{
- ChangeSignaller<Film> ch (this, FACILITY);
+ FilmChangeSignaller ch (this, Property::FACILITY);
_facility = f;
}
Film::add_ffoc_lfoc (Markers& markers) const
{
if (markers.find(dcp::Marker::FFOC) == markers.end()) {
- markers[dcp::Marker::FFOC] = dcpomatic::DCPTime(0);
+ markers[dcp::Marker::FFOC] = dcpomatic::DCPTime::from_frames(1, video_frame_rate());
}
if (markers.find(dcp::Marker::LFOC) == markers.end()) {