summaryrefslogtreecommitdiff
path: root/src/plugin_common/replaygain.c
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-10-06 16:41:40 +0200
committerGitHub <noreply@github.com>2022-10-06 16:41:40 +0200
commit8fbeff238c41464fe220cd23c45861c9302d1172 (patch)
tree2a031739d4ac35d1ddc1f9ec669f23e81d33861f /src/plugin_common/replaygain.c
parent2440e19a733f045e50cd7f3dbd706b9ed98fc5ef (diff)
downloadflac-8fbeff238c41464fe220cd23c45861c9302d1172.tar.gz
Remove xmms plugin
Diffstat (limited to 'src/plugin_common/replaygain.c')
-rw-r--r--src/plugin_common/replaygain.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/plugin_common/replaygain.c b/src/plugin_common/replaygain.c
deleted file mode 100644
index 7c2f83bb..00000000
--- a/src/plugin_common/replaygain.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* plugin_common - Routines common to several plugins
- * Copyright (C) 2002-2009 Josh Coalson
- * Copyright (C) 2011-2022 Xiph.Org Foundation
- * Copyright (C) 2003 Philip Jägenstedt
- *
- * 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.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "replaygain.h"
-#include "FLAC/ordinals.h"
-#include "FLAC/metadata.h"
-#include "share/grabbag.h"
-
-FLAC__bool FLAC_plugin__replaygain_get_from_file(const char *filename,
- double *reference, FLAC__bool *reference_set,
- 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)
-{
- FLAC__Metadata_SimpleIterator *iterator = FLAC__metadata_simple_iterator_new();
- FLAC__bool ret = false;
-
- *track_gain_set = *album_gain_set = *track_peak_set = *album_peak_set = false;
-
- if(0 != iterator) {
- if(FLAC__metadata_simple_iterator_init(iterator, filename, /*read_only=*/true, /*preserve_file_stats=*/true)) {
- FLAC__bool got_vorbis_comments = false;
- ret = true;
- 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, reference, track_gain, track_peak)) {
- *reference_set = *track_gain_set = *track_peak_set = true;
- }
- if(grabbag__replaygain_load_from_vorbiscomment(block, /*album_mode=*/true, /*strict=*/true, reference, album_gain, album_peak)) {
- *reference_set = *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 ret;
-}