olilarkin / wdl-ol

Enhanced version of Cockos' iPlug - A simple-to-use C++ framework for developing cross platform audio plugins and targeting multiple plugin APIs with the same code. VST / VST3 / Audiounit / RTAS / AAX (Native) formats supported. NOTE: THIS IS OBSOLETE, PLEASE SEE IPLUG2:
https://github.com/iplug2
935 stars 187 forks source link

Resize GUI on AAX & VST3 crash + FIX #46

Open pylorca opened 9 years ago

pylorca commented 9 years ago

If the gui wasn't created, GetGUI()->reisize() crash protools

To fix: IGraphics.cpp::IGraphics::IGraphics(IPlugBase* pPlug, int w, int h, int refreshFPS) add

#ifdef AAX_API
    mAAXViewContainer = 0;
#endif

on IPlugAAX.cpp

void IPlugAAX::ResizeGraphics(int w, int h)
{
    IGraphics* pGraphics = GetGUI();

    if (pGraphics)
    {
        AAX_Point oEffectViewSize;
        oEffectViewSize.horz = (float) w;
        oEffectViewSize.vert = (float) h;

        AAX_IViewContainer* viewContainer = pGraphics->GetViewContainer();

        if (viewContainer)
        {
            viewContainer->SetViewSize(oEffectViewSize);
        }
        OnWindowResize();
    }
}
pylorca commented 9 years ago

Same on VST3

to Fix it: IplugVST3.cpp

void IPlugVST3::ResizeGraphics(int w, int h)
{    
    iif (GetGUI() && viewsArray.total() > 0)
    {
        viewsArray.at(0)->resize(w, h);
    }
    OnWindowResize();
}