return _playlist->content ();
}
+/** @param content Content to add.
+ * @param disable_audio_analysis true to never do automatic audio analysis, even if it is enabled in configuration.
+ */
void
-Film::examine_and_add_content (shared_ptr<Content> c)
+Film::examine_and_add_content (shared_ptr<Content> content, bool disable_audio_analysis)
{
- if (dynamic_pointer_cast<FFmpegContent> (c) && _directory) {
- run_ffprobe (c->path(0), file ("ffprobe.log"), _log);
+ if (dynamic_pointer_cast<FFmpegContent> (content) && _directory) {
+ run_ffprobe (content->path(0), file ("ffprobe.log"), _log);
}
- shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
+ shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), content));
_job_connections.push_back (
- j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr<Job> (j), weak_ptr<Content> (c)))
+ j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr<Job>(j), weak_ptr<Content>(content), disable_audio_analysis))
);
JobManager::instance()->add (j);
}
void
-Film::maybe_add_content (weak_ptr<Job> j, weak_ptr<Content> c)
+Film::maybe_add_content (weak_ptr<Job> j, weak_ptr<Content> c, bool disable_audio_analysis)
{
shared_ptr<Job> job = j.lock ();
if (!job || !job->finished_ok ()) {
add_content (content);
- if (Config::instance()->automatic_audio_analysis() && content->audio) {
+ if (Config::instance()->automatic_audio_analysis() && content->audio && !disable_audio_analysis) {
shared_ptr<Playlist> playlist (new Playlist);
playlist->add (content);
boost::signals2::connection c;
void set_directory (boost::filesystem::path);
void set_name (std::string);
void set_use_isdcf_name (bool);
- void examine_and_add_content (boost::shared_ptr<Content>);
+ void examine_and_add_content (boost::shared_ptr<Content> content, bool disable_audio_analysis = false);
void add_content (boost::shared_ptr<Content>);
void remove_content (boost::shared_ptr<Content>);
void remove_content (ContentList);
void playlist_changed ();
void playlist_order_changed ();
void playlist_content_changed (boost::weak_ptr<Content>, int, bool frequent);
- void maybe_add_content (boost::weak_ptr<Job>, boost::weak_ptr<Content>);
+ void maybe_add_content (boost::weak_ptr<Job>, boost::weak_ptr<Content>, bool disable_audio_analysis);
void audio_analysis_finished ();
static std::string const metadata_file;
{
_film.reset (new Film (optional<boost::filesystem::path>()));
shared_ptr<DCPContent> dcp (new DCPContent (_film, dir));
- _film->examine_and_add_content (dcp);
+ _film->examine_and_add_content (dcp, true);
JobManager* jm = JobManager::instance ();
- while (jm->work_to_do ()) {
+
+ while (jm->work_to_do() || signal_manager->ui_idle()) {
/* XXX: progress dialog */
- while (signal_manager->ui_idle ()) {}
dcpomatic_sleep (1);
}
- while (signal_manager->ui_idle ()) {}
-
DCPOMATIC_ASSERT (!jm->get().empty());
shared_ptr<Job> last = jm->get().back();