Browse Source

Added method AudioThumbnailCache::removeThumb().

tags/2021-05-28
jules 13 years ago
parent
commit
42ade06d78
2 changed files with 12 additions and 0 deletions
  1. +9
    -0
      modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp
  2. +3
    -0
      modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h

+ 9
- 0
modules/juce_audio_utils/gui/juce_AudioThumbnailCache.cpp 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");


+ 3
- 0
modules/juce_audio_utils/gui/juce_AudioThumbnailCache.h 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.


Loading…
Cancel
Save