Another missing include.
[dcpomatic.git] / src / lib / content.cc
index b64e68c4b1739e0dec621877349971815ff93f49..9083635f242eaea3f5aefe5445c1d25ccb6b8921 100644 (file)
 #include "content_factory.h"
 #include "exceptions.h"
 #include "film.h"
-#include "safe_stringstream.h"
 #include "job.h"
 #include "compose.hpp"
-#include "raw_convert.h"
+#include <dcp/locale_convert.h>
+#include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/thread/mutex.hpp>
@@ -45,6 +45,8 @@ using std::vector;
 using std::max;
 using std::pair;
 using boost::shared_ptr;
+using dcp::raw_convert;
+using dcp::locale_convert;
 
 int const ContentProperty::PATH = 400;
 int const ContentProperty::POSITION = 401;
@@ -254,14 +256,12 @@ Content::length_after_trim () const
 string
 Content::identifier () const
 {
-       SafeStringStream s;
-
-       s << Content::digest()
-         << "_" << position().get()
-         << "_" << trim_start().get()
-         << "_" << trim_end().get();
-
-       return s.str ();
+       char buffer[256];
+       snprintf (
+               buffer, sizeof(buffer), "%s_%" PRId64 "_%" PRId64 "_%" PRId64,
+               Content::digest().c_str(), position().get(), trim_start().get(), trim_end().get()
+               );
+       return buffer;
 }
 
 bool
@@ -362,10 +362,24 @@ Content::add_properties (list<UserProperty>& p) const
        p.push_back (UserProperty (UserProperty::GENERAL, _("Filename"), path(0).string ()));
 
        if (_video_frame_rate) {
-               p.push_back (
-                       UserProperty (
-                               UserProperty::GENERAL, _("Video frame rate"), raw_convert<string> (_video_frame_rate.get(), 5), _("frames per second")
-                               )
-                       );
+               if (video) {
+                       p.push_back (
+                               UserProperty (
+                                       UserProperty::VIDEO,
+                                       _("Frame rate"),
+                                       locale_convert<string> (_video_frame_rate.get(), 5),
+                                       _("frames per second")
+                                       )
+                               );
+               } else {
+                       p.push_back (
+                               UserProperty (
+                                       UserProperty::GENERAL,
+                                       _("Prepared for video frame rate"),
+                                       locale_convert<string> (_video_frame_rate.get(), 5),
+                                       _("frames per second")
+                                       )
+                               );
+               }
        }
 }