Mercurial > hg > svgui
changeset 1181:e0ac21f07ab0 bqresample
Fixes to sample rate and latency handling
author | Chris Cannam |
---|---|
date | Fri, 09 Dec 2016 14:40:49 +0000 |
parents | db90fee630bc |
children | 6605984fa98f |
files | view/Pane.cpp view/ViewManager.cpp view/ViewManager.h |
diffstat | 3 files changed, 13 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/view/Pane.cpp Wed Nov 30 11:01:39 2016 +0000 +++ b/view/Pane.cpp Fri Dec 09 14:40:49 2016 +0000 @@ -1053,23 +1053,19 @@ sv_samplerate_t modelRate = waveformModel->getSampleRate(); sv_samplerate_t nativeRate = waveformModel->getNativeRate(); sv_samplerate_t playbackRate = m_manager->getPlaybackSampleRate(); - sv_samplerate_t outputRate = m_manager->getOutputSampleRate(); QString srNote = ""; - // Show (R) for waveform models that have been resampled or will - // be resampled on playback, and (X) for waveform models that will - // be played at the wrong rate because their rate differs from the - // current playback rate (which is not necessarily that of the - // main model). - - if (playbackRate != 0) { - if (modelRate == playbackRate) { - if (modelRate != outputRate || modelRate != nativeRate) { - srNote = " " + tr("(R)"); - } - } else { + // Show (R) for waveform models that have been resampled during + // load, and (X) for waveform models that will be played at the + // wrong rate because their rate differs from the current playback + // rate (which is not necessarily that of the main model). + + if (modelRate != nativeRate) { + if (playbackRate != 0 && modelRate != playbackRate) { srNote = " " + tr("(X)"); + } else { + srNote = " " + tr("(R)"); } }
--- a/view/ViewManager.cpp Wed Nov 30 11:01:39 2016 +0000 +++ b/view/ViewManager.cpp Fri Dec 09 14:40:49 2016 +0000 @@ -489,10 +489,10 @@ } sv_samplerate_t -ViewManager::getOutputSampleRate() const +ViewManager::getDeviceSampleRate() const { if (m_playSource) { - return m_playSource->getTargetSampleRate(); + return m_playSource->getDeviceSampleRate(); } return 0; }
--- a/view/ViewManager.h Wed Nov 30 11:01:39 2016 +0000 +++ b/view/ViewManager.h Fri Dec 09 14:40:49 2016 +0000 @@ -172,9 +172,9 @@ /** * The sample rate of the audio output device. If the playback * sample rate differs from this, everything will be resampled at - * the output stage. + * the output stage (but not before). */ - sv_samplerate_t getOutputSampleRate() const; + sv_samplerate_t getDeviceSampleRate() const; /** * The sample rate of the current main model. This may in theory