Mercurial > audlegacy-plugins
diff src/flacng/tools.c @ 2991:2cdf6400594c
flacng: enable replaygain
author | Teemu Torma <teemu@torma.org> |
---|---|
date | Tue, 10 Feb 2009 23:56:41 +0100 |
parents | f1b6f1b2cdb3 |
children | 3b200cf6d1b7 |
line wrap: on
line diff
--- a/src/flacng/tools.c Fri Feb 06 14:10:52 2009 +0200 +++ b/src/flacng/tools.c Tue Feb 10 23:56:41 2009 +0100 @@ -400,3 +400,32 @@ _LEAVE; } + +/* --- */ + +ReplayGainInfo get_replay_gain(callback_info *info) { + + ReplayGainInfo rg; + + if (info->replaygain.has_rg) { + rg.track_gain = (info->replaygain.track_gain + ? atof(info->replaygain.track_gain) + : 0.0); + rg.track_peak = (info->replaygain.track_peak + ? atof(info->replaygain.track_peak) + : 0.0); + rg.album_gain = (info->replaygain.album_gain + ? atof(info->replaygain.album_gain) + : 0.0); + rg.album_peak = (info->replaygain.album_peak + ? atof(info->replaygain.album_peak) + : 0.0); + } else { + rg.track_gain = 0.0; + rg.track_peak = 0.0; + rg.album_gain = 0.0; + rg.album_peak = 0.0; + } + + return rg; +}