Nicer way to deal with the shared audiothumbnailcache

This commit is contained in:
xenakios
2017-11-23 19:36:46 +02:00
parent a109d71f09
commit e9e1c45550
4 changed files with 11 additions and 20 deletions

View File

@ -133,6 +133,13 @@ private:
bool m_dragging = false;
};
class MyThumbCache : public AudioThumbnailCache
{
public:
MyThumbCache() : AudioThumbnailCache(100) { Logger::writeToLog("Constructed AudioThumbNailCache"); }
~MyThumbCache() { Logger::writeToLog("Destructed AudioThumbNailCache"); }
};
class WaveformComponent : public Component, public ChangeListener, public Timer
{
public:
@ -175,7 +182,7 @@ public:
Value ShowFileCacheRange;
void setRecordingPosition(double pos) { m_rec_pos = pos; }
private:
std::shared_ptr<AudioThumbnailCache> m_thumbcache;
SharedResourcePointer<MyThumbCache> m_thumbcache;
std::unique_ptr<AudioThumbnail> m_thumb;
Range<double> m_view_range{ 0.0,1.0 };
@ -222,4 +229,3 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor)
};
void cleanUpGUI();