Viewport and AudioProcessorEditor - is there a way?

Hi !

I am working on a DAW which can load both VST and AU PlugIn’s.

As long as I am using DocumentWindows etc.. to host the AudioProcessorEditor component as a child component every this is fine.

HOWEVER - I am also trying to embed the Plug-ins in other areas on the DAW UI to improve user experience (compared to plugin’s in separate windows) - and want to be able to integrate it to a predefined area with scrollbars as possible for normal components using the Viewport class. But this does not seem to work at all. Regardless of the Viewport the Plugin continues to draw its full size - also outside the Viewport area.

This seems to be an issue that a lot of other developers have been struggling with previously - to mention just a few forum articles:

NOW since all the previous questions remain unanswered, I will try to re-open this discussion, to see if the are any way forward…

Do anyone know if there are a way to get around this problem ??

Maybe a way to capture graphics from the PlugIn and the by self handle the drawing .. BUT that might not work correct with the mouse…

@JUCE Development: Do you have any ideas ??

So please any suggestions on this topic is welcome :slight_smile: Thanks /Bo

I don’t think there is an easy way to solve this. On Windows for example, there is one HWND that all the juce Components draw into / get their mouse messages from. When you create a plugin editor, it creates another HWND and sticks it on top. There is no way for the JUCE components to clip / draw on top of this HWND.

I think you would need to create your own HWND, and stick it on the juce component. Use HWNDComponent for example.

Create create a Component, and attach it the HWND you just created. Then create the plugin editor inside that. Then the outer HWND can be used to scroll and clip the HWND of the plugin editor.

Then implement it again for macOS.

I have no idea how much of this is actually supported via juce, you might be doing a bunch of hacking to get this to work. But it should be possible.

2 Likes

Hi Roland,

Thanks for your reply - I think you are right … I have heard this before, so that’s probably not easy to get around with. However I will try to look at the HWNDcomponent… to see if there could be a chance that way - or similar on OS X… I’m primarily on Mac - but my app shall also be able to compile to windows, so I will need to look into both…