| @@ -15,7 +15,7 @@ | |||||
| //============================================================================== | //============================================================================== | ||||
| PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor (PaulstretchpluginAudioProcessor& p) | PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor (PaulstretchpluginAudioProcessor& p) | ||||
| : AudioProcessorEditor (&p), | : AudioProcessorEditor (&p), | ||||
| m_wavecomponent(p.m_afm.get()), | |||||
| m_wavecomponent(p.m_afm), | |||||
| processor (p) | processor (p) | ||||
| { | { | ||||
| @@ -73,9 +73,9 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() | |||||
| g_activeprocessors.insert(this); | g_activeprocessors.insert(this); | ||||
| m_recbuffer.setSize(2, 44100); | m_recbuffer.setSize(2, 44100); | ||||
| m_recbuffer.clear(); | m_recbuffer.clear(); | ||||
| m_afm = std::make_unique<AudioFormatManager>(); | |||||
| m_afm->registerBasicFormats(); | |||||
| m_stretch_source = std::make_unique<StretchAudioSource>(2, m_afm.get()); | |||||
| if (m_afm->getNumKnownFormats()==0) | |||||
| m_afm->registerBasicFormats(); | |||||
| m_stretch_source = std::make_unique<StretchAudioSource>(2, m_afm); | |||||
| setPreBufferAmount(2); | setPreBufferAmount(2); | ||||
| m_ppar.pitch_shift.enabled = true; | m_ppar.pitch_shift.enabled = true; | ||||
| @@ -15,6 +15,7 @@ | |||||
| class MyThumbCache; | class MyThumbCache; | ||||
| class PaulstretchpluginAudioProcessor : public AudioProcessor | class PaulstretchpluginAudioProcessor : public AudioProcessor | ||||
| { | { | ||||
| public: | public: | ||||
| @@ -64,7 +65,7 @@ public: | |||||
| String setAudioFile(File f); | String setAudioFile(File f); | ||||
| File getAudioFile() { return m_current_file; } | File getAudioFile() { return m_current_file; } | ||||
| Range<double> getTimeSelection(); | Range<double> getTimeSelection(); | ||||
| std::unique_ptr<AudioFormatManager> m_afm; | |||||
| SharedResourcePointer<AudioFormatManager> m_afm; | |||||
| StretchAudioSource* getStretchSource() { return m_stretch_source.get(); } | StretchAudioSource* getStretchSource() { return m_stretch_source.get(); } | ||||
| double getPreBufferingPercent(); | double getPreBufferingPercent(); | ||||
| private: | private: | ||||