Pass MainSoundConfiguration object rather than a string.
[libdcp.git] / test / verify_test.cc
index 396a1ef5c439721419cb089e07575151ff6d159f..d853bc810d896462d61c2b82fd0e8336eb55bfc7 100644 (file)
@@ -679,7 +679,7 @@ dcp_from_frame (dcp::ArrayData const& frame, path dir)
 {
        auto asset = make_shared<dcp::MonoPictureAsset>(dcp::Fraction(24, 1), dcp::Standard::SMPTE);
        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 < 24; ++i) {
                writer->write (frame.data(), frame.size());
        }
@@ -995,7 +995,7 @@ BOOST_AUTO_TEST_CASE (verify_valid_cpl_metadata)
 
        auto cpl = make_shared<dcp::CPL>("hello", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
        cpl->add (reel);
-       cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
+       cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
        cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1052,7 +1052,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag)
        reel->add (black_picture_asset(dir));
        auto cpl = make_shared<dcp::CPL>("hello", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
        cpl->add (reel);
-       cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
+       cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
        cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1102,7 +1102,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_missing_tag)
        reel->add (black_picture_asset(dir));
        auto cpl = make_shared<dcp::CPL>("hello", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
        cpl->add (reel);
-       cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
+       cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
        cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1190,7 +1190,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_language3)
        cpl->add (reel);
        cpl->_additional_subtitle_languages.push_back("this-is-wrong");
        cpl->_additional_subtitle_languages.push_back("andso-is-this");
-       cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
+       cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
        cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1227,7 +1227,7 @@ check_picture_size (int width, int height, int frame_rate, bool three_d)
        } else {
                mp = make_shared<dcp::MonoPictureAsset>(dcp::Fraction(frame_rate, 1), dcp::Standard::SMPTE);
        }
-       auto picture_writer = mp->start_write (dcp_path / "video.mxf", false);
+       auto picture_writer = mp->start_write(dcp_path / "video.mxf", dcp::PictureAsset::Behaviour::MAKE_NEW);
 
        auto image = black_image (dcp::Size(width, height));
        auto j2c = dcp::compress_j2k (image, 100000000, frame_rate, three_d, width > 2048);
@@ -1241,7 +1241,7 @@ check_picture_size (int width, int height, int frame_rate, bool three_d)
        auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
        cpl->set_annotation_text ("A Test DCP");
        cpl->set_issue_date ("2012-07-17T04:45:18+00:00");
-       cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
+       cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area(dcp::Size(width, height));
        cpl->set_main_picture_active_area(dcp::Size(width, height));
@@ -3025,7 +3025,7 @@ BOOST_AUTO_TEST_CASE (verify_partially_encrypted)
        auto mp = make_shared<dcp::MonoPictureAsset>(dcp::Fraction (24, 1), dcp::Standard::SMPTE);
        mp->set_key (key);
 
-       auto writer = mp->start_write (dir / "video.mxf", false);
+       auto writer = mp->start_write(dir / "video.mxf", dcp::PictureAsset::Behaviour::MAKE_NEW);
        dcp::ArrayData j2c ("test/data/flat_red.j2c");
        for (int i = 0; i < 24; ++i) {
                writer->write (j2c.data(), j2c.size());
@@ -3050,7 +3050,7 @@ BOOST_AUTO_TEST_CASE (verify_partially_encrypted)
        cpl->set_issuer ("OpenDCP 0.0.25");
        cpl->set_creator ("OpenDCP 0.0.25");
        cpl->set_issue_date ("2012-07-17T04:45:18+00:00");
-       cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
+       cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
        cpl->set_main_sound_sample_rate (48000);
        cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
        cpl->set_main_picture_active_area (dcp::Size(1440, 1080));