X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fsound_mxf.h;h=d6978953f6ffaeb18e6fc6eea3ce39137498fe9f;hb=595d4fbfee788edfad7f9f8dfe7e76ee634c1a94;hp=4216accb5dc4063dfca03dd6f77b2168a453577f;hpb=0703842433013ac1d5f79c09d7a8361dc2e565c8;p=libdcp.git diff --git a/src/sound_mxf.h b/src/sound_mxf.h index 4216accb..d6978953 100644 --- a/src/sound_mxf.h +++ b/src/sound_mxf.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,13 +17,13 @@ */ -#ifndef LIBDCP_SOUND_ASSET_H -#define LIBDCP_SOUND_ASSET_H - -/** @file src/sound_asset.h - * @brief An asset made up of PCM audio data files +/** @file src/sound_mxf.h + * @brief SoundMXF class */ +#ifndef LIBDCP_SOUND_MXF_H +#define LIBDCP_SOUND_MXF_H + #include "mxf.h" #include "types.h" #include "metadata.h" @@ -32,73 +32,44 @@ namespace dcp { class SoundFrame; -class SoundMXF; - -class SoundMXFWriter -{ -public: - void write (float const * const *, int); - void finalize (); +class SoundMXFWriter; -private: - friend class SoundMXF; - - SoundMXFWriter (SoundMXF *); - - /* no copy construction */ - SoundMXFWriter (SoundMXFWriter const &); - SoundMXFWriter& operator= (SoundMXFWriter const &); - - void write_current_frame (); - - /* do this with an opaque pointer so we don't have to include - ASDCP headers - */ - - struct ASDCPState; - boost::shared_ptr _state; - - SoundMXF* _asset; - bool _finalized; - int _frames_written; - int _frame_buffer_offset; -}; - -/** @brief An asset made up of WAV files */ +/** @class SoundMXF + * @brief Representation of a MXF file containing sound + */ class SoundMXF : public MXF { public: SoundMXF (boost::filesystem::path file); + SoundMXF (Fraction edit_rate, int sampling_rate, int channels); - boost::shared_ptr start_write (); + boost::shared_ptr start_write (boost::filesystem::path file, Standard standard); - bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; + bool equals ( + boost::shared_ptr other, + EqualityOptions opt, + boost::function note + ) const; boost::shared_ptr get_frame (int n) const; - void set_channels (int c) { - _channels = c; - } - + /** @return number of channels */ int channels () const { return _channels; } - void set_sampling_rate (int s) { - _sampling_rate = s; - } - + /** @return sampling rate in Hz */ int sampling_rate () const { return _sampling_rate; } private: - std::string key_type () const; - std::string cpl_node_name () const; + std::string asdcp_kind () const { + return "Sound"; + } - /** Number of channels in the asset */ - int _channels; - int _sampling_rate; + int _channels; ///< number of channels + int _sampling_rate; ///< sampling rate in Hz }; }