Setlooping/islooping in AudioTransportSource/PositionableAudioSource Working?


#1

Hi,

I am trying to do a playback of the file in a loop. In the mean time, I found that there is a member function in PositionableAudioSource called setLooping(). So, using the AudioTransportSource instance, I called that function at the start of playback. But, my file playback was not looping. Its just played once. Also I tried to call IsLooping function. It also returned false. So Am I missing something?? I thought it is pretty straightforward. But not working. Can someone please help me??

 

Also I looked at the juce library files AudiotransportSource and positionableAudioSource. By seeing the below functions, it looks like the looping functionality is not implemented. Am I right or Am I missing something??

 


bool AudioTransportSource::isLooping() const
{
    const ScopedLock sl (callbackLock);
    return positionableSource != nullptr && positionableSource->isLooping();
}
 

PositionableAudioSource.h:


    /** Returns true if this source is actually playing in a loop. */
    virtual bool isLooping() const = 0;
    /** Tells the source whether you'd like it to play in a loop. */
    virtual void setLooping (bool shouldLoop)       { (void) shouldLoop; }
 


#2

It's implemented in AudioFormatReaderSource


#3

Thanks for the info. I will try that.