replay_gain: converted struct replay_gain_info elements to an array

Having an array instead of individual variables allows the use of the
replay_gain_mode enum as an array index.
This commit is contained in:
Max Kellermann
2008-11-11 16:24:27 +01:00
parent 5e686add91
commit 5ddde0aac7
7 changed files with 47 additions and 45 deletions

View File

@@ -157,10 +157,10 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
audio_format.sample_rate = info.sample_freq;
replayGainInfo = replay_gain_info_new();
replayGainInfo->album_gain = info.gain_album * 0.01;
replayGainInfo->album_peak = info.peak_album / 32767.0;
replayGainInfo->track_gain = info.gain_title * 0.01;
replayGainInfo->track_peak = info.peak_title / 32767.0;
replayGainInfo->tuples[REPLAY_GAIN_ALBUM].gain = info.gain_album * 0.01;
replayGainInfo->tuples[REPLAY_GAIN_ALBUM].peak = info.peak_album / 32767.0;
replayGainInfo->tuples[REPLAY_GAIN_TRACK].gain = info.gain_title * 0.01;
replayGainInfo->tuples[REPLAY_GAIN_TRACK].peak = info.peak_title / 32767.0;
decoder_initialized(mpd_decoder, &audio_format,
inStream->seekable,