In-line run of subs_in_out so that it gets the environment more easily.
[libdcp.git] / test / sync_test.cc
index 9fe6a30478d7ad80b348d03553fc069ab9c6b5da..67920e2ffce0de41bdd26239a551190ffede6ee0 100644 (file)
 #include "sound_asset_writer.h"
 #include "test.h"
 #include <boost/filesystem.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
 #include <boost/test/unit_test.hpp>
 #include <vector>
 
 
 using std::vector;
 using boost::shared_array;
-using boost::shared_ptr;
+using std::shared_ptr;
 
 
 static const int sample_A = 0.038 * 8388608;
@@ -109,7 +109,7 @@ BOOST_AUTO_TEST_CASE (sync_test1)
                }
        }
 
-       shared_ptr<dcp::SoundAssetWriter> writer = asset.start_write ("build/test/foo.mxf", true);
+       auto writer = asset.start_write("build/test/foo.mxf", {}, dcp::SoundAsset::AtmosSync::ENABLED, dcp::SoundAsset::MCASubDescriptors::ENABLED);
 
        /* Compare the sync bits made by SoundAssetWriter to the "proper" ones in the MXF */
        BOOST_CHECK (ref == writer->create_sync_packets());
@@ -120,11 +120,11 @@ BOOST_AUTO_TEST_CASE (sync_test2)
 {
        /* Make a MXF with the same ID as atmos_pcm.mxf and write a frame of random stuff */
        int const channels = 14;
-       dcp::SoundAsset asset (dcp::Fraction(24, 1), 48000, channels, dcp::SMPTE);
+       dcp::SoundAsset asset (dcp::Fraction(24, 1), 48000, channels, dcp::LanguageTag("en-GB"), dcp::Standard::SMPTE);
        asset._id = "e004046e09234f90a4ae4355e7e83506";
        boost::system::error_code ec;
        boost::filesystem::remove ("build/test/foo.mxf", ec);
-       shared_ptr<dcp::SoundAssetWriter> writer = asset.start_write ("build/test/foo.mxf", true);
+       auto writer = asset.start_write("build/test/foo.mxf", {}, dcp::SoundAsset::AtmosSync::ENABLED, dcp::SoundAsset::MCASubDescriptors::ENABLED);
 
        int const frames = 2000;
        float** junk = new float*[channels];
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE (sync_test2)
                }
        }
 
-       writer->write (junk, frames);
+       writer->write(junk, channels, frames);
        for (int i = 0; i < channels; ++i) {
                delete[] junk[i];
        }