Changeset 218
- Timestamp:
- 02/17/07 15:58:05 (18 years ago)
- Location:
- xmms-musepack/branches/r2d/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
xmms-musepack/branches/r2d/src/libmpc.cpp
r202 r218 545 545 mpcGtkPrintLabel(lengthLabel, "Length: \%d:\%.2d", minutes, seconds); 546 546 mpcGtkPrintLabel(fileSizeLabel, "File size: \%d Bytes", info.total_file_length); 547 mpcGtkPrintLabel(trackPeakLabel, "Track Peak: \%5u", info.peak_title);548 mpcGtkPrintLabel(trackGainLabel, "Track Gain: \%-+2.2f dB", 0.01 * info.gain_title);549 mpcGtkPrintLabel(albumPeakLabel, "Album Peak: \%5u", info.peak_album);550 mpcGtkPrintLabel(albumGainLabel, "Album Gain: \%-+5.2f dB", 0.01 * info.gain_album);547 mpcGtkPrintLabel(trackPeakLabel, "Track Peak: \%2.2f dB", info.peak_title / 256.); 548 mpcGtkPrintLabel(trackGainLabel, "Track Gain: \%2.2f dB", info.gain_title / 256.); 549 mpcGtkPrintLabel(albumPeakLabel, "Album Peak: \%2.2f dB", info.peak_album / 256.); 550 mpcGtkPrintLabel(albumGainLabel, "Album Gain: \%2.2f dB", info.gain_album / 256.); 551 551 552 552 MpcInfo tags = getTags(p_Filename); … … 782 782 783 783 // mpc_decoder_set_seeking(decoder, &info, pluginConfig.fastSeek); 784 // setReplaygain(info, *decoder);784 setReplaygain(demux); 785 785 786 786 MPC_SAMPLE_FORMAT sampleBuffer[MPC_DECODER_BUFFER_LENGTH]; … … 867 867 } 868 868 869 static void setReplaygain(mpc_streaminfo& info, mpc_decoder& decoder) 870 { 871 if(!pluginConfig.replaygain && !pluginConfig.clipPrevention) 872 return; 873 874 int peak = pluginConfig.albumGain ? info.peak_album : info.peak_title; 875 double gain = pluginConfig.albumGain ? info.gain_album : info.gain_title; 876 877 if(!peak) 878 peak = 32767; 879 if(!gain) 880 gain = 1.; 881 882 double clip = 32767. / peak; 883 gain = exp((M_LN10 / 2000.) * gain); 884 885 if(pluginConfig.clipPrevention && !pluginConfig.replaygain) 886 gain = clip; 887 else if(pluginConfig.replaygain && pluginConfig.clipPrevention) 888 if(clip < gain) 889 gain = clip; 890 891 mpc_decoder_scale_output(&decoder, gain); 869 static void setReplaygain(mpc_demux * d) 870 { 871 setReplayLevel(d, 64.82, pluginConfig.replaygain, !pluginConfig.albumGain, 872 pluginConfig.clipPrevention); 892 873 } 893 874 -
xmms-musepack/branches/r2d/src/libmpc.h
r202 r218 175 175 static void setOffset(double); 176 176 static bool isPause(); 177 static void setReplaygain(mpc_ streaminfo&, mpc_decoder&);177 static void setReplaygain(mpc_demux *); 178 178 179 179 #ifdef MPC_FIXED_POINT
Note: See TracChangeset
for help on using the changeset viewer.