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.

Show inner object property in Wwise plugin

0 votes

Hi,

I am wondering which is the procedure to display newly created inner objects in a Wwise Plug-in GUI.

Let's say for instance you have a EQ Plug-in and you want to add as many "Band" inner types as you want. 

How would you go about showing the newly created bands and their property controls in the GUI? Is it something to handle in the MFC resource by using some fancy control attributes such as "Prop" or "Class", or should it be done in code?

The documentation is clear about how to add inner objects and getting notification (end of Wwise Plug-in XML Description Files (audiokinetic.com) ), however I am not able to find any reference on how to actually show the objects and their properties.

Hope someone can help.

 


 

asked Mar 21, 2022 in Feature Requests by Cosimo R. (140 points)
recategorized Mar 21, 2022 by Samuel L. (Audiokinetic)

1 Answer

0 votes
At the moment, the provided controls that are hot-swapped on load using the static text "Prop=" and "Class=" do not support inner types.
These are currently only accessible with code: you will need to handle them using a custom UI. This also goes for the List View and Multi Editor, which cannot show inner objects and their properties.

As this is something we can work to implement in the Authoring's API, I will mark your question as a feature request.
answered Mar 21, 2022 by Samuel L. (Audiokinetic) (23,160 points)
Thanks for your reply!
Any suggestion on how to do it in code using MFC resources though?
Should they be added to a List Control or any other control type?
And more importantly how could you bind a property to a control in code without using the static text mechanism?

I have tried various implementation with no luck...
The only place I was able to do some binding (property-control) in code was via the AK::Wwise::PopulateTableItem[] in IAudioPlugin::GetDialog().
> how could you bind a property to a control in code without using the static text mechanism

There is no ready-made binding implemented for inner objects, and that's a product of inner objects being tools for custom objects that are better presented using a custom control, e.g.,  an EQ curve, a sequencer grid, etc.

The PopulateTableItem array returned as out-arg of GetDialog complements the static text placeholders control. However, you change the mapping on initialization, so it's more dynamic than the resources. Its use case is mostly for reusing the same UI implementation for slightly varying plug-in models, i.e., when the UI is the same, but properties differ.

With that in mind, it's worth mentioning that inner object are meant specifically for cases where there is a variable number of objects, and not merely an abstraction tool. If you have a fixed number of objects (e.g., max number of bands in an EQ), consider creating individual numbered properties and use the regular property binding system: it's going to be much simpler.

If you need the variable number of objects, to implement what we can consider a "binding" between the inner object data model to a control you need to do two things:

1) Initialize the control to the model's original value
Use AK::Wwise::Plugin::ObjectStore::GetPropertySet to query instances from 0 to GetListCount(). You can fill a Win32/MFC list control and assign columns to your inner object data model, but you still need to fill the cells yourself with controls you manage on dialog init.

2) React to changes
a) From the user
When the user accepts a value in one of your custom controls, you need to update your inner data model, which is done using the PropertySet pointer retrieved from AK::Wwise::Plugin::ObjectStore::GetPropertySet. These events are Win32 events and routed to your plug-in through the WindowProc method.

b) From the model
You can implement a generic system by also having Wwise notify your plug-in of changes to the inner object model by implementing:

* NotifyInnerObjectPropertyChanged
* NotifyInnerObjectAddedRemoved

These are part of the ObjectStore notification interface.

I hope this info is useful, and good luck!
Thank you again for your response. It is clear but I do have an issue in using custom MFC dialog classes.

I have created my custom CDialog class based on a template (ex. IDD_MYDIALOG). Ideally I have to define the logic for the binding etc... in the member classes such as OnDialogInit (as you mentioned in point 1.).

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 my custom dialog does not get created.

How can I create 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?
...