const fixes.
[libdcp.git] / test / dcp_test.cc
index 9699eeb278ea981aaaeec84baddf53bd7aab2ae8..f70c6ce88ec4686040d42e277a8b067f3a5a103d 100644 (file)
 
 */
 
+#include <boost/test/unit_test.hpp>
+#include "dcp.h"
+#include "metadata.h"
+#include "cpl.h"
+#include "mono_picture_asset.h"
+#include "sound_asset.h"
+#include "reel.h"
+#include "test.h"
+#include "KM_util.h"
+
+using boost::shared_ptr;
+
 /* Test creation of a DCP from very simple inputs */
 BOOST_AUTO_TEST_CASE (dcp_test)
 {
@@ -38,34 +50,28 @@ BOOST_AUTO_TEST_CASE (dcp_test)
        libdcp::DCP d ("build/test/foo");
        shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/foo", "A Test DCP", libdcp::FEATURE, 24, 24));
 
-       shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset (
-                                                        j2c,
-                                                        "build/test/foo",
-                                                        "video.mxf",
-                                                        &d.Progress,
-                                                        24,
-                                                        24,
-                                                        false,
-                                                        libdcp::Size (32, 32),
-                                                        mxf_meta
-                                                        ));
+       shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/foo", "video.mxf"));
+       mp->set_progress (&d.Progress);
+       mp->set_edit_rate (24);
+       mp->set_intrinsic_duration (24);
+       mp->set_duration (24);
+       mp->set_size (libdcp::Size (32, 32));
+       mp->set_metadata (mxf_meta);
+       mp->create (j2c);
 
-       shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset (
-                                                  wav,
-                                                  "build/test/foo",
-                                                  "audio.mxf",
-                                                  &(d.Progress),
-                                                  24,
-                                                  24,
-                                                  2,
-                                                  false,
-                                                  mxf_meta
-                                                  ));
+       shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset ("build/test/foo", "audio.mxf"));
+       ms->set_progress (&d.Progress);
+       ms->set_edit_rate (24);
+       ms->set_intrinsic_duration (24);
+       ms->set_duration (24);
+       ms->set_channels (2);
+       ms->set_metadata (mxf_meta);
+       ms->create (wav);
        
        cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ())));
        d.add_cpl (cpl);
 
-       d.write_xml (xml_meta);
+       d.write_xml (false, xml_meta);
 
        /* build/test/foo is checked against test/ref/DCP/foo by run-tests.sh */
 }