diff --git a/Source/PS_Source/Input/AInputS.h b/Source/PS_Source/Input/AInputS.h index 56ee93c..dcfa96a 100644 --- a/Source/PS_Source/Input/AInputS.h +++ b/Source/PS_Source/Input/AInputS.h @@ -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,7 +142,8 @@ public: Range 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); - return m_readbuf.getSample(ch, int(pos - m_cached_file_range.getStart())); + m_disk_read_count += m_cached_file_range.getLength()*m_afreader->numChannels; + return m_readbuf.getSample(ch, int(pos - m_cached_file_range.getStart())); } }; auto getCrossFadedSampleLambda=[this,&getSampleLambda](int64_t playpos, int chan, int64_t subt0, int64_t subt1, int xfadelen) diff --git a/Source/PS_Source/Input/InputS.h b/Source/PS_Source/Input/InputS.h index c729ce7..031a9ab 100644 --- a/Source/PS_Source/Input/InputS.h +++ b/Source/PS_Source/Input/InputS.h @@ -81,12 +81,13 @@ public: return m_currentsample >= info.nsamples*m_activerange.getEnd(); } virtual AudioBuffer* 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 m_activerange{ 0.0,1.0 }; - + int64_t m_disk_read_count = 0; private: int skipbufsize; AudioBuffer skipbuf; diff --git a/Source/PS_Source/StretchSource.cpp b/Source/PS_Source/StretchSource.cpp index 2df7743..74bc579 100644 --- a/Source/PS_Source/StretchSource.cpp +++ b/Source/PS_Source/StretchSource.cpp @@ -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 StretchAudioSource::getSpectrumProcessOrder() { return m_specproc_order; diff --git a/Source/PS_Source/StretchSource.h b/Source/PS_Source/StretchSource.h index 9c90af9..8a651f7 100644 --- a/Source/PS_Source/StretchSource.h +++ b/Source/PS_Source/StretchSource.h @@ -82,6 +82,7 @@ public: bool isLoopEnabled(); bool hasReachedEnd(); bool isResampling(); + int64_t getDiskReadSampleCount() const; std::vector getSpectrumProcessOrder(); void setSpectrumProcessOrder(std::vector order); void setFFTWindowingType(int windowtype); diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 0275f6f..0ccc39e 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -427,7 +427,8 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) String infotext; if (processor.m_show_technical_info) { - infotext += String(processor.m_prepare_count)+" "; + infotext += String(processor.getStretchSource()->getDiskReadSampleCount()) + " "; + infotext += String(processor.m_prepare_count)+" "; infotext += String(processor.getStretchSource()->m_param_change_count); infotext += " param changes "; }