Basics of making loop do something.
[dcpomatic.git] / src / lib / imagemagick_decoder.h
index ba54c0efa28feb41313904bd694d9c88bd5ecf90..3e551c3b7c0d86aba36b020c4201a149f0360c38 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 */
 
 #include "video_decoder.h"
+#include "imagemagick.h"
 
 namespace Magick {
        class Image;
@@ -25,32 +26,18 @@ namespace Magick {
 
 class ImageMagickContent;
 
-class ImageMagickDecoder : public VideoDecoder
+class ImageMagickDecoder : public VideoDecoder, public ImageMagick
 {
 public:
        ImageMagickDecoder (boost::shared_ptr<const Film>, boost::shared_ptr<const ImageMagickContent>);
 
-       bool pass ();
-       bool seek (double);
-       Time next () const;
+       /* Decoder */
 
-       float video_frame_rate () const {
-               return 24;
-       }
-
-       libdcp::Size native_size () const;
-       ContentVideoFrame video_length () const;
-
-       boost::shared_ptr<const ImageMagickContent> content () const {
-               return _imagemagick_content;
-       }
-
-protected:
-       PixelFormat pixel_format () const;
+       void pass ();
+       void seek (VideoContent::Frame, bool);
+       bool done () const;
 
 private:
-       boost::shared_ptr<const ImageMagickContent> _imagemagick_content;
        boost::shared_ptr<Image> _image;
-       ContentVideoFrame _position;
-       mutable boost::optional<libdcp::Size> _native_size;
+       mutable boost::optional<libdcp::Size> _video_size;
 };