projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reset last write times on examine.
[dcpomatic.git]
/
src
/
lib
/
film.cc
diff --git
a/src/lib/film.cc
b/src/lib/film.cc
index 475d28b4f24b6c5af2c9923677344a8e07332eee..8576c5a670a18eb11d90d143d286b7120f485f76 100644
(file)
--- a/
src/lib/film.cc
+++ b/
src/lib/film.cc
@@
-51,6
+51,7
@@
#include "dcp_content.h"
#include "screen_kdm.h"
#include "cinema.h"
#include "dcp_content.h"
#include "screen_kdm.h"
#include "cinema.h"
+#include "change_signaller.h"
#include <libcxml/cxml.h>
#include <dcp/cpl.h>
#include <dcp/certificate_chain.h>
#include <libcxml/cxml.h>
#include <dcp/cpl.h>
#include <dcp/certificate_chain.h>
@@
-160,9
+161,9
@@
Film::Film (optional<boost::filesystem::path> dir)
{
set_isdcf_date_today ();
{
set_isdcf_date_today ();
- _playlist_change
d_connection = _playlist->Changed.connect (bind (&Film::playlist_changed, this
));
+ _playlist_change
_connection = _playlist->Change.connect (bind (&Film::playlist_change, this, _1
));
_playlist_order_changed_connection = _playlist->OrderChanged.connect (bind (&Film::playlist_order_changed, this));
_playlist_order_changed_connection = _playlist->OrderChanged.connect (bind (&Film::playlist_order_changed, this));
- _playlist_content_change
d_connection = _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2, _3
));
+ _playlist_content_change
_connection = _playlist->ContentChange.connect (bind (&Film::playlist_content_change, this, _1, _2, _3, _4
));
if (dir) {
/* Make state.directory a complete path without ..s (where possible)
if (dir) {
/* Make state.directory a complete path without ..s (where possible)
@@
-704,10
+705,10
@@
Film::isdcf_name (bool if_created_now) const
bool burnt_in = true;
bool ccap = false;
BOOST_FOREACH (shared_ptr<Content> i, content()) {
bool burnt_in = true;
bool ccap = false;
BOOST_FOREACH (shared_ptr<Content> i, content()) {
- BOOST_FOREACH (shared_ptr<TextContent> j, i->
caption
) {
- if (j->type() ==
CAPTION_OPEN
&& j->use() && !j->burn()) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->
text
) {
+ if (j->type() ==
TEXT_OPEN_SUBTITLE
&& j->use() && !j->burn()) {
burnt_in = false;
burnt_in = false;
- } else if (j->type() ==
CAPTION_CLOSED
) {
+ } else if (j->type() ==
TEXT_CLOSED_CAPTION
) {
ccap = true;
}
}
ccap = true;
}
}
@@
-782,13
+783,13
@@
Film::isdcf_name (bool if_created_now) const
continue;
}
continue;
}
- bool any_
caption
= false;
- for (int i = 0; i <
CAPTION
_COUNT; ++i) {
- if (dc->reference_
caption
(static_cast<TextType>(i))) {
- any_
caption
= true;
+ bool any_
text
= false;
+ for (int i = 0; i <
TEXT
_COUNT; ++i) {
+ if (dc->reference_
text
(static_cast<TextType>(i))) {
+ any_
text
= true;
}
}
}
}
- if (dc->reference_video() || dc->reference_audio() || any_
caption
) {
+ if (dc->reference_video() || dc->reference_audio() || any_
text
) {
vf = true;
}
}
vf = true;
}
}
@@
-824,133
+825,143
@@
Film::set_directory (boost::filesystem::path d)
void
Film::set_name (string n)
{
void
Film::set_name (string n)
{
+ ChangeSignaller<Film> ch (this, NAME);
_name = n;
_name = n;
- signal_changed (NAME);
}
void
Film::set_use_isdcf_name (bool u)
{
}
void
Film::set_use_isdcf_name (bool u)
{
+ ChangeSignaller<Film> ch (this, USE_ISDCF_NAME);
_use_isdcf_name = u;
_use_isdcf_name = u;
- signal_changed (USE_ISDCF_NAME);
}
void
Film::set_dcp_content_type (DCPContentType const * t)
{
}
void
Film::set_dcp_content_type (DCPContentType const * t)
{
+ ChangeSignaller<Film> ch (this, DCP_CONTENT_TYPE);
_dcp_content_type = t;
_dcp_content_type = t;
- signal_changed (DCP_CONTENT_TYPE);
}
void
Film::set_container (Ratio const * c)
{
}
void
Film::set_container (Ratio const * c)
{
+ ChangeSignaller<Film> ch (this, CONTAINER);
_container = c;
_container = c;
- signal_changed (CONTAINER);
}
void
Film::set_resolution (Resolution r)
{
}
void
Film::set_resolution (Resolution r)
{
+ ChangeSignaller<Film> ch (this, RESOLUTION);
_resolution = r;
_resolution = r;
- signal_changed (RESOLUTION);
}
void
Film::set_j2k_bandwidth (int b)
{
}
void
Film::set_j2k_bandwidth (int b)
{
+ ChangeSignaller<Film> ch (this, J2K_BANDWIDTH);
_j2k_bandwidth = b;
_j2k_bandwidth = b;
- signal_changed (J2K_BANDWIDTH);
}
void
Film::set_isdcf_metadata (ISDCFMetadata m)
{
}
void
Film::set_isdcf_metadata (ISDCFMetadata m)
{
+ ChangeSignaller<Film> ch (this, ISDCF_METADATA);
_isdcf_metadata = m;
_isdcf_metadata = m;
- signal_changed (ISDCF_METADATA);
}
void
Film::set_video_frame_rate (int f)
{
}
void
Film::set_video_frame_rate (int f)
{
+ ChangeSignaller<Film> ch (this, VIDEO_FRAME_RATE);
_video_frame_rate = f;
_video_frame_rate = f;
- signal_changed (VIDEO_FRAME_RATE);
}
void
Film::set_audio_channels (int c)
{
}
void
Film::set_audio_channels (int c)
{
+ ChangeSignaller<Film> ch (this, AUDIO_CHANNELS);
_audio_channels = c;
_audio_channels = c;
- signal_changed (AUDIO_CHANNELS);
}
void
Film::set_three_d (bool t)
{
}
void
Film::set_three_d (bool t)
{
+ ChangeSignaller<Film> ch (this, THREE_D);
_three_d = t;
_three_d = t;
- signal_changed (THREE_D);
if (_three_d && _isdcf_metadata.two_d_version_of_three_d) {
if (_three_d && _isdcf_metadata.two_d_version_of_three_d) {
+ ChangeSignaller<Film> ch (this, ISDCF_METADATA);
_isdcf_metadata.two_d_version_of_three_d = false;
_isdcf_metadata.two_d_version_of_three_d = false;
- signal_changed (ISDCF_METADATA);
}
}
void
Film::set_interop (bool i)
{
}
}
void
Film::set_interop (bool i)
{
+ ChangeSignaller<Film> ch (this, INTEROP);
_interop = i;
_interop = i;
- signal_changed (INTEROP);
}
void
Film::set_audio_processor (AudioProcessor const * processor)
{
}
void
Film::set_audio_processor (AudioProcessor const * processor)
{
+ ChangeSignaller<Film> ch1 (this, AUDIO_PROCESSOR);
+ ChangeSignaller<Film> ch2 (this, AUDIO_CHANNELS);
_audio_processor = processor;
_audio_processor = processor;
- signal_changed (AUDIO_PROCESSOR);
- signal_changed (AUDIO_CHANNELS);
}
void
Film::set_reel_type (ReelType t)
{
}
void
Film::set_reel_type (ReelType t)
{
+ ChangeSignaller<Film> ch (this, REEL_TYPE);
_reel_type = t;
_reel_type = t;
- signal_changed (REEL_TYPE);
}
/** @param r Desired reel length in bytes */
void
Film::set_reel_length (int64_t r)
{
}
/** @param r Desired reel length in bytes */
void
Film::set_reel_length (int64_t r)
{
+ ChangeSignaller<Film> ch (this, REEL_LENGTH);
_reel_length = r;
_reel_length = r;
- signal_changed (REEL_LENGTH);
}
void
Film::set_upload_after_make_dcp (bool u)
{
}
void
Film::set_upload_after_make_dcp (bool u)
{
+ ChangeSignaller<Film> ch (this, UPLOAD_AFTER_MAKE_DCP);
_upload_after_make_dcp = u;
_upload_after_make_dcp = u;
- signal_changed (UPLOAD_AFTER_MAKE_DCP);
}
void
}
void
-Film::signal_change
d (Property
p)
+Film::signal_change
(ChangeType type, int
p)
{
{
- _dirty = true;
+ signal_change (type, static_cast<Property>(p));
+}
- switch (p) {
- case Film::CONTENT:
- set_video_frame_rate (_playlist->best_video_frame_rate ());
- break;
- case Film::VIDEO_FRAME_RATE:
- case Film::SEQUENCE:
- _playlist->maybe_sequence ();
- break;
- default:
- break;
- }
+void
+Film::signal_change (ChangeType type, Property p)
+{
+ if (type == CHANGE_TYPE_DONE) {
+ _dirty = true;
+
+ switch (p) {
+ case Film::CONTENT:
+ set_video_frame_rate (_playlist->best_video_frame_rate ());
+ break;
+ case Film::VIDEO_FRAME_RATE:
+ case Film::SEQUENCE:
+ _playlist->maybe_sequence ();
+ break;
+ default:
+ break;
+ }
- emit (boost::bind (boost::ref (Changed), p));
+ emit (boost::bind (boost::ref (Change), type, p));
+ } else {
+ Change (type, p);
+ }
}
void
}
void
@@
-1027,22
+1038,22
@@
Film::cpls () const
void
Film::set_signed (bool s)
{
void
Film::set_signed (bool s)
{
+ ChangeSignaller<Film> ch (this, SIGNED);
_signed = s;
_signed = s;
- signal_changed (SIGNED);
}
void
Film::set_encrypted (bool e)
{
}
void
Film::set_encrypted (bool e)
{
+ ChangeSignaller<Film> ch (this, ENCRYPTED);
_encrypted = e;
_encrypted = e;
- signal_changed (ENCRYPTED);
}
void
Film::set_key (dcp::Key key)
{
}
void
Film::set_key (dcp::Key key)
{
+ ChangeSignaller<Film> ch (this, KEY);
_key = key;
_key = key;
- signal_changed (KEY);
}
ContentList
}
ContentList
@@
-1102,8
+1113,8
@@
Film::add_content (shared_ptr<Content> c)
/* Add {video,subtitle} content after any existing {video,subtitle} content */
if (c->video) {
c->set_position (_playlist->video_end());
/* Add {video,subtitle} content after any existing {video,subtitle} content */
if (c->video) {
c->set_position (_playlist->video_end());
- } else if (!c->
caption
.empty()) {
- c->set_position (_playlist->
caption
_end());
+ } else if (!c->
text
.empty()) {
+ c->set_position (_playlist->
text
_end());
}
if (_template_film) {
}
if (_template_film) {
@@
-1154,30
+1165,33
@@
Film::active_frame_rate_change (DCPTime t) const
}
void
}
void
-Film::playlist_content_change
d (
weak_ptr<Content> c, int p, bool frequent)
+Film::playlist_content_change
(ChangeType type,
weak_ptr<Content> c, int p, bool frequent)
{
{
- _dirty = true;
-
if (p == ContentProperty::VIDEO_FRAME_RATE) {
if (p == ContentProperty::VIDEO_FRAME_RATE) {
- s
et_video_frame_rate (_playlist->best_video_frame_rate ()
);
+ s
ignal_change (type, Film::CONTENT
);
} else if (p == AudioContentProperty::STREAMS) {
} else if (p == AudioContentProperty::STREAMS) {
- signal_change
d (
NAME);
+ signal_change
(type, Film::
NAME);
}
}
- emit (boost::bind (boost::ref (ContentChanged), c, p, frequent));
+ if (type == CHANGE_TYPE_DONE) {
+ emit (boost::bind (boost::ref (ContentChange), type, c, p, frequent));
+ } else {
+ ContentChange (type, c, p, frequent);
+ }
}
void
}
void
-Film::playlist_change
d (
)
+Film::playlist_change
(ChangeType type
)
{
{
- signal_change
d (
CONTENT);
- signal_change
d (
NAME);
+ signal_change
(type,
CONTENT);
+ signal_change
(type,
NAME);
}
void
Film::playlist_order_changed ()
{
}
void
Film::playlist_order_changed ()
{
- signal_changed (CONTENT_ORDER);
+ /* XXX: missing PENDING */
+ signal_change (CHANGE_TYPE_DONE, CONTENT_ORDER);
}
int
}
int
@@
-1199,9
+1213,9
@@
Film::set_sequence (bool s)
return;
}
return;
}
+ ChangeSignaller<Film> cc (this, SEQUENCE);
_sequence = s;
_playlist->set_sequence (s);
_sequence = s;
_playlist->set_sequence (s);
- signal_changed (SEQUENCE);
}
/** @return Size of the largest possible image in whatever resolution we are using */
}
/** @return Size of the largest possible image in whatever resolution we are using */
@@
-1391,7
+1405,7
@@
Film::subtitle_language () const
set<string> languages;
BOOST_FOREACH (shared_ptr<Content> i, content()) {
set<string> languages;
BOOST_FOREACH (shared_ptr<Content> i, content()) {
- BOOST_FOREACH (shared_ptr<TextContent> j, i->
caption
) {
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->
text
) {
languages.insert (j->language ());
}
}
languages.insert (j->language ());
}
}