Add default still length option. Split config dialog into tabs.
[dcpomatic.git] / src / lib / imagemagick_content.cc
index f7c76a34d4a202b04f8f62cf70a73c0c0eac6ba7..9e5f00ba0c7dbf78f4daa9e4295552d9acb1f095 100644 (file)
@@ -20,6 +20,7 @@
 #include <libcxml/cxml.h>
 #include "imagemagick_content.h"
 #include "imagemagick_decoder.h"
+#include "config.h"
 #include "compose.hpp"
 
 #include "i18n.h"
@@ -32,7 +33,7 @@ ImageMagickContent::ImageMagickContent (boost::filesystem::path f)
        : Content (f)
        , VideoContent (f)
 {
-       
+
 }
 
 ImageMagickContent::ImageMagickContent (shared_ptr<const cxml::Node> node)
@@ -45,7 +46,7 @@ ImageMagickContent::ImageMagickContent (shared_ptr<const cxml::Node> node)
 string
 ImageMagickContent::summary () const
 {
-       return String::compose (_("Image: %1"), file().filename ());
+       return String::compose (_("Image: %1"), file().filename().string());
 }
 
 bool
@@ -72,13 +73,13 @@ ImageMagickContent::examine (shared_ptr<Film> film, shared_ptr<Job> job, bool qu
 
        {
                boost::mutex::scoped_lock lm (_mutex);
-               /* XXX */
-               _video_length = 10 * 24;
+               /* Initial length */
+               _video_length = Config::instance()->default_still_length() * 24;
        }
        
        take_from_video_decoder (decoder);
        
-        Changed (VideoContentProperty::VIDEO_LENGTH);
+        signal_changed (VideoContentProperty::VIDEO_LENGTH);
 }
 
 shared_ptr<Content>
@@ -86,3 +87,14 @@ ImageMagickContent::clone () const
 {
        return shared_ptr<Content> (new ImageMagickContent (*this));
 }
+
+void
+ImageMagickContent::set_video_length (ContentVideoFrame len)
+{
+       {
+               boost::mutex::scoped_lock lm (_mutex);
+               _video_length = len;
+       }
+
+       signal_changed (VideoContentProperty::VIDEO_LENGTH);
+}