summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-28 15:00:38 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-28 15:00:38 +0000
commitaf3e8ed8382cdc35e361cdca1f735a379fce1317 (patch)
treef8d205c6049251dd0d9db90ef78c146a0c101112 /src
parent15f8567ed4e9aad1f12d3242a090a0f44e24932f (diff)
Remove unused Film::content_paths_valid; fix ImageDecoder to throw an OpenFileError when a file is missing so that it gets treated as missing content; rename Content::path_valid -> paths_valid.
Diffstat (limited to 'src')
-rw-r--r--src/lib/content.cc2
-rw-r--r--src/lib/content.h2
-rw-r--r--src/lib/film.cc6
-rw-r--r--src/lib/film.h1
-rw-r--r--src/lib/image_decoder.cc9
-rw-r--r--src/lib/playlist.cc12
-rw-r--r--src/lib/playlist.h2
-rw-r--r--src/wx/content_menu.cc2
-rw-r--r--src/wx/film_editor.cc2
9 files changed, 12 insertions, 26 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index f09012765..d835a5b05 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -232,7 +232,7 @@ Content::identifier () const
}
bool
-Content::path_valid () const
+Content::paths_valid () const
{
for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
if (!boost::filesystem::exists (*i)) {
diff --git a/src/lib/content.h b/src/lib/content.h
index 9cf6d866a..4ee7c267f 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -84,7 +84,7 @@ public:
return _paths[i];
}
- bool path_valid () const;
+ bool paths_valid () const;
/** @return MD5 digest of the content's file(s) */
std::string digest () const {
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 5946d5bec..1bf35cc5f 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -860,12 +860,6 @@ Film::best_video_frame_rate () const
return _playlist->best_dcp_frame_rate ();
}
-bool
-Film::content_paths_valid () const
-{
- return _playlist->content_paths_valid ();
-}
-
void
Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
{
diff --git a/src/lib/film.h b/src/lib/film.h
index 4b07f84a9..e318f7724 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -114,7 +114,6 @@ public:
Time length () const;
bool has_subtitles () const;
OutputVideoFrame best_video_frame_rate () const;
- bool content_paths_valid () const;
libdcp::KDM
make_kdm (
diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc
index fb6053ae5..a7999c02a 100644
--- a/src/lib/image_decoder.cc
+++ b/src/lib/image_decoder.cc
@@ -52,7 +52,14 @@ ImageDecoder::pass ()
return;
}
- Magick::Image* magick_image = new Magick::Image (_image_content->path (_image_content->still() ? 0 : _video_position).string ());
+ Magick::Image* magick_image = 0;
+ boost::filesystem::path const path = _image_content->path (_image_content->still() ? 0 : _video_position);
+ try {
+ magick_image = new Magick::Image (path.string ());
+ } catch (...) {
+ throw OpenFileError (path);
+ }
+
libdcp::Size size (magick_image->columns(), magick_image->rows());
_image.reset (new Image (PIX_FMT_RGB24, size, true));
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 37b290218..daa82cb94 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -389,15 +389,3 @@ Playlist::move_later (shared_ptr<Content> c)
Changed ();
}
-
-bool
-Playlist::content_paths_valid () const
-{
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- if (!(*i)->path_valid ()) {
- return false;
- }
- }
-
- return true;
-}
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index f87b3397b..1915e3d04 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -80,8 +80,6 @@ public:
void repeat (ContentList, int);
- bool content_paths_valid () const;
-
mutable boost::signals2::signal<void ()> Changed;
/** Third parameter is true if signals are currently being emitted frequently */
mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> ContentChanged;
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 254109eb3..6372503d1 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -80,7 +80,7 @@ ContentMenu::popup (ContentList c, wxPoint p)
_join->Enable (n > 1);
- _find_missing->Enable (_content.size() == 1 && !_content.front()->path_valid ());
+ _find_missing->Enable (_content.size() == 1 && !_content.front()->paths_valid ());
_remove->Enable (!_content.empty ());
_parent->PopupMenu (_menu, p);
}
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index e478734c7..04bf6d2a8 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -734,7 +734,7 @@ FilmEditor::setup_content ()
ContentList content = _film->content ();
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
int const t = _content->GetItemCount ();
- bool const valid = (*i)->path_valid ();
+ bool const valid = (*i)->paths_valid ();
string s = (*i)->summary ();
if (!valid) {