Remove Content::path(), add Content::path_summary().
[dcpomatic.git] / src / lib / content.cc
index c8f836d18d5dc8edcc8920f7d75963aa9d54d282..16069b7a7967b52a1200c40d241e2a6e91ff20eb 100644 (file)
@@ -28,6 +28,7 @@
 using std::string;
 using std::stringstream;
 using std::set;
+using std::cout;
 using boost::shared_ptr;
 using boost::lexical_cast;
 
@@ -37,6 +38,16 @@ int const ContentProperty::LENGTH = 402;
 int const ContentProperty::TRIM_START = 403;
 int const ContentProperty::TRIM_END = 404;
 
+Content::Content (shared_ptr<const Film> f)
+       : _film (f)
+       , _position (0)
+       , _trim_start (0)
+       , _trim_end (0)
+       , _change_signals_frequent (false)
+{
+
+}
+
 Content::Content (shared_ptr<const Film> f, Time p)
        : _film (f)
        , _position (p)
@@ -158,7 +169,7 @@ Content::clone () const
 string
 Content::technical_summary () const
 {
-       return String::compose ("%1 %2 %3", path(), digest(), position());
+       return String::compose ("%1 %2 %3", path_summary(), digest(), position());
 }
 
 Time
@@ -206,4 +217,15 @@ Content::set_path (boost::filesystem::path path)
        signal_changed (ContentProperty::PATH);
 }
 
-       
+string
+Content::path_summary () const
+{
+       /* XXX: should handle multiple paths more gracefully */
+
+       string s = path(0).filename().string ();
+       if (number_of_paths() > 1) {
+               s += " ...";
+       }
+
+       return s;
+}