2 Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
4 This file is part of libdcp.
6 libdcp is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 libdcp is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with libdcp. If not, see <http://www.gnu.org/licenses/>.
20 /** @file src/sound_asset.h
21 * @brief SoundAsset class
24 #ifndef LIBDCP_SOUND_ASSET_H
25 #define LIBDCP_SOUND_ASSET_H
35 class SoundAssetWriter;
36 class SoundAssetReader;
39 * @brief Representation of a sound asset
41 class SoundAsset : public Asset, public MXF
44 SoundAsset (boost::filesystem::path file);
45 SoundAsset (Fraction edit_rate, int sampling_rate, int channels);
47 boost::shared_ptr<SoundAssetWriter> start_write (boost::filesystem::path file, Standard standard);
48 boost::shared_ptr<SoundAssetReader> start_read () const;
51 boost::shared_ptr<const Asset> other,
56 /** @return number of channels */
57 int channels () const {
61 /** @return sampling rate in Hz */
62 int sampling_rate () const {
63 return _sampling_rate;
66 Fraction edit_rate () const {
70 int64_t intrinsic_duration () const {
71 return _intrinsic_duration;
74 static bool valid_mxf (boost::filesystem::path);
77 friend class SoundAssetWriter;
79 std::string pkl_type (Standard standard) const;
82 /** The total length of this content in video frames. The amount of
83 * content presented may be less than this.
85 int64_t _intrinsic_duration;
86 int _channels; ///< number of channels
87 int _sampling_rate; ///< sampling rate in Hz