本文整理汇总了C++中TrackPointer::setReplayGain方法的典型用法代码示例。如果您正苦于以下问题:C++ TrackPointer::setReplayGain方法的具体用法?C++ TrackPointer::setReplayGain怎么用?C++ TrackPointer::setReplayGain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrackPointer
的用法示例。
在下文中一共展示了TrackPointer::setReplayGain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finalize
void AnalyzerGain::finalize(TrackPointer tio) {
//TODO: We are going to store values as relative peaks so that "0" means that no replaygain has been evaluated.
// This means that we are going to transform from dB to peaks and viceversa.
// One may think to digg into replay_gain code and modify it so that
// it directly sends results as relative peaks.
// In that way there is no need to spend resources in calculating log10 or pow.
if(!m_initalized)
return;
float fReplayGainOutput = m_pReplayGain->end();
if (fReplayGainOutput == GAIN_NOT_ENOUGH_SAMPLES) {
qDebug() << "ReplayGain 1.0 analysis failed";
m_initalized = false;
return;
}
Mixxx::ReplayGain replayGain(tio->getReplayGain());
replayGain.setRatio(db2ratio(fReplayGainOutput));
tio->setReplayGain(replayGain);
qDebug() << "ReplayGain 1.0 result is" << fReplayGainOutput << "dB for" << tio->getLocation();
m_initalized = false;
}
示例2: finalise
void AnalyserGain::finalise(TrackPointer tio) {
//TODO: We are going to store values as relative peaks so that "0" means that no replaygain has been evaluated.
// This means that we are going to transform from dB to peaks and viceversa.
// One may think to digg into replay_gain code and modify it so that
// it directly sends results as relative peaks.
// In that way there is no need to spend resources in calculating log10 or pow.
if(!m_bStepControl)
return;
float ReplayGainOutput = m_pReplayGain->end();
if (ReplayGainOutput == GAIN_NOT_ENOUGH_SAMPLES) {
qDebug() << "ReplayGain analysis failed:" << ReplayGainOutput;
m_bStepControl = false;
return;
}
float fReplayGain_Result = pow(10.0f, ReplayGainOutput / 20.0f);
//qDebug() << "ReplayGain result is" << ReplayGainOutput << "pow:" << fReplayGain_Result;
//qDebug()<<"ReplayGain outputs "<< ReplayGainOutput << "db for track "<< tio->getFilename();
tio->setReplayGain(fReplayGain_Result);
//if(fReplayGain_Result) qDebug() << "ReplayGain Analyser found a ReplayGain value of "<< 20*log10(fReplayGain_Result) << "dB for track " << (tio->getFilename());
m_bStepControl=false;
}