summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-02-17 02:17:12 +0100
committerCarl Hetherington <cth@carlh.net>2025-02-17 02:17:12 +0100
commit3c7e18dca8f7f5c331cc0d23f44abd01341b6ec9 (patch)
treee2eba0a08363966c6f234f53d4c5c2ea4b80ba33
parent410624e0548f65b795b192367f9272eb6f5d7bdb (diff)
White space: content.{cc,h}
-rw-r--r--src/lib/content.cc204
-rw-r--r--src/lib/content.h110
2 files changed, 154 insertions, 160 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 5e6dd7e31..c5f82a375 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -64,22 +64,16 @@ int const ContentProperty::TRIM_END = 404;
int const ContentProperty::VIDEO_FRAME_RATE = 405;
-Content::Content ()
+Content::Content(DCPTime p)
+ : _position(p)
{
}
-Content::Content (DCPTime p)
- : _position (p)
+Content::Content(boost::filesystem::path p)
{
-
-}
-
-
-Content::Content (boost::filesystem::path p)
-{
- add_path (p);
+ add_path(p);
}
@@ -93,50 +87,50 @@ Content::Content(cxml::ConstNodePtr node, boost::optional<boost::filesystem::pat
}
auto const mod = i->optional_number_attribute<time_t>("mtime");
if (mod) {
- _last_write_times.push_back (*mod);
+ _last_write_times.push_back(*mod);
} else {
boost::system::error_code ec;
auto last_write = dcp::filesystem::last_write_time(i->content(), ec);
- _last_write_times.push_back (ec ? 0 : last_write);
+ _last_write_times.push_back(ec ? 0 : last_write);
}
}
- _digest = node->optional_string_child ("Digest").get_value_or ("X");
- _position = DCPTime (node->number_child<DCPTime::Type> ("Position"));
- _trim_start = ContentTime (node->number_child<ContentTime::Type> ("TrimStart"));
- _trim_end = ContentTime (node->number_child<ContentTime::Type> ("TrimEnd"));
- _video_frame_rate = node->optional_number_child<double> ("VideoFrameRate");
+ _digest = node->optional_string_child("Digest").get_value_or("X");
+ _position = DCPTime(node->number_child<DCPTime::Type>("Position"));
+ _trim_start = ContentTime(node->number_child<ContentTime::Type>("TrimStart"));
+ _trim_end = ContentTime(node->number_child<ContentTime::Type>("TrimEnd"));
+ _video_frame_rate = node->optional_number_child<double>("VideoFrameRate");
}
-Content::Content (vector<shared_ptr<Content>> c)
- : _position (c.front()->position())
- , _trim_start (c.front()->trim_start())
- , _trim_end (c.back()->trim_end())
- , _video_frame_rate (c.front()->video_frame_rate())
+Content::Content(vector<shared_ptr<Content>> c)
+ : _position(c.front()->position())
+ , _trim_start(c.front()->trim_start())
+ , _trim_end(c.back()->trim_end())
+ , _video_frame_rate(c.front()->video_frame_rate())
{
for (size_t i = 0; i < c.size(); ++i) {
- if (i > 0 && c[i]->trim_start() > ContentTime ()) {
- throw JoinError (_("Only the first piece of content to be joined can have a start trim."));
+ if (i > 0 && c[i]->trim_start() > ContentTime()) {
+ throw JoinError(_("Only the first piece of content to be joined can have a start trim."));
}
- if (i < (c.size() - 1) && c[i]->trim_end () > ContentTime ()) {
- throw JoinError (_("Only the last piece of content to be joined can have an end trim."));
+ if (i < (c.size() - 1) && c[i]->trim_end() > ContentTime()) {
+ throw JoinError(_("Only the last piece of content to be joined can have an end trim."));
}
if (
(_video_frame_rate && !c[i]->_video_frame_rate) ||
(!_video_frame_rate && c[i]->_video_frame_rate)
) {
- throw JoinError (_("Content to be joined must have the same video frame rate"));
+ throw JoinError(_("Content to be joined must have the same video frame rate"));
}
- if (_video_frame_rate && fabs (_video_frame_rate.get() - c[i]->_video_frame_rate.get()) > VIDEO_FRAME_RATE_EPSILON) {
- throw JoinError (_("Content to be joined must have the same video frame rate"));
+ if (_video_frame_rate && fabs(_video_frame_rate.get() - c[i]->_video_frame_rate.get()) > VIDEO_FRAME_RATE_EPSILON) {
+ throw JoinError(_("Content to be joined must have the same video frame rate"));
}
for (size_t j = 0; j < c[i]->number_of_paths(); ++j) {
- _paths.push_back (c[i]->path(j));
- _last_write_times.push_back (c[i]->_last_write_times[j]);
+ _paths.push_back(c[i]->path(j));
+ _last_write_times.push_back(c[i]->_last_write_times[j]);
}
}
}
@@ -145,7 +139,7 @@ Content::Content (vector<shared_ptr<Content>> c)
void
Content::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_behaviour, optional<boost::filesystem::path> film_directory) const
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
if (with_paths) {
for (size_t i = 0; i < _paths.size(); ++i) {
@@ -156,7 +150,7 @@ Content::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_beh
}
auto p = cxml::add_child(element, "Path");
p->add_child_text(path.string());
- p->set_attribute ("mtime", fmt::to_string(_last_write_times[i]));
+ p->set_attribute("mtime", fmt::to_string(_last_write_times[i]));
}
}
cxml::add_text_child(element, "Digest", _digest);
@@ -170,13 +164,13 @@ Content::as_xml(xmlpp::Element* element, bool with_paths, PathBehaviour path_beh
string
-Content::calculate_digest () const
+Content::calculate_digest() const
{
/* Some content files are very big, so we use a poor man's
digest here: a digest of the first and last 1e6 bytes with the
size of the first file tacked on the end as a string.
*/
- return simple_digest (paths());
+ return simple_digest(paths());
}
@@ -184,31 +178,31 @@ void
Content::examine(shared_ptr<const Film>, shared_ptr<Job> job, bool)
{
if (job) {
- job->sub (_("Computing digest"));
+ job->sub(_("Computing digest"));
}
- auto const d = calculate_digest ();
+ auto const d = calculate_digest();
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
_digest = d;
- _last_write_times.clear ();
+ _last_write_times.clear();
for (auto i: _paths) {
boost::system::error_code ec;
auto last_write = dcp::filesystem::last_write_time(i, ec);
- _last_write_times.push_back (ec ? 0 : last_write);
+ _last_write_times.push_back(ec ? 0 : last_write);
}
}
void
-Content::signal_change (ChangeType c, int p)
+Content::signal_change(ChangeType c, int p)
{
try {
if (c == ChangeType::PENDING || c == ChangeType::CANCELLED) {
- Change (c, shared_from_this(), p, _change_signals_frequent);
+ Change(c, shared_from_this(), p, _change_signals_frequent);
} else {
- emit (boost::bind (boost::ref(Change), c, shared_from_this(), p, _change_signals_frequent));
+ emit(boost::bind(boost::ref(Change), c, shared_from_this(), p, _change_signals_frequent));
}
} catch (std::bad_weak_ptr &) {
/* This must be during construction; never mind */
@@ -217,12 +211,12 @@ Content::signal_change (ChangeType c, int p)
void
-Content::set_position (shared_ptr<const Film> film, DCPTime p, bool force_emit)
+Content::set_position(shared_ptr<const Film> film, DCPTime p, bool force_emit)
{
/* video and audio content can modify its position */
if (video) {
- video->modify_position (film, p);
+ video->modify_position(film, p);
}
/* Only allow the audio to modify if we have no video;
@@ -232,15 +226,15 @@ Content::set_position (shared_ptr<const Film> film, DCPTime p, bool force_emit)
cope.
*/
if (!video && audio) {
- audio->modify_position (film, p);
+ audio->modify_position(film, p);
}
- ContentChangeSignaller cc (this, ContentProperty::POSITION);
+ ContentChangeSignaller cc(this, ContentProperty::POSITION);
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
if (p == _position && !force_emit) {
- cc.abort ();
+ cc.abort();
return;
}
@@ -252,12 +246,12 @@ Content::set_position (shared_ptr<const Film> film, DCPTime p, bool force_emit)
void
Content::set_trim_start(shared_ptr<const Film> film, ContentTime t)
{
- DCPOMATIC_ASSERT (t.get() >= 0);
+ DCPOMATIC_ASSERT(t.get() >= 0);
/* video and audio content can modify its start trim */
if (video) {
- video->modify_trim_start (t);
+ video->modify_trim_start(t);
}
/* See note in ::set_position */
@@ -265,10 +259,10 @@ Content::set_trim_start(shared_ptr<const Film> film, ContentTime t)
audio->modify_trim_start(film, t);
}
- ContentChangeSignaller cc (this, ContentProperty::TRIM_START);
+ ContentChangeSignaller cc(this, ContentProperty::TRIM_START);
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
if (_trim_start == t) {
cc.abort();
} else {
@@ -279,14 +273,14 @@ Content::set_trim_start(shared_ptr<const Film> film, ContentTime t)
void
-Content::set_trim_end (ContentTime t)
+Content::set_trim_end(ContentTime t)
{
- DCPOMATIC_ASSERT (t.get() >= 0);
+ DCPOMATIC_ASSERT(t.get() >= 0);
- ContentChangeSignaller cc (this, ContentProperty::TRIM_END);
+ ContentChangeSignaller cc(this, ContentProperty::TRIM_END);
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
_trim_end = t;
}
}
@@ -297,7 +291,7 @@ Content::clone() const
{
/* This is a bit naughty, but I can't think of a compelling reason not to do it ... */
xmlpp::Document doc;
- auto node = doc.create_root_node ("Content");
+ auto node = doc.create_root_node("Content");
as_xml(node, true, PathBehaviour::KEEP_ABSOLUTE, {});
/* notes is unused here (we assume) */
@@ -307,9 +301,9 @@ Content::clone() const
string
-Content::technical_summary () const
+Content::technical_summary() const
{
- auto s = String::compose ("%1 %2 %3", path_summary(), digest(), position().seconds());
+ auto s = String::compose("%1 %2 %3", path_summary(), digest(), position().seconds());
if (_video_frame_rate) {
s += String::compose(" %1", *_video_frame_rate);
}
@@ -318,7 +312,7 @@ Content::technical_summary () const
DCPTime
-Content::length_after_trim (shared_ptr<const Film> film) const
+Content::length_after_trim(shared_ptr<const Film> film) const
{
auto length = max(DCPTime(), full_length(film) - DCPTime(trim_start() + trim_end(), film->active_frame_rate_change(position())));
if (video) {
@@ -332,10 +326,10 @@ Content::length_after_trim (shared_ptr<const Film> film) const
* the appearance of its video.
*/
string
-Content::identifier () const
+Content::identifier() const
{
char buffer[256];
- snprintf (
+ snprintf(
buffer, sizeof(buffer), "%s_%" PRId64 "_%" PRId64 "_%" PRId64,
Content::digest().c_str(), position().get(), trim_start().get(), trim_end().get()
);
@@ -344,7 +338,7 @@ Content::identifier () const
bool
-Content::paths_valid () const
+Content::paths_valid() const
{
for (auto i: _paths) {
if (!dcp::filesystem::exists(i)) {
@@ -357,32 +351,32 @@ Content::paths_valid () const
void
-Content::set_paths (vector<boost::filesystem::path> paths)
+Content::set_paths(vector<boost::filesystem::path> paths)
{
- ContentChangeSignaller cc (this, ContentProperty::PATH);
+ ContentChangeSignaller cc(this, ContentProperty::PATH);
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
_paths.clear();
for (auto path: paths) {
_paths.push_back(boost::filesystem::canonical(path));
}
- _last_write_times.clear ();
+ _last_write_times.clear();
for (auto i: _paths) {
boost::system::error_code ec;
auto last_write = dcp::filesystem::last_write_time(i, ec);
- _last_write_times.push_back (ec ? 0 : last_write);
+ _last_write_times.push_back(ec ? 0 : last_write);
}
}
}
string
-Content::path_summary () const
+Content::path_summary() const
{
/* XXX: should handle multiple paths more gracefully */
- DCPOMATIC_ASSERT (number_of_paths ());
+ DCPOMATIC_ASSERT(number_of_paths());
auto s = path(0).filename().string();
if (number_of_paths() > 1) {
@@ -395,23 +389,23 @@ Content::path_summary () const
/** @return a list of properties that might be interesting to the user */
list<UserProperty>
-Content::user_properties (shared_ptr<const Film> film) const
+Content::user_properties(shared_ptr<const Film> film) const
{
list<UserProperty> p;
- add_properties (film, p);
+ add_properties(film, p);
return p;
}
/** @return DCP times of points within this content where a reel split could occur */
list<DCPTime>
-Content::reel_split_points (shared_ptr<const Film>) const
+Content::reel_split_points(shared_ptr<const Film>) const
{
list<DCPTime> t;
/* This is only called for video content and such content has its position forced
to start on a frame boundary.
*/
- t.push_back (position());
+ t.push_back(position());
return t;
}
@@ -419,10 +413,10 @@ Content::reel_split_points (shared_ptr<const Film>) const
void
Content::set_video_frame_rate(shared_ptr<const Film> film, double r)
{
- ContentChangeSignaller cc (this, ContentProperty::VIDEO_FRAME_RATE);
+ ContentChangeSignaller cc(this, ContentProperty::VIDEO_FRAME_RATE);
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
if (_video_frame_rate && fabs(r - *_video_frame_rate) < VIDEO_FRAME_RATE_EPSILON) {
cc.abort();
}
@@ -437,24 +431,24 @@ Content::set_video_frame_rate(shared_ptr<const Film> film, double r)
void
-Content::unset_video_frame_rate ()
+Content::unset_video_frame_rate()
{
- ContentChangeSignaller cc (this, ContentProperty::VIDEO_FRAME_RATE);
+ ContentChangeSignaller cc(this, ContentProperty::VIDEO_FRAME_RATE);
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
_video_frame_rate = optional<double>();
}
}
double
-Content::active_video_frame_rate (shared_ptr<const Film> film) const
+Content::active_video_frame_rate(shared_ptr<const Film> film) const
{
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
if (_video_frame_rate) {
- return _video_frame_rate.get ();
+ return _video_frame_rate.get();
}
}
@@ -467,7 +461,7 @@ Content::active_video_frame_rate (shared_ptr<const Film> film) const
void
-Content::add_properties (shared_ptr<const Film>, list<UserProperty>& p) const
+Content::add_properties(shared_ptr<const Film>, list<UserProperty>& p) const
{
auto paths_to_show = std::min(number_of_paths(), size_t{8});
string paths = "";
@@ -480,7 +474,7 @@ Content::add_properties (shared_ptr<const Film>, list<UserProperty>& p) const
if (paths_to_show < number_of_paths()) {
paths += String::compose("... and %1 more", number_of_paths() - paths_to_show);
}
- p.push_back (
+ p.push_back(
UserProperty(
UserProperty::GENERAL,
paths_to_show > 1 ? _("Filenames") : _("Filename"),
@@ -490,20 +484,20 @@ Content::add_properties (shared_ptr<const Film>, list<UserProperty>& p) const
if (_video_frame_rate) {
if (video) {
- p.push_back (
- UserProperty (
+ p.push_back(
+ UserProperty(
UserProperty::VIDEO,
_("Frame rate"),
- locale_convert<string> (_video_frame_rate.get(), 5),
+ locale_convert<string>(_video_frame_rate.get(), 5),
_("frames per second")
)
);
} else {
- p.push_back (
- UserProperty (
+ p.push_back(
+ UserProperty(
UserProperty::GENERAL,
_("Prepared for video frame rate"),
- locale_convert<string> (_video_frame_rate.get(), 5),
+ locale_convert<string>(_video_frame_rate.get(), 5),
_("frames per second")
)
);
@@ -514,19 +508,19 @@ Content::add_properties (shared_ptr<const Film>, list<UserProperty>& p) const
/** Take settings from the given content if it is of the correct type */
void
-Content::take_settings_from (shared_ptr<const Content> c)
+Content::take_settings_from(shared_ptr<const Content> c)
{
if (video && c->video) {
- video->take_settings_from (c->video);
+ video->take_settings_from(c->video);
}
if (audio && c->audio) {
- audio->take_settings_from (c->audio);
+ audio->take_settings_from(c->audio);
}
- auto i = text.begin ();
- auto j = c->text.begin ();
+ auto i = text.begin();
+ auto j = c->text.begin();
while (i != text.end() && j != c->text.end()) {
- (*i)->take_settings_from (*j);
+ (*i)->take_settings_from(*j);
++i;
++j;
}
@@ -534,18 +528,18 @@ Content::take_settings_from (shared_ptr<const Content> c)
shared_ptr<TextContent>
-Content::only_text () const
+Content::only_text() const
{
- DCPOMATIC_ASSERT (text.size() < 2);
+ DCPOMATIC_ASSERT(text.size() < 2);
if (text.empty()) {
return {};
}
- return text.front ();
+ return text.front();
}
shared_ptr<TextContent>
-Content::text_of_original_type (TextType type) const
+Content::text_of_original_type(TextType type) const
{
for (auto i: text) {
if (i->original_type() == type) {
@@ -558,18 +552,18 @@ Content::text_of_original_type (TextType type) const
void
-Content::add_path (boost::filesystem::path p)
+Content::add_path(boost::filesystem::path p)
{
- boost::mutex::scoped_lock lm (_mutex);
+ boost::mutex::scoped_lock lm(_mutex);
_paths.push_back(boost::filesystem::canonical(p));
boost::system::error_code ec;
auto last_write = dcp::filesystem::last_write_time(p, ec);
- _last_write_times.push_back (ec ? 0 : last_write);
+ _last_write_times.push_back(ec ? 0 : last_write);
}
bool
-Content::changed () const
+Content::changed() const
{
bool write_time_changed = false;
for (auto i = 0U; i < _paths.size(); ++i) {
diff --git a/src/lib/content.h b/src/lib/content.h
index 1b4f2b40c..2c02f02e6 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -73,15 +73,15 @@ public:
class Content : public std::enable_shared_from_this<Content>, public Signaller
{
public:
- explicit Content ();
- Content (dcpomatic::DCPTime);
- Content (boost::filesystem::path);
- Content (cxml::ConstNodePtr, boost::optional<boost::filesystem::path> directory);
- Content (std::vector<std::shared_ptr<Content>>);
- virtual ~Content () {}
+ Content() = default;
+ explicit Content(dcpomatic::DCPTime);
+ explicit Content(boost::filesystem::path);
+ Content(cxml::ConstNodePtr, boost::optional<boost::filesystem::path> directory);
+ explicit Content(std::vector<std::shared_ptr<Content>>);
+ virtual ~Content() {}
- Content (Content const&) = delete;
- Content& operator= (Content const&) = delete;
+ Content(Content const&) = delete;
+ Content& operator=(Content const&) = delete;
/** Examine the content to establish digest, frame rates and any other
* useful metadata.
@@ -91,17 +91,17 @@ public:
*/
virtual void examine(std::shared_ptr<const Film> film, std::shared_ptr<Job> job, bool tolerant);
- virtual void take_settings_from (std::shared_ptr<const Content> c);
+ virtual void take_settings_from(std::shared_ptr<const Content> c);
/** @return Quick one-line summary of the content, as will be presented in the
* film editor.
*/
- virtual std::string summary () const = 0;
+ virtual std::string summary() const = 0;
/** @return Technical details of this content; these are written to logs to
* help with debugging.
*/
- virtual std::string technical_summary () const;
+ virtual std::string technical_summary() const;
virtual void as_xml(
xmlpp::Element* element,
@@ -110,77 +110,77 @@ public:
boost::optional<boost::filesystem::path> film_directory
) const;
- virtual dcpomatic::DCPTime full_length (std::shared_ptr<const Film>) const = 0;
- virtual dcpomatic::DCPTime approximate_length () const = 0;
- virtual std::string identifier () const;
+ virtual dcpomatic::DCPTime full_length(std::shared_ptr<const Film>) const = 0;
+ virtual dcpomatic::DCPTime approximate_length() const = 0;
+ virtual std::string identifier() const;
/** @return points at which to split this content when
* REELTYPE_BY_VIDEO_CONTENT is in use.
*/
- virtual std::list<dcpomatic::DCPTime> reel_split_points (std::shared_ptr<const Film>) const;
+ virtual std::list<dcpomatic::DCPTime> reel_split_points(std::shared_ptr<const Film>) const;
- std::shared_ptr<Content> clone () const;
+ std::shared_ptr<Content> clone() const;
- void set_paths (std::vector<boost::filesystem::path> paths);
+ void set_paths(std::vector<boost::filesystem::path> paths);
- std::string path_summary () const;
+ std::string path_summary() const;
- std::vector<boost::filesystem::path> paths () const {
- boost::mutex::scoped_lock lm (_mutex);
+ std::vector<boost::filesystem::path> paths() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _paths;
}
- size_t number_of_paths () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _paths.size ();
+ size_t number_of_paths() const {
+ boost::mutex::scoped_lock lm(_mutex);
+ return _paths.size();
}
- boost::filesystem::path path (size_t i) const {
- boost::mutex::scoped_lock lm (_mutex);
+ boost::filesystem::path path(size_t i) const {
+ boost::mutex::scoped_lock lm(_mutex);
return _paths[i];
}
- std::time_t last_write_time (size_t i) const {
- boost::mutex::scoped_lock lm (_mutex);
+ std::time_t last_write_time(size_t i) const {
+ boost::mutex::scoped_lock lm(_mutex);
return _last_write_times[i];
}
- bool paths_valid () const;
+ bool paths_valid() const;
/** @return Digest of the content's file(s). Note: this is
* not a complete MD5-or-whatever hash, but a sort of poor
- * man's version (see comments in examine()).
+ * man's version(see comments in examine()).
*/
- std::string digest () const {
- boost::mutex::scoped_lock lm (_mutex);
+ std::string digest() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _digest;
}
- void set_position (std::shared_ptr<const Film> film, dcpomatic::DCPTime, bool force_emit = false);
+ void set_position(std::shared_ptr<const Film> film, dcpomatic::DCPTime, bool force_emit = false);
/** dcpomatic::DCPTime that this content starts; i.e. the time that the first
* bit of the content (trimmed or not) will happen.
*/
- dcpomatic::DCPTime position () const {
- boost::mutex::scoped_lock lm (_mutex);
+ dcpomatic::DCPTime position() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _position;
}
void set_trim_start(std::shared_ptr<const Film> film, dcpomatic::ContentTime);
- dcpomatic::ContentTime trim_start () const {
- boost::mutex::scoped_lock lm (_mutex);
+ dcpomatic::ContentTime trim_start() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _trim_start;
}
- void set_trim_end (dcpomatic::ContentTime);
+ void set_trim_end(dcpomatic::ContentTime);
- dcpomatic::ContentTime trim_end () const {
- boost::mutex::scoped_lock lm (_mutex);
+ dcpomatic::ContentTime trim_end() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _trim_end;
}
/** @return Time immediately after the last thing in this content */
- dcpomatic::DCPTime end (std::shared_ptr<const Film> film) const {
+ dcpomatic::DCPTime end(std::shared_ptr<const Film> film) const {
return position() + length_after_trim(film);
}
@@ -188,27 +188,27 @@ public:
return { position(), end(film) };
}
- dcpomatic::DCPTime length_after_trim (std::shared_ptr<const Film> film) const;
+ dcpomatic::DCPTime length_after_trim(std::shared_ptr<const Film> film) const;
- boost::optional<double> video_frame_rate () const {
- boost::mutex::scoped_lock lm (_mutex);
+ boost::optional<double> video_frame_rate() const {
+ boost::mutex::scoped_lock lm(_mutex);
return _video_frame_rate;
}
void set_video_frame_rate(std::shared_ptr<const Film> film, double r);
- void unset_video_frame_rate ();
+ void unset_video_frame_rate();
- double active_video_frame_rate (std::shared_ptr<const Film> film) const;
+ double active_video_frame_rate(std::shared_ptr<const Film> film) const;
- void set_change_signals_frequent (bool f) {
+ void set_change_signals_frequent(bool f) {
_change_signals_frequent = f;
}
- std::list<UserProperty> user_properties (std::shared_ptr<const Film> film) const;
+ std::list<UserProperty> user_properties(std::shared_ptr<const Film> film) const;
- std::string calculate_digest () const;
+ std::string calculate_digest() const;
- virtual bool can_be_played () const {
+ virtual bool can_be_played() const {
return true;
}
@@ -222,22 +222,22 @@ public:
std::vector<std::shared_ptr<TextContent>> text;
std::shared_ptr<AtmosContent> atmos;
- std::shared_ptr<TextContent> only_text () const;
- std::shared_ptr<TextContent> text_of_original_type (TextType type) const;
+ std::shared_ptr<TextContent> only_text() const;
+ std::shared_ptr<TextContent> text_of_original_type(TextType type) const;
/** @return true if this content has changed since it was last examined */
- bool changed () const;
+ bool changed() const;
protected:
- virtual void add_properties (std::shared_ptr<const Film> film, std::list<UserProperty> &) const;
+ virtual void add_properties(std::shared_ptr<const Film> film, std::list<UserProperty> &) const;
/** _mutex which should be used to protect accesses, as examine
* jobs can update content state in threads other than the main one.
*/
mutable boost::mutex _mutex;
- void add_path (boost::filesystem::path p);
+ void add_path(boost::filesystem::path p);
private:
friend struct ffmpeg_pts_offset_test;
@@ -247,7 +247,7 @@ private:
friend struct subtitle_font_id_change_test2;
template<class, class> friend class ChangeSignalDespatcher;
- void signal_change (ChangeType, int);
+ void signal_change(ChangeType, int);
/** Paths of our data files */
std::vector<boost::filesystem::path> _paths;