36 #include "mono_picture_asset.h"
52 boost::filesystem::create_directory(
"DCP");
59 auto picture_asset = std::make_shared<dcp::MonoPictureAsset>(
dcp::Fraction(24, 1), dcp::Standard::SMPTE);
62 auto picture_writer = picture_asset->start_write(
"DCP/picture.mxf",
false);
66 for (
int i = 0; i < 24; ++i) {
67 picture_writer->write (picture);
71 picture_writer->finalize();
77 auto sound_writer = sound_asset->start_write(
"DCP/sound.mxf");
80 std::array<float, 48000> left;
81 std::array<float, 48000> right;
82 for (
int i = 0; i < 48000; ++i) {
83 left[i] = sin (2 * M_PI * i * 440 / 48000) * 0.25;
84 right[i] = sin (2 * M_PI * i * 880 / 48000) * 0.25;
86 std::array<float*, 2> audio;
87 audio[0] = left.data();
88 audio[1] = right.data();
89 sound_writer->write (audio.data(), 48000);
92 sound_writer->finalize ();
95 auto reel = std::make_shared<dcp::Reel>();
100 reel->add(std::make_shared<dcp::ReelMonoPictureAsset>(picture_asset, 0));
101 reel->add(std::make_shared<dcp::ReelSoundAsset>(sound_asset, 0));
104 auto cpl = std::make_shared<dcp::CPL>(
"My film", dcp::ContentKind::FEATURE, dcp::Standard::SMPTE);
Class to hold an arbitrary block of data.
A class to create or read a DCP.
A fraction (i.e. a thing with an integer numerator and an integer denominator).
MonoPictureAssetWriter class.
Namespace for everything in libdcp.
void init(boost::optional< boost::filesystem::path > resources_directory=boost::optional< boost::filesystem::path >())
ReelMonoPictureAsset class.