AudioFilePlayerPlugin icon indicating copy to clipboard operation
AudioFilePlayerPlugin copied to clipboard

Exception when opening plugin interface and update to JUCE 5.4.6

Open cornzz opened this issue 4 years ago • 1 comments

The exception is only thrown in debug mode since it is triggered by a valid coordinates assertion during currentPositionMarker.setRectangle() in AudioThumbnailComp.cpp, caused by timeToX() returning -nan(ind) and therefore the new Rectangle having an x value of -nan(ind).

timeToX() is returning that because for some reason visibleRange.getLength() is 0 at that point. A possible fix would be this:

float AudioThumbnailComp::timeToX(const double time) const
{
    if (visibleRange.getLength() == 0)
        return 0.0f;

    return getWidth() * (float)((time - visibleRange.getStart()) / (visibleRange.getLength()));
}


Furthermore a little change in PluginProcessor.cpp is needed, since getXmlFromBinary (now?) returns std::unique_ptr:

void AudioFilePlayerProcessor::setStateInformation(const void* data, int sizeInBytes)
{
    std::unique_ptr<XmlElement> xmlState(getXmlFromBinary(data, sizeInBytes));


Last, I was getting Cannot open include file: 'pluginterfaces/vst2.x/vstfxstore.h': No such file or directory, adding JUCE_VST3_CAN_REPLACE_VST2 = 0 to preprocessor definitions in the projucer fixed that.

cornzz avatar Jun 19 '20 13:06 cornzz

Aditionally to steps proposed by @cornzz, you will also need to download Steinberg VST SDK and modify your header search paths in Projucer to include VST2_SDK and VST3_SDK folder.

agartime avatar Jan 10 '21 13:01 agartime