Add ReplayGain analysis element (#357069).
[platform/upstream/gst-plugins-good.git] / gst / replaygain / rganalysis.h
1 /* GStreamer ReplayGain analysis
2  *
3  * Copyright (C) 2006 Rene Stadler <mail@renestadler.de>
4  * Copyright (C) 2001 David Robinson <David@Robinson.org>
5  *                    Glen Sawyer <glensawyer@hotmail.com>
6  *
7  * rganalysis.h: Analyze raw audio data in accordance with ReplayGain
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1 of
12  * the License, or (at your option) any later version.
13  * 
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  * 
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23  */
24
25 #ifndef __RG_ANALYSIS_H__
26 #define __RG_ANALYSIS_H__
27
28 #include <glib.h>
29
30 G_BEGIN_DECLS
31
32 #define RG_REFERENCE_LEVEL 89.
33
34 typedef struct _RgAnalysisCtx RgAnalysisCtx;
35
36 RgAnalysisCtx *rg_analysis_new (void);
37 gboolean rg_analysis_set_sample_rate (RgAnalysisCtx * ctx, gint sample_rate);
38 void rg_analysis_analyze_mono_float (RgAnalysisCtx * ctx, gconstpointer data,
39     gsize size, guint depth);
40 void rg_analysis_analyze_stereo_float (RgAnalysisCtx * ctx, gconstpointer data,
41     gsize size, guint depth);
42 void rg_analysis_analyze_mono_int16 (RgAnalysisCtx * ctx, gconstpointer data,
43     gsize size, guint depth);
44 void rg_analysis_analyze_stereo_int16 (RgAnalysisCtx * ctx, gconstpointer data,
45     gsize size, guint depth);
46 void rg_analysis_analyze (RgAnalysisCtx * ctx, const gfloat * samples_l,
47     const gfloat * samples_r, guint n_samples);
48 gboolean rg_analysis_track_result (RgAnalysisCtx * ctx, gdouble * gain,
49     gdouble * peak);
50 gboolean rg_analysis_album_result (RgAnalysisCtx * ctx, gdouble * gain,
51     gdouble * peak);
52 void rg_analysis_reset_album (RgAnalysisCtx * ctx);
53 void rg_analysis_reset (RgAnalysisCtx * ctx);
54 void rg_analysis_destroy (RgAnalysisCtx * ctx);
55
56 G_END_DECLS
57
58 #endif /* __RG_ANALYSIS_H__ */