comparison view/Pane.cpp @ 1181:e0ac21f07ab0 bqresample

Fixes to sample rate and latency handling
author Chris Cannam
date Fri, 09 Dec 2016 14:40:49 +0000
parents ba379b4d4555
children 97d0c798c2ac
comparison
equal deleted inserted replaced
1173:db90fee630bc 1181:e0ac21f07ab0
1051 if (r.y() + r.height() < height() - fontHeight - 6) return; 1051 if (r.y() + r.height() < height() - fontHeight - 6) return;
1052 1052
1053 sv_samplerate_t modelRate = waveformModel->getSampleRate(); 1053 sv_samplerate_t modelRate = waveformModel->getSampleRate();
1054 sv_samplerate_t nativeRate = waveformModel->getNativeRate(); 1054 sv_samplerate_t nativeRate = waveformModel->getNativeRate();
1055 sv_samplerate_t playbackRate = m_manager->getPlaybackSampleRate(); 1055 sv_samplerate_t playbackRate = m_manager->getPlaybackSampleRate();
1056 sv_samplerate_t outputRate = m_manager->getOutputSampleRate();
1057 1056
1058 QString srNote = ""; 1057 QString srNote = "";
1059 1058
1060 // Show (R) for waveform models that have been resampled or will 1059 // Show (R) for waveform models that have been resampled during
1061 // be resampled on playback, and (X) for waveform models that will 1060 // load, and (X) for waveform models that will be played at the
1062 // be played at the wrong rate because their rate differs from the 1061 // wrong rate because their rate differs from the current playback
1063 // current playback rate (which is not necessarily that of the 1062 // rate (which is not necessarily that of the main model).
1064 // main model). 1063
1065 1064 if (modelRate != nativeRate) {
1066 if (playbackRate != 0) { 1065 if (playbackRate != 0 && modelRate != playbackRate) {
1067 if (modelRate == playbackRate) {
1068 if (modelRate != outputRate || modelRate != nativeRate) {
1069 srNote = " " + tr("(R)");
1070 }
1071 } else {
1072 srNote = " " + tr("(X)"); 1066 srNote = " " + tr("(X)");
1067 } else {
1068 srNote = " " + tr("(R)");
1073 } 1069 }
1074 } 1070 }
1075 1071
1076 QString desc = tr("%1 / %2Hz%3") 1072 QString desc = tr("%1 / %2Hz%3")
1077 .arg(RealTime::frame2RealTime(waveformModel->getEndFrame(), 1073 .arg(RealTime::frame2RealTime(waveformModel->getEndFrame(),