test/FakeDecoderAPI: move code to DumpReplayGainTuple()
This commit is contained in:
parent
0759d72108
commit
85c2b396ce
@ -121,18 +121,26 @@ FakeDecoder::SubmitTag(gcc_unused InputStream *is,
|
|||||||
return DecoderCommand::NONE;
|
return DecoderCommand::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DumpReplayGainTuple(const char *name, const ReplayGainTuple &tuple)
|
||||||
|
{
|
||||||
|
if (tuple.IsDefined())
|
||||||
|
fprintf(stderr, "replay_gain[%s]: gain=%f peak=%f\n",
|
||||||
|
name, tuple.gain, tuple.peak);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DumpReplayGainInfo(const ReplayGainInfo &info)
|
||||||
|
{
|
||||||
|
DumpReplayGainTuple("album", info.tuples[REPLAY_GAIN_ALBUM]);
|
||||||
|
DumpReplayGainTuple("track", info.tuples[REPLAY_GAIN_TRACK]);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FakeDecoder::SubmitReplayGain(const ReplayGainInfo *rgi)
|
FakeDecoder::SubmitReplayGain(const ReplayGainInfo *rgi)
|
||||||
{
|
{
|
||||||
const ReplayGainTuple *tuple = &rgi->tuples[REPLAY_GAIN_ALBUM];
|
if (rgi != nullptr)
|
||||||
if (tuple->IsDefined())
|
DumpReplayGainInfo(*rgi);
|
||||||
fprintf(stderr, "replay_gain[album]: gain=%f peak=%f\n",
|
|
||||||
tuple->gain, tuple->peak);
|
|
||||||
|
|
||||||
tuple = &rgi->tuples[REPLAY_GAIN_TRACK];
|
|
||||||
if (tuple->IsDefined())
|
|
||||||
fprintf(stderr, "replay_gain[track]: gain=%f peak=%f\n",
|
|
||||||
tuple->gain, tuple->peak);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -45,6 +45,21 @@ config_get_string(gcc_unused enum ConfigOption option,
|
|||||||
return default_value;
|
return default_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DumpReplayGainTuple(const char *name, const ReplayGainTuple &tuple)
|
||||||
|
{
|
||||||
|
if (tuple.IsDefined())
|
||||||
|
fprintf(stderr, "replay_gain[%s]: gain=%f peak=%f\n",
|
||||||
|
name, tuple.gain, tuple.peak);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DumpReplayGainInfo(const ReplayGainInfo &info)
|
||||||
|
{
|
||||||
|
DumpReplayGainTuple("album", info.tuples[REPLAY_GAIN_ALBUM]);
|
||||||
|
DumpReplayGainTuple("track", info.tuples[REPLAY_GAIN_TRACK]);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
try {
|
try {
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
@ -79,15 +94,7 @@ try {
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ReplayGainTuple *tuple = &replay_gain.tuples[REPLAY_GAIN_ALBUM];
|
DumpReplayGainInfo(replay_gain);
|
||||||
if (tuple->IsDefined())
|
|
||||||
fprintf(stderr, "replay_gain[album]: gain=%f peak=%f\n",
|
|
||||||
tuple->gain, tuple->peak);
|
|
||||||
|
|
||||||
tuple = &replay_gain.tuples[REPLAY_GAIN_TRACK];
|
|
||||||
if (tuple->IsDefined())
|
|
||||||
fprintf(stderr, "replay_gain[track]: gain=%f peak=%f\n",
|
|
||||||
tuple->gain, tuple->peak);
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user