/*
Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
- This program is free software; you can redistribute it and/or modify
+ This file is part of libdcp.
+
+ libdcp is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ libdcp is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+ along with libdcp. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file examples/make_dcp.cc
{
/* Create a directory to put the DCP in */
boost::filesystem::create_directory ("DCP");
-
+
/* Make a picture asset. This is a file which combines JPEG2000 files together to make
up the video of the DCP. First, create the object, specifying a frame rate of 24 frames
per second.
*/
- boost::shared_ptr<dcp::MonoPictureAsset> picture_asset (new dcp::MonoPictureAsset (dcp::Fraction (24, 1)));
+ boost::shared_ptr<dcp::MonoPictureAsset> picture_asset (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE));
/* Start off a write to it */
- boost::shared_ptr<dcp::PictureAssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf", dcp::SMPTE, false);
+ boost::shared_ptr<dcp::PictureAssetWriter> picture_writer = picture_asset->start_write ("DCP/picture.mxf", false);
/* Write 24 frames of the same JPEG2000 file */
dcp::File picture ("examples/help.j2c");
/* Now create a sound MXF. As before, create an object and a writer.
When creating the object we specify the sampling rate (48kHz) and the number of channels (2).
*/
- boost::shared_ptr<dcp::SoundAsset> sound_asset (new dcp::SoundAsset (dcp::Fraction (24, 1), 48000, 2));
- boost::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", dcp::SMPTE);
+ boost::shared_ptr<dcp::SoundAsset> sound_asset (new dcp::SoundAsset(dcp::Fraction(24, 1), 48000, 2, dcp::LanguageTag("en-GB"), dcp::SMPTE));
+ /* Here we must also say which of our channels will have "real" sound data in them */
+ std::vector<dcp::Channel> active_channels;
+ active_channels.push_back (dcp::LEFT);
+ active_channels.push_back (dcp::RIGHT);
+ boost::shared_ptr<dcp::SoundAssetWriter> sound_writer = sound_asset->start_write ("DCP/sound.mxf", active_channels);
/* Write some sine waves */
float* audio[2];
dcp::DCP dcp ("DCP");
dcp.add (cpl);
dcp.write_xml (dcp::SMPTE);
-
+
return 0;
}