Tweaks to test setup; don't always compute coverage.
[libdcp.git] / src / picture_mxf.h
index 3a587280b0e4a0c105f8b2e969c7811649dd9ff8..bf8fcf763f5a0824055e2ff32d89a7c3a16bd203 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2014 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
 #ifndef LIBDCP_PICTURE_MXF_H
 #define LIBDCP_PICTURE_MXF_H
 
-/** @file  src/picture_asset.h
- *  @brief An asset made up of JPEG2000 data
+/** @file  src/picture_mxf.h
+ *  @brief PictureMXF class.
  */
 
-#include <openjpeg.h>
 #include "mxf.h"
 #include "util.h"
 #include "metadata.h"
+#include <openjpeg.h>
 
 namespace ASDCP {
        namespace JP2K {
-               class PictureDescriptor;
+               struct PictureDescriptor;
        }
 }
 
@@ -42,14 +42,20 @@ class MonoPictureFrame;
 class StereoPictureFrame;
 class PictureMXFWriter;
 
-/** @brief An asset made up of JPEG2000 data */
+/** @class PictureMXF
+ *  @brief An asset made up of JPEG2000 data.
+ */
 class PictureMXF : public MXF
 {
 public:
        PictureMXF (boost::filesystem::path file);
-       PictureMXF (int edit_rate);
+       PictureMXF (Fraction edit_rate);
 
-       virtual boost::shared_ptr<PictureMXFWriter> start_write (boost::filesystem::path file, bool overwrite) = 0;
+       virtual boost::shared_ptr<PictureMXFWriter> start_write (
+               boost::filesystem::path file,
+               Standard standard,
+               bool overwrite
+               ) = 0;
 
        Size size () const {
                return _size;
@@ -59,9 +65,23 @@ public:
                _size = s;
        }
 
-       void write_to_cpl (xmlpp::Element *) const;
+       Fraction frame_rate () const {
+               return _frame_rate;
+       }
+
+       void set_frame_rate (Fraction r) {
+               _frame_rate = r;
+       }
+
+       Fraction screen_aspect_ratio () const {
+               return _screen_aspect_ratio;
+       }
+
+       void set_screen_aspect_ratio (Fraction r) {
+               _screen_aspect_ratio = r;
+       }
 
-protected:     
+protected:
 
        bool frame_buffer_equals (
                int frame, EqualityOptions opt, boost::function<void (NoteType, std::string)> note,
@@ -69,15 +89,22 @@ protected:
                ) const;
 
        bool descriptor_equals (
-               ASDCP::JP2K::PictureDescriptor const & a, ASDCP::JP2K::PictureDescriptor const & b, boost::function<void (NoteType, std::string)>
+               ASDCP::JP2K::PictureDescriptor const & a,
+               ASDCP::JP2K::PictureDescriptor const & b,
+               boost::function<void (NoteType, std::string)>
                ) const;
 
+       void read_picture_descriptor (ASDCP::JP2K::PictureDescriptor const &);
+
        /** picture size in pixels */
        Size _size;
+       Fraction _frame_rate;
+       Fraction _screen_aspect_ratio;
 
 private:
-       std::string key_type () const;
-       virtual int edit_rate_factor () const = 0;
+       std::string asdcp_kind () const {
+               return "Picture";
+       }
 };