Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

Custom GUI for Wwise Plugin?

0 votes
How can I use a custom MFC CDialog class as my "SettingsDialog" or "ContentsDialog"?
I have created my custom CDialog class based on a template (ex. IDD_MYDIALOG). Here I have defined the logic for the binding properties to UI, etc...
However It feels like Wwise is in control of which dialogs get created in the function IAudioPlugin::GetDialog() and I am only able to return the ID of my dialog template such as IDD_MYDIALOG. It looks like a new dialog based on the template is created rather than based on my custom dialog class.

How can I use an instance of my custom CDialog class instead?
Is it something I have to do in the Plugin CWinApp?
What should I then return in IAudioPlugin::GetDialog?
asked Apr 7, 2022 in General Discussion by Cosimo R. (140 points)

1 Answer

0 votes
You are right that Wwise creates the dialog on its side. The HWND created that represents the dialog is provided through the WindowProc when it is called with the message ID WM_INITDIALOG.

To have an MFC instance constructed by the plug-in, you need to create the instance as a child window of the main dialog window, which you can do by passing the HWND mentioned above as a parent (you can acquire a CWnd* through the MFC function CWnd::FromHandle). The dialog template you provide will be used for the main dialog area: it could be devoid of controls if you intend to implement everything yourself: only the size (width x height) will be used as the size and your child dialog will be constrained to that size.
answered Apr 11, 2022 by Samuel L. (Audiokinetic) (23,300 points)
Thanks! I've managed to create a custom child dialog, however the style of the controls looks off. How could I make the control look like the various Wwise UI dialog class Spinner,  SuperRange, etc?
You can insert placeholder controls of type Static (aka. labels) that will be replaced by the appropriate control according based on a specially formatted window text: following this page to learn about the format to follow:

The sample plug-ins use this format as well so you can have a look at how their dialog is set up. Here's a link to the .rc of the Wwise Up On Air sample plug-in as reference:

Here is the Wwise Up On Air segment that goes through the steps:
Unfortunately the static placeholder controls are not replaced with the wwise ones when using a custom child dialog. Also the background is grey. Basically the appearance of my dialog is shown as the same as it is in the MFC editor...
Is there another way to style the controls manually?
After verification, placeholders are indeed not replaced recursively, I was misleading you, sorry about that!

If you go the fully custom dialog way, you need to implement your own UI system: Wwise does not know about your sub-dialog.

If you want to use the Wwise Authoring styled controls, the placeholders need to be directly created under the HWND passed by WM_INITDIALOG: either those are present already in the template identified by the ID returned in GetDialog, or you can add programmatically new controls in that initialization function, provided cannot are not MFC instances. You can also use the populate table to bind a model property to other types of Win32 controls such as text fields or checkboxes, and those will also be replaced at instantiation time to use the Wwise implementation.

The best compromise for you may be to only implement specific controls as custom UI elements, which can be MFC instances without any problem, and just use the placeholder controls in the resource template for everything else.