Version

menu_open
Wwise SDK 2023.1.9
AudioPlugin.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2024 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 /// \file
28 /// Wwise audio plug-in interface, used to implement the Wwise side of a source or effect plug-in.
29 
30 #ifndef _AK_WWISE_AUDIOPLUGIN_H
31 #define _AK_WWISE_AUDIOPLUGIN_H
32 
33 #include "Undo.h"
34 
35 #include <AK/Wwise/Utilities.h>
36 #include <AK/SoundEngine/Common/AkSoundEngine.h> /// Dummy assert hook definition.
38 #include <AK/Wwise/PlatformID.h>
39 
40 #include <float.h>
41 
42 // Audiokinetic namespace
43 namespace AK
44 {
45  class IXmlTextReader;
46  class IXmlTextWriter;
47 
48  // Audiokinetic Wwise namespace
49  namespace Wwise
50  {
52  {
53  public:
54  /// If the conversion failed the function is responsible of deleting
55  /// any files that may have been created, even the destination file
56  /// in case of error. If the function return false we will use the
57  /// string put in io_pError to display an error message.
59  const GUID & in_guidPlatform, ///< The unique ID of the custom platform being converted for.
60  const BasePlatformID & in_basePlatform, ///< The unique ID of the base platform being converted for.
61  LPCWSTR in_szSourceFile, ///< Source File to convert data from.
62  LPCWSTR in_szDestFile, ///< DestinationFile, must be created by the plug-in.
63  AkUInt32 in_uSampleRate, ///< The target sample rate for the converted file, passing 0 will default to the platform default
64  AkUInt32 in_uBlockLength, ///< The block length, passing 0 will default to the platform default
65  AK::Wwise::IProgress* in_pProgress, ///< Optional Progress Bar controller.
66  IWriteString* io_pError ///< Optional error string that can be displayed if ConversionResult is not successful
67  ) = 0;
68 
70  const GUID & in_guidPlatform, ///< The unique ID of the platform being converted for.
71  AkUInt32 in_uSampleRate = 0, ///< The target sample rate for the converted file, passing 0 will default to the platform default.
72  AkUInt32 in_uBlockLength = 0 ///< The block length, passing 0 will default to the platform default.
73  ) = 0;
74  };
75 
76  /// Plug-in property set interface. An instance of this class is created and
77  /// assigned to each plug-in, which in turn can use it to manage its properties.
78  /// Whenever a property name is specified, it corresponds to the property
79  /// name set in the plug-in's XML definition file.
80  /// \akwarning
81  /// The functions in this interface are not thread-safe, unless stated otherwise.
82  /// \endakwarning
83  /// \sa
84  /// - \ref wwiseplugin_xml_properties_tag
85  /// - AK::Wwise::IAudioPlugin::SetPluginPropertySet()
86  /// - \ref wwiseplugin_propertyset
88  {
89  public:
90  /// Get the value of a property for a specified platform.
91  /// \return True if successful, False otherwise
92  /// \sa
93  /// - \ref wwiseplugin_bank
94  virtual bool GetValue(
95  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
96  LPCWSTR in_pszPropertyName, ///< The name of the property
97  VARIANT & out_varProperty ///< The returned value of the property
98  ) = 0;
99 
100  /// Set the value of a property for a specified platform.
101  /// \return True if successful, False otherwise.
102  virtual bool SetValue(
103  const GUID & in_guidPlatform, ///< The unique ID of the platform to modify
104  LPCWSTR in_pszPropertyName, ///< The name of the property
105  const VARIANT & in_varProperty ///< The value to set
106  ) = 0;
107 
108  /// Get the RTPC binding status for a specified property.
109  /// \return True if property is bound to a RTPC, False otherwise.
110  virtual bool PropertyHasRTPC(
111  LPCWSTR in_pszPropertyName ///< The name of the property
112  ) = 0;
113 
114  /// This function is called by Wwise to get the current platform's identifier.
115  /// This can be passed to any function that has a parameter
116  /// for a platform ID, such as GetValue() or SetValue(), when you want to make
117  /// the call for the currently active platform.
118  /// \return The unique ID of the current platform
119  virtual GUID GetCurrentPlatform() = 0;
120 
121  /// This function is called by Wwise to get the current base platform
122  /// \return The unique ID of the current base platform
124 
125  /// This function is called To retrieve the base platforms of the authoring tool.
127 
128  /// This function is called To retrieve the custom platform being used to run while in authoring
130 
131  /// Use this function to tell Wwise that something other than properties
132  /// has changed within the plugin. This will set the plugin dirty (for save)
133  /// and GetPluginData will be called when the plugin is about to play in Wwise, to
134  /// transfer the internal data to the Sound Engine part of the plugin.
135  /// Use ALL_PLUGIN_DATA_ID to tell that all the data has to be refreshed.
136  virtual void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty = true) = 0;
137 
138  /// Call this function when you are about to log an undo event to know if Wwise is
139  /// in a state where undos are enabled. Undo logging can be disabled for a particular
140  /// plugin object if it already lives in the undo stack or in the clipboard.
141  virtual bool CanLogUndos() = 0;
142 
143  /// Obtain the Undo Manager. The Undo Manager can be used to group undo together or
144  /// to check the status of the undo system.
145  virtual AK::Wwise::IUndoManager * GetUndoManager() = 0;
146 
147  /// Obtain licensing status for the plug-in. Refer to \ref wwiseplugin_dll_license for more information.
148  virtual void GetLicenseStatus(
149  const GUID & in_guidPlatform, ///< GUID of the platform
150  AK::Wwise::LicenseType & out_eType, ///< License Type
151  AK::Wwise::LicenseStatus & out_eStatus, ///< License Status
152  UINT32 & out_uDaysToExpiry ///< Days until license expiry
153  ) = 0;
154 
155  /// Obtain licensing status for a plug-in-specific asset ID. Refer to \ref wwiseplugin_dll_license for more information.
156  virtual void GetAssetLicenseStatus(
157  const GUID & in_guidPlatform, ///< GUID of the platform
158  AkUInt32 in_uAssetID, ///< ID of the asset
159  AK::Wwise::LicenseType & out_eType, ///< License Type
160  AK::Wwise::LicenseStatus & out_eStatus, ///< License Status
161  UINT32 & out_uDaysToExpiry ///< Days until license expiry
162  ) = 0;
163 
164  /// Obtain the unique identifier of the corresponding IWObject.
165  virtual const GUID& GetID() const = 0;
166 
167  /// Find and call the specified procedure. Calls made using this function are always blocking.
168  virtual void WaapiCall(
169  const char* in_szUri, ///< URI of the procedure to call
170  const char* in_szArgs, ///< JSON string (utf-8) of arguments to pass to the procedure or NULL for no arguments
171  const char* in_szOptions, ///< JSON string (utf-8) of options to pass to the procedure or NULL for no options
172  AK::IAkPluginMemAlloc* in_pAlloc, ///< Allocator used to allocate memory for the results or the error
173  char*& out_szResults, ///< JSON string (utf-8) containing the results (if any)
174  char*& out_szError ///< JSON string (utf-8) containing the error (if any)
175  ) const = 0;
176  };
177 
178  /// Plug-in object store interface. An instance of this class is created and
179  /// assigned to each plug-in, which in turn can use it to manage its inner objects.
180  /// Inner objects can be created from the inner types defined in the plug-in's XML
181  /// definition file.
182  /// \akwarning
183  /// The functions in this interface are not thread-safe, unless stated otherwise.
184  /// \endakwarning
185  /// \sa
186  /// - AK::Wwise::IAudioPlugin::SetPluginObjectStore()
187  /// - \ref wwiseplugin_objectstore
188  /// - \ref wwiseplugin_xml_properties_tag
190  {
191  public:
192  /// Inserts an object into the specified list at the specified position. To create objects,
193  /// use CreateObject. Note that an object can only be inside one list.
194  /// Pass (unsigned int)-1 as the index to insert at the end of the list
195  virtual void InsertObject(
196  LPCWSTR in_pszListName,
197  unsigned int in_uiIndex,
198  IPluginPropertySet* in_pPropertySet
199  ) = 0;
200 
201  /// Removes an object from its list. The list is not specified and is automatically found.
202  /// The function \c DeleteObject must be called if the object is no longer necessary.
203  /// \return True if successful, False otherwise
204  virtual bool RemoveObject(
205  IPluginPropertySet* in_pPropertySet
206  ) = 0;
207 
208  /// Gets an object inside the specified list at the specified position.
209  /// \return The object in the specified list at the specified position, NULL if list or index are invalid
211  LPCWSTR in_pszListName,
212  unsigned int in_uiIndex
213  ) const = 0;
214 
215  /// Get the number of object inside the specified list.
216  /// \return Number of object inside the specified list.
217  virtual unsigned int GetObjectCount(
218  LPCWSTR in_pszListName
219  ) const = 0;
220 
221  /// Create a new object instance of the specified type. The type must be defined in the Plugin XML definition.
222  /// See the \c InnerTypes section in the plug-in definition.
223  /// \return The instance of the newly created object, NULL if not successful
225  LPCWSTR in_pszType
226  ) = 0;
227 
228  /// Frees the object. It will also remove the object from its list if the object is still in a list.
229  /// Do not use the object after calling this function.
230  virtual void DeleteObject(
231  IPluginPropertySet* in_pPropertySet
232  ) = 0;
233 
234  /// Gets the number of lists.
235  /// \return The number of lists.
236  virtual unsigned int GetListCount() const = 0;
237 
238  /// Get the name of the list at the specified position. The buffer must be large enough to copy the list name.
239  /// When the buffer is too small, the function do not write to the buffer and return zero.
240  /// \return Number of characters written to the buffer, zero if failed.
241  virtual unsigned int GetListName(
242  unsigned int in_uiListIndex,
243  LPWSTR out_pszListName,
244  unsigned int in_uiBufferSize
245  ) const = 0;
246  };
247 
248  /// Plug-in object media interface. An instance of this class is created and
249  /// assigned to each plug-in that supports media file handling.
250  /// \akwarning
251  /// The functions in this interface are not thread-safe, unless stated otherwise.
252  /// \endakwarning
253  /// \sa
254  /// - AK::Wwise::IAudioPlugin::SetPluginObjectMedia()
256  {
257  public:
258 
259  /// Requests to set the specified file as a data input file.
260  virtual bool SetMediaSource(
261  LPCWSTR in_pszFilePathToImport, ///< File path: can be null in the case of plugin-generated data not requiring an original file
262  unsigned int in_Index = 0, ///< Optional index
263  bool in_bReplace = false ///< Optional: set to true to replace existing file if the name is already in used
264  ) = 0;
265 
266  /// Requests to remove the specified index file s a data input file.
267  virtual void RemoveMediaSource(
268  unsigned int in_Index = 0 ///< Optional index
269  ) = 0;
270 
271  /// Retrieve the number of dataSource, it will be then possible to
272  /// call GetMediaFileName or RemoveMediaSource using the provided index
273  virtual unsigned int GetMediaSourceCount() const = 0;
274 
275  /// Retrieve the file name of the source plug-in data relative to the
276  /// original directory at the specified index.
277  /// Mostly used to allow the Plug-in to display this information.
278  /// \return Number of characters written to the buffer, zero if failed.
279  virtual unsigned int GetMediaSourceFileName(
280  LPWSTR out_pszFileName, ///< Relative path of the associated file
281  unsigned int in_uiBufferSize, ///< Size of the provided string buffer
282  unsigned int in_Index = 0 ///< Optional index
283  ) const = 0;
284 
285  /// Retrieve the file path of the source plug-in data at the specified index.
286  /// \return Number of characters written to the buffer, zero if failed.
287  virtual unsigned int GetMediaSourceOriginalFilePath(
288  LPWSTR out_pszFileName, ///< Relative path of the associated file
289  unsigned int in_uiBufferSize, ///< Size of the provided string buffer
290  unsigned int in_Index = 0 ///< Optional index
291  ) const = 0;
292 
293  /// Retrieve the file path of the converted plug-in data at the specified index.
294  /// \return Number of characters written to the buffer, zero if failed.
295  virtual unsigned int GetMediaSourceConvertedFilePath(
296  LPWSTR out_pszFileName, ///< Relative path of the associated file
297  unsigned int in_uiBufferSize, ///< Size of the provided string buffer
298  const GUID & in_guidPlatform, ///< The GUID of the platform
299  unsigned int in_Index = 0 ///< Optional index
300  ) const = 0;
301 
302  /// Request Wwise to perform any required conversion on the data
303  virtual void InvalidateMediaSource( unsigned int in_Index = 0 ) = 0;
304 
305  /// Obtain the Original directory for the plugin
306  /// \return Number of characters written to the buffer, zero if failed.
307  virtual unsigned int GetOriginalDirectory(
308  LPWSTR out_pszDirectory, ///< Pointer to the buffer that will hold the directory string
309  unsigned int in_uiBufferSize ///< Size of the buffer pointed by out_pszDirectory
310  ) const = 0;
311 
312  /// Obtain the Converted directory for the plugin and platform
313  /// \return Number of characters written to the buffer, zero if failed.
314  virtual unsigned int GetConvertedDirectory(
315  LPWSTR out_pszDirectory, ///< Pointer to the buffer that will hold the directory string
316  unsigned int in_uiBufferSize, ///< Size of the buffer pointed by out_pszDirectory
317  const GUID & in_guidPlatform ///< The GUID of the platform
318  ) const = 0;
319  };
320 
321  /// Wwise plug-in interface. This must be implemented for each source or
322  /// effect plug-in that is exposed in Wwise.
323  /// \akwarning
324  /// The functions in this interface are not thread-safe, unless stated otherwise.
325  /// \endakwarning
326  /// \deprecated This class is deprecated. Use AK::Wwise::Plugin::AudioPlugin instead.
327  /// \sa
328  /// - \ref effectpluginwwise
329  class IAudioPlugin
330  : public IPluginBase
331  {
332  public:
333  /// Dialog type. Source plug-ins can be edited in the Property Editor or
334  /// the Contents Editor, while effect plug-ins can only be edited in the
335  /// Effect Editor.
336  /// \sa
337  /// - \ref wwiseplugin_dialogcode
338  enum eDialog
339  {
340  SettingsDialog, ///< Main plug-in dialog. This is the dialog used in the Property
341  ///< Editor for source plug-ins, and in the Effect Editor for
342  ///< effect plug-ins.
343  ContentsEditorDialog ///< Contents Editor dialog. This is the small dialog used in the
344  ///< Contents Editor for source plug-ins.
345  };
346 
347  /// Type of operation for the NotifyInnerObjectAddedRemoved function.
349  {
352  };
353 
354  struct MonitorData
355  {
357  void* pData;
358  unsigned int uDataSize;
359  };
360 
361  /// The property set interface is given to the plug-in through this method. It is called by Wwise during
362  /// initialization of the plug-in, before most other calls.
363  /// \warning This function is guaranteed to be called by a single thread at a time.
364  /// \sa
365  /// - \ref wwiseplugin_propertyset
366  virtual void SetPluginPropertySet(
367  IPluginPropertySet * in_pPSet ///< A pointer to the property set interface
368  ) = 0;
369 
370  /// The plugin object store interface is given to the plug-in through this method.
371  /// It is called by Wwise during initialization of the plug-in, before most other calls.
372  /// Use this interface to manage plugin inner objects.
373  /// \warning This function is guaranteed to be called by a single thread at a time.
374  /// \sa
375  /// - \ref wwiseplugin_objectstore
376  virtual void SetPluginObjectStore(
377  IPluginObjectStore * in_pObjectStore ///< A pointer to the plugin object store
378  ) = 0;
379 
380  /// The plugin object data file interface is given to the plug-in through this method.
381  /// Set plugin object media, that allows to create and manage media files
382  /// Use this interface to manage plugin media objects.
383  ///
384  /// NOTE: If the plug-in does not handle plugin media, this function should be
385  /// implemented as a void function by the plug-in.
386  ///
387  /// \warning This function is guaranteed to be called by a single thread at a time.
388  /// \sa
389  /// - \ref effectplugin_media
390  virtual void SetPluginObjectMedia(
391  IPluginObjectMedia * in_pObjectMedia
392  ) = 0;
393 
394  /// This function is called by Wwise to determine if the plug-in is in a playable state.
395  /// \warning This function is guaranteed to be called by a single thread at a time.
396  /// \return True if the plug-in is in a playable state, False otherwise
397  virtual bool IsPlayable() const = 0;
398 
399  /// Initialize custom data to default values. This is called by Wwise after SetPluginPropertySet()
400  /// when creating a new instance of the plug-in (i.e. not during a load). The properties on the
401  /// PropertySet do not need to be initialized in this method.
402  /// \warning This function is guaranteed to be called by a single thread at a time.
403  virtual void InitToDefault() = 0;
404 
405  /// Delete function called when the user press "delete" button on a plugin. This entry point must
406  /// set the undo/redo action properly.
407  /// \warning This function is guaranteed to be called by a single thread at a time.
408  virtual void Delete() = 0;
409 
410  /// Load file
411  /// \return \b true if load succeeded.
412  virtual bool Load( AK::IXmlTextReader* in_pReader ) = 0;
413 
414  /// Save file
415  /// \return \b true if save succeeded.
416  virtual bool Save( AK::IXmlTextWriter* in_pWriter ) = 0;
417 
418  /// Copy the plugin's custom data into another instance of the same plugin. This is used
419  /// during copy/paste and delete. The properties on the PropertySet do not need to
420  /// be copied in this method.
421  /// \warning This function is guaranteed to be called by a single thread at a time.
422  virtual bool CopyInto(
423  IAudioPlugin* io_pWObject // The object that will receive the custom data of this object.
424  ) const = 0;
425 
426  /// This function is called by Wwise when the current platform changes.
427  /// \warning This function is guaranteed to be called by a single thread at a time.
428  /// \sa
429  /// - \ref wwiseplugin_platformchange
431  const GUID & in_guidCurrentPlatform ///< The unique ID of the new platform
432  ) = 0;
433 
434  /// This function is called by Wwise when a plug-in property changes (for example,
435  /// through interaction with a UI control bound to a property, or through undo/redo operations).
436  /// This function is also called during undo or redo operations
437  /// \warning This function is guaranteed to be called by a single thread at a time.
438  virtual void NotifyPropertyChanged(
439  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
440  LPCWSTR in_pszPropertyName ///< The name of the property
441  ) = 0;
442 
443  /// This function is called by Wwise when a inner object property changes (for example,
444  /// through interaction with a UI control bound to a property, or through undo/redo operations).
445  /// See the Plugin Object Store for more information about inner objects.
446  /// This function is also called during undo or redo operations
447  /// \warning This function is guaranteed to be called by a single thread at a time.
449  IPluginPropertySet* in_pPSet, ///< The inner object that changed
450  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
451  LPCWSTR in_pszPropertyName ///< The name of the property
452  ) = 0;
453 
454  /// This function is called by Wwise when a inner object property changes (for example,
455  /// through interaction with a UI control bound to a property, or through undo/redo operations).
456  /// See the Plugin Object Store for more information about inner objects.
457  /// \warning This function is guaranteed to be called by a single thread at a time.
459  IPluginPropertySet* in_pPSet, ///< The inner object that was added or removed
460  unsigned int in_uiIndex, ///< The insertion/removal index
461  NotifyInnerObjectOperation in_eOperation ///< InnerObjectAdded or InnerObjectRemoved
462  ) = 0;
463 
464  /// This function is called by Wwise when a the plugin media changes.
465  /// It is called when plugin media is added, removed or changes.
466  /// This function is also called during undo or redo operations
467  /// Use AK::Wwise::IAudioPlugin::SetPluginObjectMedia and AK::Wwise::IPluginObjectMedia to
468  /// set plugin media.
469  /// \warning This function is guaranteed to be called by a single thread at a time.
470  virtual void NotifyPluginMediaChanged() = 0;
471 
472  /// This function is called by Wwise to obtain parameters that will be written to a bank.
473  /// Because these can be changed at run-time, the parameter block should stay relatively small.
474  /// Larger data should be put in the Data Block.
475  /// \warning This function is guaranteed to be called by a single thread at a time.
476  /// \return True if the plug-in put some parameters in the bank, False otherwise
477  /// \sa
478  /// - \ref wwiseplugin_bank
479  /// - \ref wwiseplugin_propertyset
480  virtual bool GetBankParameters(
481  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
482  IWriteData* in_pDataWriter ///< A pointer to the data writer interface
483  ) const = 0;
484 
485  /// This function is called by Wwise to obtain parameters that will be sent to the
486  /// sound engine when Wwise is connected. This block should contain only data
487  /// that is NOT a property defined in the plugin xml file. The parameter ID
488  /// should be something different than the ones used in the plugin xml.
489  /// \warning This function is guaranteed to be called by a single thread at a time.
490  /// \return True if the plug-in has some plugin-defined data. False otherwise.
491  /// \sa
492  /// - AK::Wwise::IPluginPropertySet::NotifyInternalDataChanged
493  /// - AK::IAkPluginParam::ALL_PLUGIN_DATA_ID
494  /// - AK::IAkPluginParam::SetParam
495  virtual bool GetPluginData(
496  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
497  AkPluginParamID in_idParam, ///< The plugin-defined parameter ID
498  IWriteData* in_pDataWriter ///< A pointer to the data writer interface
499  ) const = 0;
500 
501  /// This function is called by Wwise to get the plug-in's HINSTANCE used for loading resources.
502  /// \warning This function is guaranteed to be called by a single thread at a time.
503  /// \return A handle to the instance of the plug-in DLL
504  /// \sa
505  /// - \ref wwiseplugin_dialogcode
506  virtual HINSTANCE GetResourceHandle() const = 0;
507 
508  /// This function is called by Wwise to get the plug-in dialog parameters.
509  /// \warning This function is guaranteed to be called by a single thread at a time.
510  /// \return True if a dialog was returned, False otherwise
511  /// \sa
512  /// - \ref wwiseplugin_dialogcode
513  /// - \ref wwiseplugin_dialog_guide
514  virtual bool GetDialog(
515  eDialog in_eDialog, ///< The dialog type
516  UINT & out_uiDialogID, ///< The returned resource ID of the dialog
517  PopulateTableItem *& out_pTable ///< The returned table of property-control bindings (can be NULL)
518  ) const = 0;
519 
520  /// Window message handler for dialogs. This is very similar to a standard WIN32 window procedure.
521  /// \warning This function is guaranteed to be called by a single thread at a time.
522  /// \return True if the message has been processed by the plug-in, False otherwise
523  /// \sa
524  /// - \ref wwiseplugin_dialogcode
525  virtual bool WindowProc(
526  eDialog in_eDialog, ///< The dialog type
527  HWND in_hWnd, ///< The window handle of the dialog
528  UINT in_message, ///< The incoming message. This is a standard Windows message ID (ex. WM_PAINT).
529  WPARAM in_wParam, ///< The WPARAM of the message (see MSDN)
530  LPARAM in_lParam, ///< The LPARAM of the message (see MSDN)
531  LRESULT & out_lResult ///< The returned value if the message has been processed (it is only considered if the method also returns True)
532  ) = 0;
533 
534  /// DEPRECATED: This function is called by Wwise to get the user-friendly name of the specified property.
535  /// This function should write the user-friendly name of
536  /// the specified property to the WCHAR buffer out_pszDisplayName,
537  /// which is of length in_unCharCount.
538  /// \warning This function is deprecated. You need to define the property display names in the plug-in XML definition. Refer to \ref wwiseplugin_xml_userinterface for more information.
539  /// \warning This function is guaranteed to be called by a single thread at a time.
540  /// \return True if the property has a user-friendly name, False otherwise
541  /// \sa
542  /// - \ref wwiseplugin_displaynames
543  virtual bool DisplayNameForProp(
544  LPCWSTR in_pszPropertyName, ///< The internal name of the property
545  LPWSTR out_pszDisplayName, ///< The returned user-friendly name
546  UINT in_unCharCount ///< The number of WCHAR in the buffer, including the terminating NULL
547  ) const = 0;
548 
549  /// DEPRECATED: This function is called by Wwise to get the user-friendly names of possible values for the
550  /// specified property.
551  /// This function should write pairs of value and text for the specified property to
552  /// the WCHAR buffer out_pszDisplayName, which is of length in_unCharCount.
553  /// Pairs are separated by commas, and each pair contains the value and the
554  /// text, separated by a colon. Here are a few examples:
555  /// - Numeric property: "-100:Left,0:Center,100:Right"
556  /// - Boolean property: "0:Off,1:On"
557  /// - Numeric property seen as an enumeration: "0:Low Pass,1:High Pass,2:Band Pass,3:Notch,4:Low Shelf,5:High Shelf,6:Peaking"
558  ///
559  /// \warning This function is deprecated. You need to define the enumeration display names in the plug-in XML definition. Refer to \ref wwiseplugin_xml_restrictions for more information.
560  /// \warning This function is guaranteed to be called by a single thread at a time.
561  /// \return True if the property has user-friendly names for some values, False otherwise
562  /// \sa
563  /// - \ref wwiseplugin_displaynames
564  virtual bool DisplayNamesForPropValues(
565  LPCWSTR in_pszPropertyName, ///< The internal name of the property
566  LPWSTR out_pszValuesName, ///< The returned property value names
567  UINT in_unCharCount ///< The number of WCHAR in the buffer, including the terminating NULL character
568  ) const = 0;
569 
570  /// Called when the user clicks on the '?' icon.
571  /// \warning This function is guaranteed to be called by a single thread at a time.
572  /// \return True if the plug-in handled the help request, false otherwise
573  /// \sa
574  /// - \ref wwiseplugin_help
575  virtual bool Help(
576  HWND in_hWnd, ///< The handle of the dialog
577  eDialog in_eDialog, ///< The dialog type
578  LPCWSTR in_szLanguageCode ///< The language code in ISO639-1
579  ) const = 0;
580 
581  /// Called when an instance of the run-time component of the plug-in sends data
582  /// using \c AK::IAkEffectPluginContext::PostMonitorData(), and this plug-in's settings
583  /// are being displayed in a window. Because multiple run-time instances may exist for a single
584  /// authoring tool plug-in, the data is batched together and passed at the end of the frame.
585  /// Define the CanSendMonitorData element to true in the plug-in XML to activate the monitoring user interface.
586  virtual void NotifyMonitorData(
587  AkTimeMs in_iTimeStamp, ///< Timestamp of the data (in milliseconds)
588  const MonitorData * in_pDataArray, ///< Array of blobs of data
589  unsigned int in_uCount, ///< Number of elements in array 'in_pDataArray'
590  bool in_bNeedsByteSwap, ///< True if data comes from platform with a different byte ordering (i.e. Big Endian)
591  bool in_bRealtime ///< True if monitoring in real-time, false if scrubbing through profiler history
592  ) = 0;
593 
594  /// Retrieve a pointer to the class implementing IPluginObjectMedia. Plug-ins using the media sources
595  /// functionality can simply return a pointer to themselves while other not using the functionality should return NULL
597 
598  /// Retrieve the licensing status of the plug-in for the given platform.
599  /// \return Licensing status of the plug-in; LicenseStatus_Unlicensed or LicenseStatus_Expired will prevent the plug-in from being included in a SoundBank.
600  /// \sa
601  /// - \ref IPluginPropertySet::GetLicenseStatus
602  /// - \ref IPluginPropertySet::GetAssetLicenseStatus
603  /// - \ref wwiseplugin_dll_license
605  const GUID & in_guidPlatform, ///< GUID of the platform
606  AK::Wwise::Severity& out_eSeverity, ///< (Optional) If set, the string placed in out_pszMessage will be shown in the log with the corresponding severity.
607  LPWSTR out_pszMessage, ///< Pointer to the buffer that will hold the message string
608  unsigned int in_uiBufferSize ///< Size of the buffer pointed by out_pszMessage (in number of WCHAR, including null terminator)
609  ) = 0;
610 
611  /// Return the minimum and maximum duration, in seconds. This function is only useful with source plug-ins.
612  /// \return True if the duration values are valid, False otherwise.
613  virtual bool GetSourceDuration(
614  double& out_dblMinDuration, ///< Minimum duration, in seconds
615  double& out_dblMaxDuration ///< Maximum duration, in seconds
616  ) const = 0;
617  };
618 
619  /// Use this base class to quickly implement most plugin functions empty
621  {
622  public:
623  virtual void SetPluginPropertySet( IPluginPropertySet * in_pPSet ){}
624  virtual void SetPluginObjectStore( IPluginObjectStore * in_pObjectStore ){}
625  virtual void SetPluginObjectMedia( IPluginObjectMedia * in_pObjectMedia ){}
626  virtual bool IsPlayable() const { return true; }
627  virtual void InitToDefault() {}
628  virtual void Delete() {}
629  virtual bool Load( AK::IXmlTextReader* in_pReader ) { return false; }
630  virtual bool Save( AK::IXmlTextWriter* in_pWriter ) { return false; }
631  virtual bool CopyInto( IAudioPlugin* io_pWObject ) const { return true; }
632  virtual void NotifyCurrentPlatformChanged( const GUID & in_guidCurrentPlatform ) {}
633  virtual void NotifyPropertyChanged( const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
634  virtual void NotifyInnerObjectPropertyChanged( IPluginPropertySet* in_pPSet, const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
635  virtual void NotifyInnerObjectAddedRemoved( IPluginPropertySet* in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation ) {}
636  virtual void NotifyPluginMediaChanged() {}
637  virtual bool GetBankParameters( const GUID & in_guidPlatform, IWriteData* in_pDataWriter ) const { return false; }
638  virtual bool GetPluginData( const GUID & in_guidPlatform, AkPluginParamID in_idParam, IWriteData* in_pDataWriter ) const { return false; }
639  virtual bool WindowProc( eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult ){ return false; }
640  virtual bool DisplayNameForProp( LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount ) const { return false; }
641  virtual bool DisplayNamesForPropValues( LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount ) const { return false; }
642  virtual bool Help( HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode ) const { return false; }
643  virtual void NotifyMonitorData( AkTimeMs in_iTimeStamp, const AK::Wwise::IAudioPlugin::MonitorData * in_pData, unsigned int in_uDataSize, bool in_bNeedsByteSwap, bool in_bRealtime){}
645  virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &, AK::Wwise::Severity&, LPWSTR, unsigned int in_uiBufferSize){ return AK::Wwise::LicenseStatus_Valid; }
646  virtual bool GetSourceDuration( double& out_dblMinDuration, double& out_dblMaxDuration ) const { out_dblMinDuration = 0.f; out_dblMaxDuration = FLT_MAX; return false; }
647  virtual HINSTANCE GetResourceHandle() const { return NULL; }
648  virtual bool GetDialog(eDialog in_eDialog, UINT& out_uiDialogID, PopulateTableItem*& out_pTable) const { return false; }
649  };
650 
651  #ifdef AK_WIN
652  typedef AKRESULT(CALLBACK* RegisterWwisePluginFn)(AK::PluginRegistration *in_pList);
654  {
655  if (!g_pAKPluginList)
656  {
657  AKASSERT(!"g_pAKPluginList is NULL. Did you use the AK_STATIC_LINK_PLUGIN macro in your DLL?"); // Should be populated by now.
658  return AK_Fail;
659  }
660 
661  HMODULE hLib = ::LoadLibrary(L"WwiseSoundEngine.dll");
662  if (hLib == NULL)
663  return AK_Fail;
664 
665  RegisterWwisePluginFn pReg = (RegisterWwisePluginFn)::GetProcAddress(hLib, "RegisterWwisePlugin20192");
666  if (pReg == NULL)
667  return AK_Fail;
668 
669  return pReg(g_pAKPluginList);
670  }
671  #endif
672 
673  /// Struct to be used with the function GetSinkPluginDevices to return devices.
674 #define AK_MAX_OUTPUTDEVICEDESCRIPTOR 256
676  {
677  WCHAR name[AK_MAX_OUTPUTDEVICEDESCRIPTOR]; /// Display name of the device. Null terminated. Note that the name can't be more than 256 characters including the null.
678  AkUInt32 idDevice; /// ID of the device as used with AK::SoundEngine::AddOutput.
679  /// This will be passed back to the plugin through AK::IAkSinkPluginContext::GetOutputID.
680  /// Default device ID can be 0.
681  };
682  }
683 }
684 
685 /// Private message sent to Wwise window to open a topic in the help file
686 /// the WPARAM defines the help topic ID
687 #ifndef WM_AK_PRIVATE_SHOW_HELP_TOPIC
688 #define WM_AK_PRIVATE_SHOW_HELP_TOPIC 0x4981
689 #endif
690 
691 #endif // _AK_WWISE_AUDIOPLUGIN_H
virtual bool Load(AK::IXmlTextReader *in_pReader)
Definition: AudioPlugin.h:629
virtual IPluginPropertySet * CreateObject(LPCWSTR in_pszType)=0
virtual bool GetBankParameters(const GUID &in_guidPlatform, IWriteData *in_pDataWriter) const =0
virtual void NotifyMonitorData(AkTimeMs in_iTimeStamp, const AK::Wwise::IAudioPlugin::MonitorData *in_pData, unsigned int in_uDataSize, bool in_bNeedsByteSwap, bool in_bRealtime)
Definition: AudioPlugin.h:643
virtual bool WindowProc(eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT &out_lResult)
Definition: AudioPlugin.h:639
virtual bool DisplayNamesForPropValues(LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount) const =0
virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &in_guidPlatform, AK::Wwise::Severity &out_eSeverity, LPWSTR out_pszMessage, unsigned int in_uiBufferSize)=0
AkInt32 AkTimeMs
Time in ms.
Definition: AkTypes.h:56
Audiokinetic namespace.
@ AK_Fail
The operation failed.
Definition: AkTypes.h:134
virtual bool RemoveObject(IPluginPropertySet *in_pPropertySet)=0
virtual const GUID & GetID() const =0
Obtain the unique identifier of the corresponding IWObject.
virtual void SetPluginPropertySet(IPluginPropertySet *in_pPSet)=0
AKRESULT RegisterWwisePlugin()
Definition: AudioPlugin.h:653
AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList
Definition: IAkPlugin.h:91
virtual IPluginMediaConverter * GetPluginMediaConverterInterface()
Definition: AudioPlugin.h:644
virtual ULONG GetCurrentConversionSettingsHash(const GUID &in_guidPlatform, AkUInt32 in_uSampleRate=0, AkUInt32 in_uBlockLength=0)=0
virtual HINSTANCE GetResourceHandle() const
Definition: AudioPlugin.h:647
virtual bool GetBankParameters(const GUID &in_guidPlatform, IWriteData *in_pDataWriter) const
Definition: AudioPlugin.h:637
AKRESULT
Standard function call result.
Definition: AkTypes.h:131
virtual bool DisplayNameForProp(LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount) const
Definition: AudioPlugin.h:640
virtual bool Help(HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode) const =0
virtual unsigned int GetConvertedDirectory(LPWSTR out_pszDirectory, unsigned int in_uiBufferSize, const GUID &in_guidPlatform) const =0
virtual bool CanLogUndos()=0
virtual unsigned int GetListName(unsigned int in_uiListIndex, LPWSTR out_pszListName, unsigned int in_uiBufferSize) const =0
virtual bool CopyInto(IAudioPlugin *io_pWObject) const =0
virtual bool WindowProc(eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT &out_lResult)=0
ConversionResult
Conversion error code.
Definition: Utilities.h:189
virtual IPluginMediaConverter * GetPluginMediaConverterInterface()=0
@ LicenseStatus_Valid
A license is found and is valid.
Definition: Utilities.h:96
LicenseType
License type.
Definition: Utilities.h:85
#define NULL
Definition: AkTypes.h:46
virtual unsigned int GetMediaSourceCount() const =0
virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &, AK::Wwise::Severity &, LPWSTR, unsigned int in_uiBufferSize)
Definition: AudioPlugin.h:645
AkUInt32 idDevice
Display name of the device. Null terminated. Note that the name can't be more than 256 characters inc...
Definition: AudioPlugin.h:678
virtual bool PropertyHasRTPC(LPCWSTR in_pszPropertyName)=0
virtual void NotifyPropertyChanged(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)=0
virtual ConversionResult ConvertFile(const GUID &in_guidPlatform, const BasePlatformID &in_basePlatform, LPCWSTR in_szSourceFile, LPCWSTR in_szDestFile, AkUInt32 in_uSampleRate, AkUInt32 in_uBlockLength, AK::Wwise::IProgress *in_pProgress, IWriteString *io_pError)=0
Use this base class to quickly implement most plugin functions empty.
Definition: AudioPlugin.h:621
virtual bool GetValue(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName, VARIANT &out_varProperty)=0
NotifyInnerObjectOperation
Type of operation for the NotifyInnerObjectAddedRemoved function.
Definition: AudioPlugin.h:349
AKRESULT(CALLBACK * RegisterWwisePluginFn)(AK::PluginRegistration *in_pList)
Definition: AudioPlugin.h:652
virtual void NotifyInnerObjectAddedRemoved(IPluginPropertySet *in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation)=0
virtual IPluginPropertySet * GetObject(LPCWSTR in_pszListName, unsigned int in_uiIndex) const =0
virtual unsigned int GetOriginalDirectory(LPWSTR out_pszDirectory, unsigned int in_uiBufferSize) const =0
virtual void WaapiCall(const char *in_szUri, const char *in_szArgs, const char *in_szOptions, AK::IAkPluginMemAlloc *in_pAlloc, char *&out_szResults, char *&out_szError) const =0
Find and call the specified procedure. Calls made using this function are always blocking.
virtual unsigned int GetMediaSourceConvertedFilePath(LPWSTR out_pszFileName, unsigned int in_uiBufferSize, const GUID &in_guidPlatform, unsigned int in_Index=0) const =0
#define AKASSERT(Condition)
Definition: AkAssert.h:67
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const =0
virtual void NotifyInnerObjectPropertyChanged(IPluginPropertySet *in_pPSet, const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)=0
virtual HINSTANCE GetResourceHandle() const =0
virtual bool GetDialog(eDialog in_eDialog, UINT &out_uiDialogID, PopulateTableItem *&out_pTable) const =0
virtual void InsertObject(LPCWSTR in_pszListName, unsigned int in_uiIndex, IPluginPropertySet *in_pPropertySet)=0
virtual void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty=true)=0
virtual BasePlatformID GetCurrentBasePlatform()=0
virtual void SetPluginPropertySet(IPluginPropertySet *in_pPSet)
Definition: AudioPlugin.h:623
virtual bool Load(AK::IXmlTextReader *in_pReader)=0
virtual GUID GetCurrentPlatform()=0
virtual void InvalidateMediaSource(unsigned int in_Index=0)=0
Request Wwise to perform any required conversion on the data.
WCHAR name[AK_MAX_OUTPUTDEVICEDESCRIPTOR]
Definition: AudioPlugin.h:677
virtual bool DisplayNameForProp(LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount) const =0
virtual void NotifyCurrentPlatformChanged(const GUID &in_guidCurrentPlatform)=0
virtual bool SetValue(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName, const VARIANT &in_varProperty)=0
virtual bool Save(AK::IXmlTextWriter *in_pWriter)=0
virtual bool DisplayNamesForPropValues(LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount) const
Definition: AudioPlugin.h:641
virtual GUID GetAuthoringPlaybackPlatform()=0
This function is called To retrieve the custom platform being used to run while in authoring.
virtual void SetPluginObjectStore(IPluginObjectStore *in_pObjectStore)
Definition: AudioPlugin.h:624
uint64_t AkUInt64
Unsigned 64-bit integer.
virtual void InitToDefault()=0
virtual bool Help(HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode) const
Definition: AudioPlugin.h:642
LicenseStatus
License status.
Definition: Utilities.h:93
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const
Definition: AudioPlugin.h:646
virtual void NotifyPluginMediaChanged()=0
virtual AK::Wwise::IUndoManager * GetUndoManager()=0
virtual bool GetPluginData(const GUID &in_guidPlatform, AkPluginParamID in_idParam, IWriteData *in_pDataWriter) const =0
virtual void Delete()=0
virtual bool IsPlayable() const =0
virtual void NotifyInnerObjectAddedRemoved(IPluginPropertySet *in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation)
Definition: AudioPlugin.h:635
virtual bool CopyInto(IAudioPlugin *io_pWObject) const
Definition: AudioPlugin.h:631
virtual bool Save(AK::IXmlTextWriter *in_pWriter)
Definition: AudioPlugin.h:630
virtual unsigned int GetListCount() const =0
virtual void GetAssetLicenseStatus(const GUID &in_guidPlatform, AkUInt32 in_uAssetID, AK::Wwise::LicenseType &out_eType, AK::Wwise::LicenseStatus &out_eStatus, UINT32 &out_uDaysToExpiry)=0
Obtain licensing status for a plug-in-specific asset ID. Refer to Managing Licenses for more informat...
virtual unsigned int GetMediaSourceOriginalFilePath(LPWSTR out_pszFileName, unsigned int in_uiBufferSize, unsigned int in_Index=0) const =0
#define AK_MAX_OUTPUTDEVICEDESCRIPTOR
Struct to be used with the function GetSinkPluginDevices to return devices.
Definition: AudioPlugin.h:674
virtual void NotifyPropertyChanged(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)
Definition: AudioPlugin.h:633
uint32_t AkUInt32
Unsigned 32-bit integer.
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID.
Definition: AkTypes.h:66
virtual void NotifyInnerObjectPropertyChanged(IPluginPropertySet *in_pPSet, const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)
Definition: AudioPlugin.h:634
virtual void DeleteObject(IPluginPropertySet *in_pPropertySet)=0
virtual void SetPluginObjectStore(IPluginObjectStore *in_pObjectStore)=0
virtual unsigned int GetMediaSourceFileName(LPWSTR out_pszFileName, unsigned int in_uiBufferSize, unsigned int in_Index=0) const =0
virtual bool GetPluginData(const GUID &in_guidPlatform, AkPluginParamID in_idParam, IWriteData *in_pDataWriter) const
Definition: AudioPlugin.h:638
virtual unsigned int GetObjectCount(LPCWSTR in_pszListName) const =0
virtual void RemoveMediaSource(unsigned int in_Index=0)=0
Requests to remove the specified index file s a data input file.
virtual bool GetDialog(eDialog in_eDialog, UINT &out_uiDialogID, PopulateTableItem *&out_pTable) const
Definition: AudioPlugin.h:648
virtual void GetLicenseStatus(const GUID &in_guidPlatform, AK::Wwise::LicenseType &out_eType, AK::Wwise::LicenseStatus &out_eStatus, UINT32 &out_uDaysToExpiry)=0
Obtain licensing status for the plug-in. Refer to Managing Licenses for more information.
virtual void SetPluginObjectMedia(IPluginObjectMedia *in_pObjectMedia)
Definition: AudioPlugin.h:625
virtual bool SetMediaSource(LPCWSTR in_pszFilePathToImport, unsigned int in_Index=0, bool in_bReplace=false)=0
Requests to set the specified file as a data input file.
virtual void SetPluginObjectMedia(IPluginObjectMedia *in_pObjectMedia)=0
virtual BasePlatformID GetDefaultNativeAuthoringPlaybackPlatform()=0
This function is called To retrieve the base platforms of the authoring tool.
Severity
Log message severity.
Definition: Utilities.h:103
virtual void NotifyCurrentPlatformChanged(const GUID &in_guidCurrentPlatform)
Definition: AudioPlugin.h:632
virtual void NotifyMonitorData(AkTimeMs in_iTimeStamp, const MonitorData *in_pDataArray, unsigned int in_uCount, bool in_bNeedsByteSwap, bool in_bRealtime)=0

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise