diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-01 15:07:04 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-01 15:07:04 +0100 |
| commit | 2d46203be73930a968806fa1af88369de51734ff (patch) | |
| tree | 8c896f39ca2ef48c44dd3f069c043c89ce668bfd /src/lib | |
| parent | c98c87afe29d9ef74bdced8a9c96d7752f3fe80f (diff) | |
Comments.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/analyse_audio_job.h | 13 | ||||
| -rw-r--r-- | src/lib/audio_analysis.h | 17 | ||||
| -rw-r--r-- | src/lib/audio_buffers.h | 10 | ||||
| -rw-r--r-- | src/lib/util.cc | 9 | ||||
| -rw-r--r-- | src/lib/util.h | 6 |
5 files changed, 49 insertions, 6 deletions
diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h index d3c35b67c..4d657951b 100644 --- a/src/lib/analyse_audio_job.h +++ b/src/lib/analyse_audio_job.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> 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,6 +17,10 @@ */ +/** @file src/lib/analyse_audio_job.h + * @brief AnalyseAudioJob class. + */ + #include "job.h" #include "audio_analysis.h" #include "types.h" @@ -25,6 +29,13 @@ class AudioBuffers; class AudioContent; +/** @class AnalyseAudioJob + * @brief A job to analyse the audio of a piece of AudioContent and make a note of its + * broad peak and RMS levels. + * + * After computing the peak and RMS levels over the length of the content, the job + * will write a file to Content::audio_analysis_path. + */ class AnalyseAudioJob : public Job { public: diff --git a/src/lib/audio_analysis.h b/src/lib/audio_analysis.h index 824472dda..b91a1cf51 100644 --- a/src/lib/audio_analysis.h +++ b/src/lib/audio_analysis.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> 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,6 +17,10 @@ */ +/** @file src/lib/audio_analysis.h + * @brief AudioAnalysis and AudioPoint classes. + */ + #ifndef DCPOMATIC_AUDIO_ANALYSIS_H #define DCPOMATIC_AUDIO_ANALYSIS_H @@ -24,6 +28,9 @@ #include <list> #include <boost/filesystem.hpp> +/** @class AudioPoint + * @brief A single point of an audio analysis for one portion of one channel. + */ class AudioPoint { public: @@ -48,6 +55,14 @@ private: float _data[COUNT]; }; +/** @class AudioAnalysis + * @brief An analysis of the audio data in a piece of AudioContent. + * + * This is a set of AudioPoints for each channel. The AudioPoints + * each represent some measurement of the audio over a portion of the + * content. For example each AudioPoint may give the RMS level of + * a 1-minute portion of the audio. + */ class AudioAnalysis : public boost::noncopyable { public: diff --git a/src/lib/audio_buffers.h b/src/lib/audio_buffers.h index 23e41954f..51488c39a 100644 --- a/src/lib/audio_buffers.h +++ b/src/lib/audio_buffers.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net> 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,8 +17,12 @@ */ -#ifndef DVDOMATIC_AUDIO_BUFFERS_H -#define DVDOMATIC_AUDIO_BUFFERS_H +/** @file src/lib/audio_buffers.h + * @brief AudioBuffers class. + */ + +#ifndef DCPOMATIC_AUDIO_BUFFERS_H +#define DCPOMATIC_AUDIO_BUFFERS_H #include <boost/shared_ptr.hpp> diff --git a/src/lib/util.cc b/src/lib/util.cc index c23deb59e..45d5a757c 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -958,12 +958,16 @@ dependency_version_summary () return s.str (); } +/** Construct a ScopedTemporary. A temporary filename is decided but the file is not opened + * until ::open() is called. + */ ScopedTemporary::ScopedTemporary () : _open (0) { _file = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path (); } +/** Close and delete the temporary file */ ScopedTemporary::~ScopedTemporary () { close (); @@ -971,12 +975,16 @@ ScopedTemporary::~ScopedTemporary () boost::filesystem::remove (_file, ec); } +/** @return temporary filename */ char const * ScopedTemporary::c_str () const { return _file.string().c_str (); } +/** Open the temporary file. + * @return File's FILE pointer. + */ FILE* ScopedTemporary::open (char const * params) { @@ -984,6 +992,7 @@ ScopedTemporary::open (char const * params) return _open; } +/** Close the file */ void ScopedTemporary::close () { diff --git a/src/lib/util.h b/src/lib/util.h index 579b1c231..a13d7ff73 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -141,16 +141,20 @@ private: char* _old; }; +/** @class ScopedTemporary + * @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope. + */ class ScopedTemporary { public: ScopedTemporary (); ~ScopedTemporary (); + /** @return temporary filename */ boost::filesystem::path file () const { return _file; } - + char const * c_str () const; FILE* open (char const *); void close (); |
