Use an enum instead of a bool in PictureAsset::start_write().
[libdcp.git] / test / test.cc
index bfee68f7fd3e74edb4e83c93c5c80357fdd9588e..a8efa5c359794ac80246c626f5457778b1470344 100644 (file)
@@ -273,7 +273,7 @@ simple_picture (boost::filesystem::path path, string suffix, int frames, optiona
        if (key) {
                mp->set_key (*key);
        }
-       auto picture_writer = mp->start_write (path / dcp::String::compose("video%1.mxf", suffix), false);
+       auto picture_writer = mp->start_write(path / dcp::String::compose("video%1.mxf", suffix), dcp::PictureAsset::Behaviour::MAKE_NEW);
 
        dcp::Size const size (1998, 1080);
        auto image = make_shared<dcp::OpenJPEGImage>(size);
@@ -292,10 +292,8 @@ simple_picture (boost::filesystem::path path, string suffix, int frames, optiona
 
 
 shared_ptr<dcp::SoundAsset>
-simple_sound (boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_meta, string language, int frames, int sample_rate, optional<dcp::Key> key)
+simple_sound(boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_meta, string language, int frames, int sample_rate, optional<dcp::Key> key, int channels)
 {
-       int const channels = 6;
-
        /* Set a valid language, then overwrite it, so that the language parameter can be badly formed */
        auto ms = make_shared<dcp::SoundAsset>(dcp::Fraction(24, 1), sample_rate, channels, dcp::LanguageTag("en-US"), dcp::Standard::SMPTE);
        if (key) {
@@ -303,7 +301,7 @@ simple_sound (boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_
        }
        ms->_language = language;
        ms->set_metadata (mxf_meta);
-       shared_ptr<dcp::SoundAssetWriter> sound_writer = ms->start_write (path / dcp::String::compose("audio%1.mxf", suffix));
+       auto sound_writer = ms->start_write(path / dcp::String::compose("audio%1.mxf", suffix), {}, dcp::SoundAsset::AtmosSync::DISABLED, dcp::SoundAsset::MCASubDescriptors::ENABLED);
 
        int const samples_per_frame = sample_rate / 24;
 
@@ -314,7 +312,7 @@ simple_sound (boost::filesystem::path path, string suffix, dcp::MXFMetadata mxf_
        }
 
        for (auto i = 0; i < frames; ++i) {
-               sound_writer->write (silence, samples_per_frame);
+               sound_writer->write(silence, channels, samples_per_frame);
        }
 
        sound_writer->finalize ();
@@ -386,7 +384,7 @@ make_simple (boost::filesystem::path path, int reels, int frames, dcp::Standard
 shared_ptr<dcp::Subtitle>
 simple_subtitle ()
 {
-       return make_shared<dcp::SubtitleString>(
+       return std::make_shared<dcp::SubtitleString>(
                optional<string>(),
                false,
                false,
@@ -400,6 +398,7 @@ simple_subtitle ()
                dcp::HAlign::CENTER,
                0.8,
                dcp::VAlign::TOP,
+               0,
                dcp::Direction::LTR,
                "Hello world",
                dcp::Effect::NONE,
@@ -517,7 +516,7 @@ black_picture_asset (boost::filesystem::path dir, int frames)
        auto asset = make_shared<dcp::MonoPictureAsset>(dcp::Fraction(24, 1), dcp::Standard::SMPTE);
        asset->set_metadata (dcp::MXFMetadata("libdcp", "libdcp", "1.6.4devel"));
        boost::filesystem::create_directories (dir);
-       auto writer = asset->start_write (dir / "pic.mxf", true);
+       auto writer = asset->start_write(dir / "pic.mxf", dcp::PictureAsset::Behaviour::MAKE_NEW);
        for (int i = 0; i < frames; ++i) {
                writer->write (frame.data(), frame.size());
        }