comparison view/Pane.cpp @ 301:5636eeacc467

* Merge from sv-match-alignment branch (excluding alignment-specific document). - add aggregate wave model (not yet complete enough to be added as a true model in a layer, but there's potential) - add play solo mode - add alignment model -- unused in plain SV - fix two plugin leaks - add m3u playlist support (opens all files at once, potentially hazardous) - fix retrieval of pre-encoded URLs - add ability to resample audio files on import, so as to match rates with other files previously loaded; add preference for same - add preliminary support in transform code for range and rate of transform input - reorganise preferences dialog, move dark-background option to preferences, add option for temporary directory location
author Chris Cannam
date Fri, 28 Sep 2007 13:56:38 +0000
parents 0824a754a8eb
children 6de6f78b13a1
comparison
equal deleted inserted replaced
300:0824a754a8eb 301:5636eeacc467
804 int fontAscent = paint.fontMetrics().ascent(); 804 int fontAscent = paint.fontMetrics().ascent();
805 805
806 if (r.y() + r.height() < height() - fontHeight - 6) return; 806 if (r.y() + r.height() < height() - fontHeight - 6) return;
807 807
808 size_t modelRate = waveformModel->getSampleRate(); 808 size_t modelRate = waveformModel->getSampleRate();
809 size_t nativeRate = waveformModel->getNativeRate();
809 size_t playbackRate = m_manager->getPlaybackSampleRate(); 810 size_t playbackRate = m_manager->getPlaybackSampleRate();
810 size_t outputRate = m_manager->getOutputSampleRate(); 811 size_t outputRate = m_manager->getOutputSampleRate();
811 812
812 QString srNote = ""; 813 QString srNote = "";
813 814
814 // Show (R) for waveform models that will be resampled on 815 // Show (R) for waveform models that have been resampled or will
815 // playback, and (X) for waveform models that will be played 816 // be resampled on playback, and (X) for waveform models that will
816 // at the wrong rate because their rate differs from the 817 // be played at the wrong rate because their rate differs from the
817 // current playback rate (which is not necessarily that of the 818 // current playback rate (which is not necessarily that of the
818 // main model). 819 // main model).
819 820
820 if (playbackRate != 0) { 821 if (playbackRate != 0) {
821 if (modelRate == playbackRate) { 822 if (modelRate == playbackRate) {
822 if (modelRate != outputRate) srNote = " " + tr("(R)"); 823 if (modelRate != outputRate || modelRate != nativeRate) {
824 srNote = " " + tr("(R)");
825 }
823 } else { 826 } else {
824 srNote = " " + tr("(X)"); 827 srNote = " " + tr("(X)");
825 } 828 }
826 } 829 }
827 830
828 QString desc = tr("%1 / %2Hz%3") 831 QString desc = tr("%1 / %2Hz%3")
829 .arg(RealTime::frame2RealTime(waveformModel->getEndFrame(), 832 .arg(RealTime::frame2RealTime(waveformModel->getEndFrame(),
830 sampleRate) 833 sampleRate)
831 .toText(false).c_str()) 834 .toText(false).c_str())
832 .arg(modelRate) 835 .arg(nativeRate)
833 .arg(srNote); 836 .arg(srNote);
834 837
835 if (r.x() < m_scaleWidth + 5 + paint.fontMetrics().width(desc)) { 838 if (r.x() < m_scaleWidth + 5 + paint.fontMetrics().width(desc)) {
836 drawVisibleText(paint, m_scaleWidth + 5, 839 drawVisibleText(paint, m_scaleWidth + 5,
837 height() - fontHeight + fontAscent - 6, 840 height() - fontHeight + fontAscent - 6,