return (write_time_changed || calculate_digest() != digest());
}
+
+
+bool
+Content::has_mapped_audio() const
+{
+ return audio && !audio->mapping().mapped_output_channels().empty();
+}
+
return true;
}
+ bool has_mapped_audio() const;
+
/* ChangeType::PENDING and ChangeType::CANCELLED may be emitted from any thread; ChangeType::DONE always from GUI thread */
boost::signals2::signal<void (ChangeType, std::weak_ptr<Content>, int, bool)> Change;
/// TRANSLATORS: this string will follow "Cannot reference this DCP: "
return can_reference(
film, [](shared_ptr<const Content> c) {
- return static_cast<bool>(c->audio) && !c->audio->mapping().mapped_output_channels().empty();
+ return c->has_mapped_audio();
},
_("it overlaps other audio content; remove the other content."),
why_not
if (content->video) {
video = make_shared<VideoDecoder>(this, content);
}
- if (content->audio && !content->audio->mapping().mapped_output_channels().empty()) {
+ if (content->has_mapped_audio()) {
audio = make_shared<AudioDecoder>(this, content->audio, fast);
}
for (auto i: content->text) {
_pts_offset = {};
}
- if (c->audio && !c->audio->mapping().mapped_output_channels().empty()) {
+ if (c->has_mapped_audio()) {
audio = make_shared<AudioDecoder>(this, c->audio, fast);
}
auto content = film()->content();
auto mapped_audio =
std::find_if(content.begin(), content.end(), [](shared_ptr<const Content> c) {
- return c->audio && !c->audio->mapping().mapped_output_channels().empty();
+ return c->has_mapped_audio();
});
if (mapped_audio != content.end() && !film()->audio_language()) {
bool
have_audio (shared_ptr<const Content> content)
{
- return static_cast<bool>(content->audio) && !content->audio->mapping().mapped_output_channels().empty() && content->can_be_played();
+ return content->has_mapped_audio() && content->can_be_played();
}
_views.push_back (make_shared<TimelineVideoContentView>(*this, i));
}
- if (i->audio && !i->audio->mapping().mapped_output_channels().empty ()) {
+ if (i->has_mapped_audio()) {
_views.push_back (make_shared<TimelineAudioContentView>(*this, i));
}