Merge master
[libdcp.git] / examples / make_dcp.cc
index 5b764393fbc64d813176b668bd76e0f5749ddb82..8061ca614d26dba3cf3188939748c65d079c9e56 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <vector>
 #include <string>
-#include <sigc++/sigc++.h>
 
 /* If you are using an installed libdcp, these #includes would need to be changed to
 #include <libdcp/dcp.h>
@@ -49,14 +48,19 @@ video_frame (int /* frame */)
 int
 main ()
 {
-       /* Make a DCP object.  "My Film DCP" is the directory name for the DCP, "My Film" is the title
-          that will be shown on the projector / TMS when the DCP is ingested.
+       /* Make a DCP object.  "My Film DCP" is the directory name for the DCP */
+       libdcp::DCP dcp ("My Film DCP");
+       
+       /* Now make a CPL object.
 
+          "My Film" is the title that will be shown on the projector / TMS when the DCP is ingested.
           FEATURE is the type that the projector will list the DCP as.
-
           24 is the frame rate, and the DCP will be 48 frames long (ie 2 seconds at 24 fps).
-       */
-       libdcp::DCP dcp ("My Film DCP", "My Film", libdcp::FEATURE, 24, 48);
+       */      
+       boost::shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("My Film DCP", "My Film", libdcp::FEATURE, 24, 48));
+
+       /* And add the CPL to the DCP */
+       dcp.add_cpl (cpl);
 
        /* Now make a `picture asset'.  This is a collection of the JPEG2000 files that make up the picture, one per frame.
           Here we're using a function (video_frame) to obtain the name of the JPEG2000 file for each frame.
@@ -69,7 +73,7 @@ main ()
           for 2K projectors.
        */
        boost::shared_ptr<libdcp::MonoPictureAsset> picture_asset (
-               new libdcp::MonoPictureAsset (sigc::ptr_fun (&video_frame), "My Film DCP", "video.mxf", 0, 24, 48, 1998, 1080)
+               new libdcp::MonoPictureAsset (video_frame, "My Film DCP", "video.mxf", 0, 24, 48, 1998, 1080, false)
                );
 
        /* Now we will create a `sound asset', which is made up of a WAV file for each channel of audio.  Here we're using
@@ -89,11 +93,11 @@ main ()
 
        /* Now we can create the sound asset using these files */
        boost::shared_ptr<libdcp::SoundAsset> sound_asset (
-               new libdcp::SoundAsset (sound_files, "My Film DCP", "audio.mxf", 0, 24, 48)
+               new libdcp::SoundAsset (sound_files, "My Film DCP", "audio.mxf", 0, 24, 48, 0, false)
                );
 
-       /* Now that we have the assets, we can create a Reel to put them in and add it to the DCP */
-       dcp.add_reel (
+       /* Now that we have the assets, we can create a Reel to put them in and add it to the CPL */
+       cpl->add_reel (
                boost::shared_ptr<libdcp::Reel> (
                        new libdcp::Reel (picture_asset, sound_asset, boost::shared_ptr<libdcp::SubtitleAsset> ())
                        )