AAX resizing Bug and fix

in the AAX wrapper GetViewContainer()->SetViewSize(newSize) can FAIL

this can happen when the plugin is too big (like described in the comments) but also if the offscreen bounds of the plugin are too big.

The result is that the internal size, and the window size are different, which may hide important controls in the plugin (including resize-symbol)

This is a fix for the AAX Wrapper
It remembers the last successful resizing of the plugin, and if it wasn’t successful, it just applies the old size to the internal plugin again.
A listener-loop (because of the component lister) should not happen, because it checks if the current size is equal to the new size)

			Point<int> lastCorrectSize;
			void childBoundsChanged(Component*) override
			{
				if (pluginEditor != nullptr)
				{
					auto w = pluginEditor->getWidth();
					auto h = pluginEditor->getHeight();

					if (lastCorrectSize.isOrigin() || lastCorrectSize.getX() != w || lastCorrectSize.getY() != h)
					{

						AAX_Point newSize((float)h, (float)w);
						if (owner.GetViewContainer()->SetViewSize(newSize) != AAX_SUCCESS)
						{
							// Because setViewSize has failed, we have set the internal plugin-size to the same size
							// this is tricky because the constrainer may not allow smaller bounds, but if we don't do it the internal size 
							// is bigger than UI element, and may hide important controls;
							
							auto bounds=pluginEditor->getBounds();
							bounds.setWidth(lastCorrectSize.getX());
							bounds.setHeight(lastCorrectSize.getY());
							pluginEditor->setBoundsConstrained(bounds);
							
						}
						else
						{
							lastCorrectSize.setXY(w, h);
							setSize(w, h);
						};
					};

				}
			}
1 Like

bump

This is now fixed on develop with commit b4da453.

thanks, i cannot compile because

jucedev\modules\juce_audio_plugin_client\aax\juce_aax_wrapper.cpp(606): error C2872: 'Rectangle': ambiguous symbol

– > have to use juce::Rectangle

Thanks I’ve pushed a fix for this to develop (it will appear shortly). Just to avoid this in the future - with which compiler are you seeing this. Our CI system did not flag this and we build with VS2015 and VS2017, Xcode.

VS2017

Hmmm that’s odd. We build with VS2017 as well. Do you include any extra headers? Which AAX SDK version are you using?

#define AAX_SDK_VERSION ( 0x0203 )

No extra headers

In projucer windows target platform is 8.1 (??? i never had set this, i will try remove it, to use the default value)

with default sdk same problem

rectangle from wingdi.h

include hierarchy

Note: including file:   jucedev\modules\juce_audio_plugin_client\aax\../utility/juce_IncludeSystemHeaders.h
Note: including file:    C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\windows.h
Note: including file:     C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\wingdi.h

See if this helps:

Rail

Thank you. I’ve already just put juce:: namespace in front of the single use of Rectangle. But good to know.