Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Strogin
flac
Commits
f8ffa1a7
Commit
f8ffa1a7
authored
Sep 02, 2005
by
Josh Coalson
Browse files
add new replaygain module
parent
99ea6407
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugin_common/Makefile.am
View file @
f8ffa1a7
...
...
@@ -27,11 +27,13 @@ noinst_HEADERS = \
defs.h
\
dither.h
\
locale_hack.h
\
replaygain.h
\
tags.h
libplugin_common_la_SOURCES
=
\
charset.c
\
dither.c
\
replaygain.c
\
tags.c
EXTRA_DIST
=
\
...
...
src/plugin_common/Makefile.lite
View file @
f8ffa1a7
...
...
@@ -28,6 +28,7 @@ DEFINES =
SRCS_C
=
\
charset.c
\
dither.c
\
replaygain.c
\
tags.c
include
$(topdir)/build/lib.mk
...
...
src/plugin_common/plugin_common_static.dsp
View file @
f8ffa1a7
...
...
@@ -93,6 +93,10 @@ SOURCE=.\dither.c
# End Source File
# Begin Source File
SOURCE=.\replaygain.c
# End Source File
# Begin Source File
SOURCE=.\tags.c
# End Source File
# End Group
...
...
@@ -117,6 +121,10 @@ SOURCE=.\locale_hack.h
# End Source File
# Begin Source File
SOURCE=.\replaygain.h
# End Source File
# Begin Source File
SOURCE=.\tags.h
# End Source File
# End Group
...
...
src/plugin_common/replaygain.c
0 → 100644
View file @
f8ffa1a7
/* plugin_common - Routines common to several plugins
* Copyright (C) 2002,2003 Josh Coalson
* Copyright (C) 2003 Philip Jgenstedt
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include
"replaygain.h"
#include
"FLAC/ordinals.h"
#include
"FLAC/metadata.h"
#include
"share/grabbag.h"
void
FLAC_plugin__replaygain_get_from_file
(
const
char
*
filename
,
double
*
track_gain
,
FLAC__bool
*
track_gain_set
,
double
*
album_gain
,
FLAC__bool
*
album_gain_set
,
double
*
track_peak
,
FLAC__bool
*
track_peak_set
,
double
*
album_peak
,
FLAC__bool
*
album_peak_set
)
{
*
track_gain_set
=
*
album_gain_set
=
*
track_peak_set
=
*
album_peak_set
=
false
;
/* Largely stolen from vorbiscomment.c and the other replaygain.c */
FLAC__Metadata_SimpleIterator
*
iterator
=
FLAC__metadata_simple_iterator_new
();
if
(
0
!=
iterator
)
{
if
(
FLAC__metadata_simple_iterator_init
(
iterator
,
filename
,
/*read_only=*/
true
,
/*preserve_file_stats=*/
true
))
{
FLAC__bool
got_vorbis_comments
=
false
;
do
{
if
(
FLAC__metadata_simple_iterator_get_block_type
(
iterator
)
==
FLAC__METADATA_TYPE_VORBIS_COMMENT
)
{
FLAC__StreamMetadata
*
block
=
FLAC__metadata_simple_iterator_get_block
(
iterator
);
if
(
0
!=
block
)
{
if
(
grabbag__replaygain_load_from_vorbiscomment
(
block
,
/*album_mode=*/
false
,
/*strict=*/
true
,
track_gain
,
track_peak
))
{
*
track_gain_set
=
*
track_peak_set
=
true
;
}
if
(
grabbag__replaygain_load_from_vorbiscomment
(
block
,
/*album_mode=*/
true
,
/*strict=*/
true
,
album_gain
,
album_peak
))
{
*
album_gain_set
=
*
album_peak_set
=
true
;
}
FLAC__metadata_object_delete
(
block
);
got_vorbis_comments
=
true
;
}
}
}
while
(
!
got_vorbis_comments
&&
FLAC__metadata_simple_iterator_next
(
iterator
));
}
FLAC__metadata_simple_iterator_delete
(
iterator
);
}
return
;
}
src/plugin_common/replaygain.h
0 → 100644
View file @
f8ffa1a7
/* plugin_common - Routines common to several plugins
* Copyright (C) 2002,2003 Josh Coalson
* Copyright (C) 2003 Philip Jgenstedt
*
* 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 the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef FLAC__PLUGIN_COMMON__REPLAYGAIN_H
#define FLAC__PLUGIN_COMMON__REPLAYGAIN_H
#include
"FLAC/ordinals.h"
void
FLAC_plugin__replaygain_get_from_file
(
const
char
*
filename
,
double
*
track_gain
,
FLAC__bool
*
track_gain_set
,
double
*
album_gain
,
FLAC__bool
*
album_gain_set
,
double
*
track_peak
,
FLAC__bool
*
track_peak_set
,
double
*
album_peak
,
FLAC__bool
*
album_peak_set
);
#endif
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment