annotate src/flac-1.2.1/include/share/grabbag/replaygain.h @ 23:619f715526df sv_v2.1

Update Vamp plugin SDK to 2.5
author Chris Cannam
date Thu, 09 May 2013 10:52:46 +0100
parents 05aa0afa9217
children
rev   line source
Chris@1 1 /* grabbag - Convenience lib for various routines common to several tools
Chris@1 2 * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson
Chris@1 3 *
Chris@1 4 * This library is free software; you can redistribute it and/or
Chris@1 5 * modify it under the terms of the GNU Lesser General Public
Chris@1 6 * License as published by the Free Software Foundation; either
Chris@1 7 * version 2.1 of the License, or (at your option) any later version.
Chris@1 8 *
Chris@1 9 * This library is distributed in the hope that it will be useful,
Chris@1 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Chris@1 12 * Lesser General Public License for more details.
Chris@1 13 *
Chris@1 14 * You should have received a copy of the GNU Lesser General Public
Chris@1 15 * License along with this library; if not, write to the Free Software
Chris@1 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Chris@1 17 */
Chris@1 18
Chris@1 19 /*
Chris@1 20 * This wraps the replaygain_analysis lib, which is LGPL. This wrapper
Chris@1 21 * allows analysis of different input resolutions by automatically
Chris@1 22 * scaling the input signal
Chris@1 23 */
Chris@1 24
Chris@1 25 /* This .h cannot be included by itself; #include "share/grabbag.h" instead. */
Chris@1 26
Chris@1 27 #ifndef GRABBAG__REPLAYGAIN_H
Chris@1 28 #define GRABBAG__REPLAYGAIN_H
Chris@1 29
Chris@1 30 #include "FLAC/metadata.h"
Chris@1 31
Chris@1 32 #ifdef __cplusplus
Chris@1 33 extern "C" {
Chris@1 34 #endif
Chris@1 35
Chris@1 36 extern const unsigned GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED;
Chris@1 37
Chris@1 38 extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS; /* = "REPLAYGAIN_REFERENCE_LOUDNESS" */
Chris@1 39 extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN; /* = "REPLAYGAIN_TRACK_GAIN" */
Chris@1 40 extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK; /* = "REPLAYGAIN_TRACK_PEAK" */
Chris@1 41 extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN; /* = "REPLAYGAIN_ALBUM_GAIN" */
Chris@1 42 extern const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK; /* = "REPLAYGAIN_ALBUM_PEAK" */
Chris@1 43
Chris@1 44 FLAC__bool grabbag__replaygain_is_valid_sample_frequency(unsigned sample_frequency);
Chris@1 45
Chris@1 46 FLAC__bool grabbag__replaygain_init(unsigned sample_frequency);
Chris@1 47
Chris@1 48 /* 'bps' must be valid for FLAC, i.e. >=4 and <= 32 */
Chris@1 49 FLAC__bool grabbag__replaygain_analyze(const FLAC__int32 * const input[], FLAC__bool is_stereo, unsigned bps, unsigned samples);
Chris@1 50
Chris@1 51 void grabbag__replaygain_get_album(float *gain, float *peak);
Chris@1 52 void grabbag__replaygain_get_title(float *gain, float *peak);
Chris@1 53
Chris@1 54 /* These three functions return an error string on error, or NULL if successful */
Chris@1 55 const char *grabbag__replaygain_analyze_file(const char *filename, float *title_gain, float *title_peak);
Chris@1 56 const char *grabbag__replaygain_store_to_vorbiscomment(FLAC__StreamMetadata *block, float album_gain, float album_peak, float title_gain, float title_peak);
Chris@1 57 const char *grabbag__replaygain_store_to_vorbiscomment_reference(FLAC__StreamMetadata *block);
Chris@1 58 const char *grabbag__replaygain_store_to_vorbiscomment_album(FLAC__StreamMetadata *block, float album_gain, float album_peak);
Chris@1 59 const char *grabbag__replaygain_store_to_vorbiscomment_title(FLAC__StreamMetadata *block, float title_gain, float title_peak);
Chris@1 60 const char *grabbag__replaygain_store_to_file(const char *filename, float album_gain, float album_peak, float title_gain, float title_peak, FLAC__bool preserve_modtime);
Chris@1 61 const char *grabbag__replaygain_store_to_file_reference(const char *filename, FLAC__bool preserve_modtime);
Chris@1 62 const char *grabbag__replaygain_store_to_file_album(const char *filename, float album_gain, float album_peak, FLAC__bool preserve_modtime);
Chris@1 63 const char *grabbag__replaygain_store_to_file_title(const char *filename, float title_gain, float title_peak, FLAC__bool preserve_modtime);
Chris@1 64
Chris@1 65 FLAC__bool grabbag__replaygain_load_from_vorbiscomment(const FLAC__StreamMetadata *block, FLAC__bool album_mode, FLAC__bool strict, double *reference, double *gain, double *peak);
Chris@1 66 double grabbag__replaygain_compute_scale_factor(double peak, double gain, double preamp, FLAC__bool prevent_clipping);
Chris@1 67
Chris@1 68 #ifdef __cplusplus
Chris@1 69 }
Chris@1 70 #endif
Chris@1 71
Chris@1 72 #endif