annotate src/flac-1.2.1/include/share/grabbag/replaygain.h @ 124:e3d5853d5918

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