A Couple of Possible AudioThumbnail Bugs


#1
  1. Whenever I set the x argument to drawChannel to any value except zero, AudioThumbnail draws garbage both before real data. The garbage before the data extends from specified x to 0 (relative to the parent component). It consists of a line and then some random curves

  2. If the numSamplesPerThumbnailSample argument to AudioThumbnail’s constructor is large, say 16384, the program hangs. Setting the value to something smaller, say 4096, corrects the problem. The hang is only for that component – you can still do things elsewhere in the app. Also, breaking in the debugger and then continuing gets rid of the hang.


#2

This sounds like a bug I fixed last week… Have you tried the tip?


#3

Not yet, but I see the fix to the drawing problem so I’ll give it a try.

I did find another possible bug. The documentation for AudioThumbnail::setSource(InputSource *const newSource) says you can pass in 0 for newSource. But the source code from the tip code is

[code]void AudioThumbnail::setSource (InputSource* const newSource)
{
cache.removeThumbnail (this);
timerCallback(); // stops the timer and deletes the reader

delete source;
source = newSource;

clear();

if (! (cache.loadThumb (*this, newSource->hashCode())
       && isFullyLoaded()))
{
    ...[/code]

This code throws an exception in the “if” statement when newSource->hashCode() is executed if newSource is 0.


#4

Ah, yes, that does look like a bug. I’ll get it fixed. Thanks!