diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-18 21:46:20 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-18 21:46:20 +0000 |
| commit | 6a5bb039b3bfd508cc87b6b15102b9eb60c62f8d (patch) | |
| tree | 65a8213237670f33a1f5383f5a973fd5f1b82b5b /src/sound_asset.h | |
| parent | 2489080f9a5d2891da0fc313b2c0ac1450a630ad (diff) | |
Add basics for progressive sound asset writing.
Diffstat (limited to 'src/sound_asset.h')
| -rw-r--r-- | src/sound_asset.h | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/src/sound_asset.h b/src/sound_asset.h index 569bb305..17767b3a 100644 --- a/src/sound_asset.h +++ b/src/sound_asset.h @@ -24,13 +24,40 @@ * @brief An asset made up of PCM audio data files */ +#include "AS_DCP.h" #include "mxf_asset.h" #include "types.h" namespace libdcp { -class SoundFrame; +class SoundFrame; + +class SoundAsset; + +class SoundAssetWriter +{ +public: + ~SoundAssetWriter (); + + void write (float const * const *, int); + void finalize (); + +private: + friend class SoundAsset; + + SoundAssetWriter (SoundAsset *); + void write_current_frame (); + + SoundAsset* _asset; + bool _finalized; + int _frames_written; + int _frame_buffer_offset; + ASDCP::PCM::MXFWriter _mxf_writer; + ASDCP::PCM::FrameBuffer _frame_buffer; + ASDCP::WriterInfo _writer_info; + ASDCP::PCM::AudioDescriptor _audio_desc; +}; /** @brief An asset made up of WAV files */ class SoundAsset : public MXFAsset @@ -82,10 +109,18 @@ public: SoundAsset ( std::string directory, + std::string mxf_name + ); + + SoundAsset ( + std::string directory, std::string mxf_name, int fps, - int intrinsic_duration + int channels, + int sampling_rate ); + + boost::shared_ptr<SoundAssetWriter> start_write (); /** Write details of this asset to a CPL stream. * @param s Stream. |
