1 /* -*- c-basic-offset: 8; default-tab-width: 8; -*- */
4 Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
6 This program 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 This program 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 this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <libavutil/audioconvert.h>
25 #include "audio_content.h"
31 class SndfileContent : public AudioContent
34 SndfileContent (boost::shared_ptr<const Film>, boost::filesystem::path);
35 SndfileContent (boost::shared_ptr<const Film>, boost::shared_ptr<const cxml::Node>);
37 boost::shared_ptr<SndfileContent> shared_from_this () {
38 return boost::dynamic_pointer_cast<SndfileContent> (Content::shared_from_this ());
41 void examine (boost::shared_ptr<Job>);
42 std::string summary () const;
43 std::string information () const;
44 void as_xml (xmlpp::Node *) const;
45 boost::shared_ptr<Content> clone () const;
49 int audio_channels () const {
50 boost::mutex::scoped_lock lm (_mutex);
51 return _audio_channels;
54 ContentAudioFrame audio_length () const {
55 boost::mutex::scoped_lock lm (_mutex);
59 int content_audio_frame_rate () const {
60 boost::mutex::scoped_lock lm (_mutex);
61 return _audio_frame_rate;
64 int output_audio_frame_rate () const;
66 AudioMapping audio_mapping () const {
67 boost::mutex::scoped_lock lm (_mutex);
68 return _audio_mapping;
71 static bool valid_file (boost::filesystem::path);
75 ContentAudioFrame _audio_length;
76 int _audio_frame_rate;
77 AudioMapping _audio_mapping;