ReplayGainInfo: use CamelCase for struct name
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
static bool
|
||||
replay_gain_ape_callback(unsigned long flags, const char *key,
|
||||
const char *_value, size_t value_length,
|
||||
struct replay_gain_info *info)
|
||||
ReplayGainInfo &info)
|
||||
{
|
||||
/* we only care about utf-8 text tags */
|
||||
if ((flags & (0x3 << 1)) != 0)
|
||||
@@ -43,27 +43,27 @@ replay_gain_ape_callback(unsigned long flags, const char *key,
|
||||
value[value_length] = 0;
|
||||
|
||||
if (StringEqualsCaseASCII(key, "replaygain_track_gain")) {
|
||||
info->tuples[REPLAY_GAIN_TRACK].gain = atof(value);
|
||||
info.tuples[REPLAY_GAIN_TRACK].gain = atof(value);
|
||||
return true;
|
||||
} else if (StringEqualsCaseASCII(key, "replaygain_album_gain")) {
|
||||
info->tuples[REPLAY_GAIN_ALBUM].gain = atof(value);
|
||||
info.tuples[REPLAY_GAIN_ALBUM].gain = atof(value);
|
||||
return true;
|
||||
} else if (StringEqualsCaseASCII(key, "replaygain_track_peak")) {
|
||||
info->tuples[REPLAY_GAIN_TRACK].peak = atof(value);
|
||||
info.tuples[REPLAY_GAIN_TRACK].peak = atof(value);
|
||||
return true;
|
||||
} else if (StringEqualsCaseASCII(key, "replaygain_album_peak")) {
|
||||
info->tuples[REPLAY_GAIN_ALBUM].peak = atof(value);
|
||||
info.tuples[REPLAY_GAIN_ALBUM].peak = atof(value);
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
replay_gain_ape_read(const char *path_fs, struct replay_gain_info *info)
|
||||
replay_gain_ape_read(const char *path_fs, ReplayGainInfo &info)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
auto callback = [info, &found]
|
||||
auto callback = [&info, &found]
|
||||
(unsigned long flags, const char *key,
|
||||
const char *value,
|
||||
size_t value_length) {
|
||||
|
@@ -22,9 +22,9 @@
|
||||
|
||||
#include "check.h"
|
||||
|
||||
struct replay_gain_info;
|
||||
struct ReplayGainInfo;
|
||||
|
||||
bool
|
||||
replay_gain_ape_read(const char *path_fs, struct replay_gain_info *info);
|
||||
replay_gain_ape_read(const char *path_fs, ReplayGainInfo &info);
|
||||
|
||||
#endif
|
||||
|
@@ -73,7 +73,7 @@ rva2_float_volume_adjustment(const struct rva2_data *data)
|
||||
}
|
||||
|
||||
static inline bool
|
||||
rva2_apply_data(struct replay_gain_info *replay_gain_info,
|
||||
rva2_apply_data(ReplayGainInfo &rgi,
|
||||
const struct rva2_data *data, const id3_latin1_t *id)
|
||||
{
|
||||
if (data->type != CHANNEL_MASTER_VOLUME)
|
||||
@@ -82,19 +82,19 @@ rva2_apply_data(struct replay_gain_info *replay_gain_info,
|
||||
float volume_adjustment = rva2_float_volume_adjustment(data);
|
||||
|
||||
if (strcmp((const char *)id, "album") == 0) {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = volume_adjustment;
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].gain = volume_adjustment;
|
||||
} else if (strcmp((const char *)id, "track") == 0) {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = volume_adjustment;
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].gain = volume_adjustment;
|
||||
} else {
|
||||
replay_gain_info->tuples[REPLAY_GAIN_ALBUM].gain = volume_adjustment;
|
||||
replay_gain_info->tuples[REPLAY_GAIN_TRACK].gain = volume_adjustment;
|
||||
rgi.tuples[REPLAY_GAIN_ALBUM].gain = volume_adjustment;
|
||||
rgi.tuples[REPLAY_GAIN_TRACK].gain = volume_adjustment;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
rva2_apply_frame(struct replay_gain_info *replay_gain_info,
|
||||
rva2_apply_frame(ReplayGainInfo &replay_gain_info,
|
||||
const struct id3_frame *frame)
|
||||
{
|
||||
const id3_latin1_t *id = id3_field_getlatin1(id3_frame_field(frame, 0));
|
||||
@@ -133,7 +133,7 @@ rva2_apply_frame(struct replay_gain_info *replay_gain_info,
|
||||
}
|
||||
|
||||
bool
|
||||
tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info)
|
||||
tag_rva2_parse(struct id3_tag *tag, ReplayGainInfo &replay_gain_info)
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "check.h"
|
||||
|
||||
struct id3_tag;
|
||||
struct replay_gain_info;
|
||||
struct ReplayGainInfo;
|
||||
|
||||
/**
|
||||
* Parse the RVA2 tag, and fill the #replay_gain_info struct. This is
|
||||
@@ -32,6 +32,6 @@ struct replay_gain_info;
|
||||
* @return true on success
|
||||
*/
|
||||
bool
|
||||
tag_rva2_parse(struct id3_tag *tag, struct replay_gain_info *replay_gain_info);
|
||||
tag_rva2_parse(struct id3_tag *tag, ReplayGainInfo &replay_gain_info);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user