libdcp
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
dcp::SoundAssetWriter Class Reference

A helper class for writing to SoundAssets. More...

#include <sound_asset_writer.h>

Inheritance diagram for dcp::SoundAssetWriter:
dcp::AssetWriter

Classes

struct  ASDCPState
 

Public Member Functions

void write (float const *const *, int)
 
bool finalize () override
 
- Public Member Functions inherited from dcp::AssetWriter
 AssetWriter (AssetWriter const &)=delete
 
AssetWriteroperator= (AssetWriter const &)=delete
 
int64_t frames_written () const
 

Private Member Functions

 SoundAssetWriter (SoundAsset *, boost::filesystem::path, bool sync)
 
void start ()
 
void write_current_frame ()
 
std::vector< bool > create_sync_packets ()
 

Private Attributes

std::shared_ptr< ASDCPState > _state
 
SoundAsset_asset = nullptr
 
int _frame_buffer_offset = 0
 
bool _sync = false
 
int _sync_packet = 0
 
FSK _fsk
 

Friends

class SoundAsset
 
struct ::sync_test1
 

Additional Inherited Members

- Protected Member Functions inherited from dcp::AssetWriter
 AssetWriter (MXF *mxf, boost::filesystem::path file)
 
- Protected Attributes inherited from dcp::AssetWriter
MXF_mxf = nullptr
 
boost::filesystem::path _file
 
int64_t _frames_written = 0
 
bool _finalized = false
 
bool _started = false
 
std::shared_ptr< EncryptionContext_crypto_context
 

Detailed Description

A helper class for writing to SoundAssets.

Objects of this class can only be created with SoundAsset::start_write().

Sound samples can be written to the SoundAsset by calling write() with a buffer of float values. finalize() must be called after the last samples have been written.

Definition at line 67 of file sound_asset_writer.h.

Member Function Documentation

◆ create_sync_packets()

vector< bool > SoundAssetWriter::create_sync_packets ( )
private

Calculate and return the sync packets required for this edit unit (aka "frame")

Definition at line 277 of file sound_asset_writer.cc.

◆ finalize()

bool SoundAssetWriter::finalize ( )
overridevirtual
Returns
true if anything was written by this writer

Reimplemented from dcp::AssetWriter.

Definition at line 257 of file sound_asset_writer.cc.

◆ write()

void SoundAssetWriter::write ( float const *const *  data,
int  frames 
)
Parameters
dataPointer an array of float pointers, one for each channel.
framesNumber of frames i.e. number of floats that are given for each channel.

Definition at line 191 of file sound_asset_writer.cc.

Member Data Documentation

◆ _sync

bool dcp::SoundAssetWriter::_sync = false
private

true to ignore any signal passed to write() on channel 14 and instead write a sync track

Definition at line 98 of file sound_asset_writer.h.

◆ _sync_packet

int dcp::SoundAssetWriter::_sync_packet = 0
private

index of the sync packet (0-3) which starts the next edit unit

Definition at line 100 of file sound_asset_writer.h.


The documentation for this class was generated from the following files: