ReplayGainInfo: use CamelCase for struct name
This commit is contained in:
@@ -93,7 +93,7 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
|
||||
if (data->unsupported)
|
||||
return;
|
||||
|
||||
struct replay_gain_info rgi;
|
||||
ReplayGainInfo rgi;
|
||||
char *mixramp_start;
|
||||
char *mixramp_end;
|
||||
|
||||
@@ -103,7 +103,7 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
|
||||
break;
|
||||
|
||||
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
|
||||
if (flac_parse_replay_gain(&rgi, block))
|
||||
if (flac_parse_replay_gain(rgi, block))
|
||||
decoder_replay_gain(data->decoder, &rgi);
|
||||
|
||||
if (flac_parse_mixramp(&mixramp_start, &mixramp_end, block))
|
||||
|
@@ -61,24 +61,24 @@ flac_find_float_comment(const FLAC__StreamMetadata *block,
|
||||
}
|
||||
|
||||
bool
|
||||
flac_parse_replay_gain(struct replay_gain_info *rgi,
|
||||
flac_parse_replay_gain(ReplayGainInfo &rgi,
|
||||
const FLAC__StreamMetadata *block)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
replay_gain_info_init(rgi);
|
||||
replay_gain_info_init(&rgi);
|
||||
|
||||
if (flac_find_float_comment(block, "replaygain_album_gain",
|
||||
&rgi->tuples[REPLAY_GAIN_ALBUM].gain))
|
||||
&rgi.tuples[REPLAY_GAIN_ALBUM].gain))
|
||||
found = true;
|
||||
if (flac_find_float_comment(block, "replaygain_album_peak",
|
||||
&rgi->tuples[REPLAY_GAIN_ALBUM].peak))
|
||||
&rgi.tuples[REPLAY_GAIN_ALBUM].peak))
|
||||
found = true;
|
||||
if (flac_find_float_comment(block, "replaygain_track_gain",
|
||||
&rgi->tuples[REPLAY_GAIN_TRACK].gain))
|
||||
&rgi.tuples[REPLAY_GAIN_TRACK].gain))
|
||||
found = true;
|
||||
if (flac_find_float_comment(block, "replaygain_track_peak",
|
||||
&rgi->tuples[REPLAY_GAIN_TRACK].peak))
|
||||
&rgi.tuples[REPLAY_GAIN_TRACK].peak))
|
||||
found = true;
|
||||
|
||||
return found;
|
||||
|
@@ -110,7 +110,7 @@ public:
|
||||
|
||||
struct tag_handler;
|
||||
struct Tag;
|
||||
struct replay_gain_info;
|
||||
struct ReplayGainInfo;
|
||||
|
||||
static inline unsigned
|
||||
flac_duration(const FLAC__StreamMetadata_StreamInfo *stream_info)
|
||||
@@ -122,7 +122,7 @@ flac_duration(const FLAC__StreamMetadata_StreamInfo *stream_info)
|
||||
}
|
||||
|
||||
bool
|
||||
flac_parse_replay_gain(struct replay_gain_info *rgi,
|
||||
flac_parse_replay_gain(ReplayGainInfo &rgi,
|
||||
const FLAC__StreamMetadata *block);
|
||||
|
||||
bool
|
||||
|
@@ -251,7 +251,7 @@ MadDecoder::FillBuffer()
|
||||
|
||||
#ifdef HAVE_ID3TAG
|
||||
static bool
|
||||
parse_id3_replay_gain_info(struct replay_gain_info *replay_gain_info,
|
||||
parse_id3_replay_gain_info(ReplayGainInfo &rgi,
|
||||
struct id3_tag *tag)
|
||||
{
|
||||
int i;
|
||||
@@ -260,7 +260,7 @@ parse_id3_replay_gain_info(struct replay_gain_info *replay_gain_info,
|
||||
struct id3_frame *frame;
|
||||
bool found = false;
|
||||
|
||||
replay_gain_info_init(replay_gain_info);
|
||||
replay_gain_info_init(&rgi);
|
||||
|
||||
for (i = 0; (frame = id3_tag_findframe(tag, "TXXX", i)); i++) {
|
||||
if (frame->nfields < 3)
|
||||
@@ -274,16 +274,16 @@ parse_id3_replay_gain_info(struct replay_gain_info *replay_gain_info,
|
||||
(&frame->fields[2]));
|
||||
|
||||
if (StringEqualsCaseASCII(key, "replaygain_track_gain")) {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = atof(value);
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].gain = atof(value);
|
||||
found = true;
|
||||
} else if (StringEqualsCaseASCII(key, "replaygain_album_gain")) {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = atof(value);
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].gain = atof(value);
|
||||
found = true;
|
||||
} else if (StringEqualsCaseASCII(key, "replaygain_track_peak")) {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak = atof(value);
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].peak = atof(value);
|
||||
found = true;
|
||||
} else if (StringEqualsCaseASCII(key, "replaygain_album_peak")) {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak = atof(value);
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].peak = atof(value);
|
||||
found = true;
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ parse_id3_replay_gain_info(struct replay_gain_info *replay_gain_info,
|
||||
|
||||
return found ||
|
||||
/* fall back on RVA2 if no replaygain tags found */
|
||||
tag_rva2_parse(tag, replay_gain_info);
|
||||
tag_rva2_parse(tag, rgi);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -392,11 +392,11 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag)
|
||||
}
|
||||
|
||||
if (decoder != nullptr) {
|
||||
struct replay_gain_info rgi;
|
||||
ReplayGainInfo rgi;
|
||||
char *mixramp_start;
|
||||
char *mixramp_end;
|
||||
|
||||
if (parse_id3_replay_gain_info(&rgi, id3_tag)) {
|
||||
if (parse_id3_replay_gain_info(rgi, id3_tag)) {
|
||||
decoder_replay_gain(*decoder, &rgi);
|
||||
found_replay_gain = true;
|
||||
}
|
||||
@@ -871,7 +871,7 @@ MadDecoder::DecodeFirstFrame(Tag **tag)
|
||||
* parse_lame() for details. -- jat */
|
||||
if (decoder != nullptr && !found_replay_gain &&
|
||||
lame.track_gain) {
|
||||
struct replay_gain_info rgi;
|
||||
ReplayGainInfo rgi;
|
||||
replay_gain_info_init(&rgi);
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].gain = lame.track_gain;
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].peak = lame.peak;
|
||||
|
@@ -168,14 +168,14 @@ mpcdec_decode(Decoder &mpd_decoder, InputStream &is)
|
||||
return;
|
||||
}
|
||||
|
||||
struct replay_gain_info replay_gain_info;
|
||||
replay_gain_info_init(&replay_gain_info);
|
||||
replay_gain_info.tuples[REPLAY_GAIN_ALBUM].gain = MPC_OLD_GAIN_REF - (info.gain_album / 256.);
|
||||
replay_gain_info.tuples[REPLAY_GAIN_ALBUM].peak = pow(10, info.peak_album / 256. / 20) / 32767;
|
||||
replay_gain_info.tuples[REPLAY_GAIN_TRACK].gain = MPC_OLD_GAIN_REF - (info.gain_title / 256.);
|
||||
replay_gain_info.tuples[REPLAY_GAIN_TRACK].peak = pow(10, info.peak_title / 256. / 20) / 32767;
|
||||
ReplayGainInfo rgi;
|
||||
replay_gain_info_init(&rgi);
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].gain = MPC_OLD_GAIN_REF - (info.gain_album / 256.);
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].peak = pow(10, info.peak_album / 256. / 20) / 32767;
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].gain = MPC_OLD_GAIN_REF - (info.gain_title / 256.);
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].peak = pow(10, info.peak_title / 256. / 20) / 32767;
|
||||
|
||||
decoder_replay_gain(mpd_decoder, &replay_gain_info);
|
||||
decoder_replay_gain(mpd_decoder, &rgi);
|
||||
|
||||
decoder_initialized(mpd_decoder, audio_format,
|
||||
is.IsSeekable(),
|
||||
|
@@ -282,7 +282,7 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
|
||||
inline DecoderCommand
|
||||
MPDOpusDecoder::HandleTags(const ogg_packet &packet)
|
||||
{
|
||||
replay_gain_info rgi;
|
||||
ReplayGainInfo rgi;
|
||||
replay_gain_info_init(&rgi);
|
||||
|
||||
TagBuilder tag_builder;
|
||||
|
@@ -42,7 +42,7 @@ ParseOpusTagName(const char *name)
|
||||
|
||||
static void
|
||||
ScanOneOpusTag(const char *name, const char *value,
|
||||
replay_gain_info *rgi,
|
||||
ReplayGainInfo *rgi,
|
||||
const struct tag_handler *handler, void *ctx)
|
||||
{
|
||||
if (rgi != nullptr && strcmp(name, "R128_TRACK_GAIN") == 0) {
|
||||
@@ -66,7 +66,7 @@ ScanOneOpusTag(const char *name, const char *value,
|
||||
|
||||
bool
|
||||
ScanOpusTags(const void *data, size_t size,
|
||||
replay_gain_info *rgi,
|
||||
ReplayGainInfo *rgi,
|
||||
const struct tag_handler *handler, void *ctx)
|
||||
{
|
||||
OpusReader r(data, size);
|
||||
|
@@ -24,11 +24,11 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
struct replay_gain_info;
|
||||
struct ReplayGainInfo;
|
||||
|
||||
bool
|
||||
ScanOpusTags(const void *data, size_t size,
|
||||
replay_gain_info *rgi,
|
||||
ReplayGainInfo *rgi,
|
||||
const struct tag_handler *handler, void *ctx);
|
||||
|
||||
#endif
|
||||
|
@@ -47,29 +47,29 @@ vorbis_comment_value(const char *comment, const char *needle)
|
||||
}
|
||||
|
||||
bool
|
||||
vorbis_comments_to_replay_gain(struct replay_gain_info *rgi, char **comments)
|
||||
vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments)
|
||||
{
|
||||
const char *temp;
|
||||
bool found = false;
|
||||
|
||||
replay_gain_info_init(rgi);
|
||||
replay_gain_info_init(&rgi);
|
||||
|
||||
while (*comments) {
|
||||
if ((temp =
|
||||
vorbis_comment_value(*comments, "replaygain_track_gain"))) {
|
||||
rgi->tuples[REPLAY_GAIN_TRACK].gain = atof(temp);
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].gain = atof(temp);
|
||||
found = true;
|
||||
} else if ((temp = vorbis_comment_value(*comments,
|
||||
"replaygain_album_gain"))) {
|
||||
rgi->tuples[REPLAY_GAIN_ALBUM].gain = atof(temp);
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].gain = atof(temp);
|
||||
found = true;
|
||||
} else if ((temp = vorbis_comment_value(*comments,
|
||||
"replaygain_track_peak"))) {
|
||||
rgi->tuples[REPLAY_GAIN_TRACK].peak = atof(temp);
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].peak = atof(temp);
|
||||
found = true;
|
||||
} else if ((temp = vorbis_comment_value(*comments,
|
||||
"replaygain_album_peak"))) {
|
||||
rgi->tuples[REPLAY_GAIN_ALBUM].peak = atof(temp);
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].peak = atof(temp);
|
||||
found = true;
|
||||
}
|
||||
|
||||
|
@@ -22,12 +22,12 @@
|
||||
|
||||
#include "check.h"
|
||||
|
||||
struct replay_gain_info;
|
||||
struct ReplayGainInfo;
|
||||
struct tag_handler;
|
||||
struct Tag;
|
||||
|
||||
bool
|
||||
vorbis_comments_to_replay_gain(struct replay_gain_info *rgi, char **comments);
|
||||
vorbis_comments_to_replay_gain(ReplayGainInfo &rgi, char **comments);
|
||||
|
||||
void
|
||||
vorbis_comments_scan(char **comments,
|
||||
|
@@ -283,8 +283,8 @@ vorbis_stream_decode(Decoder &decoder,
|
||||
char **comments = ov_comment(&vf, -1)->user_comments;
|
||||
vorbis_send_comments(decoder, input_stream, comments);
|
||||
|
||||
struct replay_gain_info rgi;
|
||||
if (vorbis_comments_to_replay_gain(&rgi, comments))
|
||||
ReplayGainInfo rgi;
|
||||
if (vorbis_comments_to_replay_gain(rgi, comments))
|
||||
decoder_replay_gain(decoder, &rgi);
|
||||
|
||||
prev_section = current_section;
|
||||
|
@@ -221,29 +221,21 @@ wavpack_tag_float(WavpackContext *wpc, const char *key, float *value_r)
|
||||
}
|
||||
|
||||
static bool
|
||||
wavpack_replaygain(struct replay_gain_info *replay_gain_info,
|
||||
wavpack_replaygain(ReplayGainInfo &rgi,
|
||||
WavpackContext *wpc)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
replay_gain_info_init(replay_gain_info);
|
||||
replay_gain_info_init(&rgi);
|
||||
|
||||
found |= wavpack_tag_float(
|
||||
wpc, "replaygain_track_gain",
|
||||
&replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain
|
||||
);
|
||||
found |= wavpack_tag_float(
|
||||
wpc, "replaygain_track_peak",
|
||||
&replay_gain_info->tuples[REPLAY_GAIN_TRACK].peak
|
||||
);
|
||||
found |= wavpack_tag_float(
|
||||
wpc, "replaygain_album_gain",
|
||||
&replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain
|
||||
);
|
||||
found |= wavpack_tag_float(
|
||||
wpc, "replaygain_album_peak",
|
||||
&replay_gain_info->tuples[REPLAY_GAIN_ALBUM].peak
|
||||
);
|
||||
found |= wavpack_tag_float(wpc, "replaygain_track_gain",
|
||||
&rgi.tuples[REPLAY_GAIN_TRACK].gain);
|
||||
found |= wavpack_tag_float(wpc, "replaygain_track_peak",
|
||||
&rgi.tuples[REPLAY_GAIN_TRACK].peak);
|
||||
found |= wavpack_tag_float(wpc, "replaygain_album_gain",
|
||||
&rgi.tuples[REPLAY_GAIN_ALBUM].gain);
|
||||
found |= wavpack_tag_float(wpc, "replaygain_album_peak",
|
||||
&rgi.tuples[REPLAY_GAIN_ALBUM].peak);
|
||||
|
||||
return found;
|
||||
}
|
||||
@@ -547,9 +539,9 @@ wavpack_filedecode(Decoder &decoder, const char *fname)
|
||||
return;
|
||||
}
|
||||
|
||||
struct replay_gain_info replay_gain_info;
|
||||
if (wavpack_replaygain(&replay_gain_info, wpc))
|
||||
decoder_replay_gain(decoder, &replay_gain_info);
|
||||
ReplayGainInfo rgi;
|
||||
if (wavpack_replaygain(rgi, wpc))
|
||||
decoder_replay_gain(decoder, &rgi);
|
||||
|
||||
wavpack_decode(decoder, wpc, true);
|
||||
|
||||
|
Reference in New Issue
Block a user