Calculate disk sample read count. Increase disk read cache 4x.
This commit is contained in:
		@@ -41,7 +41,7 @@ class AInputS final : public InputS
 | 
			
		||||
public:
 | 
			
		||||
    AInputS(AudioFormatManager* mana) : m_manager(mana)
 | 
			
		||||
	{
 | 
			
		||||
		m_readbuf.setSize(2, 65536*2);
 | 
			
		||||
		m_readbuf.setSize(2, 65536*8);
 | 
			
		||||
		m_readbuf.clear();
 | 
			
		||||
		m_crossfadebuf.setSize(2, 44100);
 | 
			
		||||
		m_crossfadebuf.clear();
 | 
			
		||||
@@ -142,6 +142,7 @@ public:
 | 
			
		||||
                Range<int64_t> possiblerange(pos, pos + m_readbuf.getNumSamples() + 0);
 | 
			
		||||
                m_cached_file_range = activerange.getIntersectionWith(possiblerange);
 | 
			
		||||
                m_afreader->read(&m_readbuf, 0, (int)m_cached_file_range.getLength(), pos, true, true);
 | 
			
		||||
				m_disk_read_count += m_cached_file_range.getLength()*m_afreader->numChannels;
 | 
			
		||||
				return m_readbuf.getSample(ch, int(pos - m_cached_file_range.getStart()));
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
@@ -81,12 +81,13 @@ public:
 | 
			
		||||
		return m_currentsample >= info.nsamples*m_activerange.getEnd();
 | 
			
		||||
	}
 | 
			
		||||
    virtual AudioBuffer<float>* getAudioBuffer()=0;
 | 
			
		||||
	int64_t getDiskReadSampleCount() { return m_disk_read_count; }
 | 
			
		||||
protected:
 | 
			
		||||
	volatile int64_t m_currentsample = 0;
 | 
			
		||||
	int m_silenceoutputted = 0;
 | 
			
		||||
	bool m_loop_enabled = false;
 | 
			
		||||
	Range<double> m_activerange{ 0.0,1.0 };
 | 
			
		||||
	
 | 
			
		||||
	int64_t m_disk_read_count = 0;
 | 
			
		||||
private:
 | 
			
		||||
	int skipbufsize;
 | 
			
		||||
	AudioBuffer<float> skipbuf;
 | 
			
		||||
 
 | 
			
		||||
@@ -65,6 +65,13 @@ bool StretchAudioSource::isResampling()
 | 
			
		||||
    return (int)m_outsr!=m_inputfile->info.samplerate;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int64_t StretchAudioSource::getDiskReadSampleCount() const
 | 
			
		||||
{
 | 
			
		||||
	if (m_inputfile == nullptr)
 | 
			
		||||
		return 0;
 | 
			
		||||
	return m_inputfile->getDiskReadSampleCount();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
std::vector<SpectrumProcess> StretchAudioSource::getSpectrumProcessOrder()
 | 
			
		||||
{
 | 
			
		||||
	return m_specproc_order;
 | 
			
		||||
 
 | 
			
		||||
@@ -82,6 +82,7 @@ public:
 | 
			
		||||
	bool isLoopEnabled();
 | 
			
		||||
	bool hasReachedEnd();
 | 
			
		||||
    bool isResampling();
 | 
			
		||||
	int64_t getDiskReadSampleCount() const;
 | 
			
		||||
	std::vector<SpectrumProcess> getSpectrumProcessOrder();
 | 
			
		||||
	void setSpectrumProcessOrder(std::vector<SpectrumProcess> order);
 | 
			
		||||
	void setFFTWindowingType(int windowtype);
 | 
			
		||||
 
 | 
			
		||||
@@ -427,6 +427,7 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)
 | 
			
		||||
		String infotext; 
 | 
			
		||||
		if (processor.m_show_technical_info)
 | 
			
		||||
		{
 | 
			
		||||
			infotext += String(processor.getStretchSource()->getDiskReadSampleCount()) + " ";
 | 
			
		||||
			infotext += String(processor.m_prepare_count)+" ";
 | 
			
		||||
            infotext += String(processor.getStretchSource()->m_param_change_count);
 | 
			
		||||
			infotext += " param changes ";
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user