1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added method AudioThumbnailCache::removeThumb().

This commit is contained in:
jules 2013-02-27 17:54:45 +00:00
parent 6c08b41a5a
commit 42ade06d78
2 changed files with 12 additions and 0 deletions

View file

@ -140,6 +140,15 @@ void AudioThumbnailCache::clear()
thumbs.clear();
}
void AudioThumbnailCache::removeThumb (const int64 hashCode)
{
const ScopedLock sl (lock);
for (int i = thumbs.size(); --i >= 0;)
if (thumbs.getUnchecked(i)->hash == hashCode)
thumbs.remove (i);
}
static inline int getThumbnailCacheFileMagicHeader() noexcept
{
return (int) ByteOrder::littleEndianInt ("ThmC");

View file

@ -72,6 +72,9 @@ public:
*/
void storeThumb (const AudioThumbnailBase& thumb, int64 hashCode);
/** Tells the cache to forget about the thumb with the given hashcode. */
void removeThumb (int64 hashCode);
//==============================================================================
/** Attempts to re-load a saved cache of thumbnails from a stream.
The cache data must have been written by the writeToStream() method.