Bv2.1 7.2.3: Check that subtitle <StartTime> exists and is 0.
[libdcp.git] / src / sound_asset_writer.h
index 0a7d8cdaed8988f11cab3c41241b6376b34700be..f1cdf41910eba72b67d4938f6e343c77c538d2d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of libdcp.
 
  */
 
 #include "asset_writer.h"
+#include "fsk.h"
 #include "types.h"
 #include "sound_frame.h"
-#include <boost/shared_ptr.hpp>
+#include <memory>
 #include <boost/filesystem.hpp>
+#include <boost/shared_array.hpp>
+
+
+struct sync_test1;
+
 
 namespace dcp {
 
@@ -62,20 +68,31 @@ public:
 
 private:
        friend class SoundAsset;
+       friend struct ::sync_test1;
 
-       SoundAssetWriter (SoundAsset *, boost::filesystem::path, Standard standard);
+       SoundAssetWriter (SoundAsset *, boost::filesystem::path, std::vector<Channel> active_channels, bool sync);
 
+       void start ();
        void write_current_frame ();
+       std::vector<bool> create_sync_packets ();
 
        /* do this with an opaque pointer so we don't have to include
           ASDCP headers
        */
 
        struct ASDCPState;
-       boost::shared_ptr<ASDCPState> _state;
+       std::shared_ptr<ASDCPState> _state;
 
        SoundAsset* _asset;
        int _frame_buffer_offset;
+
+       /** true to ignore any signal passed to write() on channel 14 and instead write a sync track */
+       bool _sync;
+       /** index of the sync packet (0-3) which starts the next edit unit */
+       int _sync_packet;
+       FSK _fsk;
+
+       std::vector<Channel> _active_channels;
 };
 
 }