社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

0 投票
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?
分类:General Discussion | 用户: Cosimo R. (140 分)

1个回答

0 投票
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.
用户: Samuel L. (Audiokinetic) (23.6k 分)
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: https://www.audiokinetic.com/library/edge/?source=SDK&id=wwiseplugin_dialog_guide.html#wwiseplugin_dialog_guide_controls_wwise.

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: https://github.com/audiokinetic/wuoa-plugin/blob/master/WwisePlugin/WoaGain.rc#L57

Here is the Wwise Up On Air segment that goes through the steps: https://youtu.be/dYy7r8vljz0?t=6233
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.
...