Table of Contents

Wwise SDK 2019.1.6
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  Version: <VERSION> Build: <BUILDNUMBER>
25  Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /// \file
29 /// Wwise audio plug-in interface, used to implement the Wwise side of a source or effect plug-in.
30 
31 #ifndef _AK_WWISE_AUDIOPLUGIN_H
32 #define _AK_WWISE_AUDIOPLUGIN_H
33 
34 #include "Undo.h"
35 
36 #include <AK/Wwise/Utilities.h>
37 #include <AK/SoundEngine/Common/AkSoundEngine.h> /// Dummy assert hook definition.
39 #include <AK/Wwise/PlatformID.h>
40 
41 #include <float.h>
42 
43 // Audiokinetic namespace
44 namespace AK
45 {
46  class IXmlTextReader;
47  class IXmlTextWriter;
48 
49  // Audiokinetic Wwise namespace
50  namespace Wwise
51  {
53  {
54  public:
55  /// If the conversion failed the function is responsible of deleting
56  /// any files that may have been created, even the destination file
57  /// in case of error. If the function return false we will use the
58  /// string put in io_pError to display an error message.
60  const GUID & in_guidPlatform, ///< The unique ID of the custom platform being converted for.
61  const BasePlatformID & in_basePlatform, ///< The unique ID of the base platform being converted for.
62  LPCWSTR in_szSourceFile, ///< Source File to convert data from.
63  LPCWSTR in_szDestFile, ///< DestinationFile, must be created by the plug-in.
64  AkUInt32 in_uSampleRate, ///< The target sample rate for the converted file, passing 0 will default to the platform default
65  AkUInt32 in_uBlockLength, ///< The block length, passing 0 will default to the platform default
66  AK::Wwise::IProgress* in_pProgress, ///< Optional Progress Bar controller.
67  IWriteString* io_pError ///< Optional error string that can be displayed if ConversionResult is not successful
68  ) = 0;
69 
71  const GUID & in_guidPlatform, ///< The unique ID of the platform being converted for.
72  AkUInt32 in_uSampleRate = 0, ///< The target sample rate for the converted file, passing 0 will default to the platform default.
73  AkUInt32 in_uBlockLength = 0 ///< The block length, passing 0 will default to the platform default.
74  ) = 0;
75  };
76 
77  /// Plug-in property set interface. An instance of this class is created and
78  /// assigned to each plug-in, which in turn can use it to manage its properties.
79  /// Whenever a property name is specified, it corresponds to the property
80  /// name set in the plug-in's XML definition file.
81  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
82  /// \sa
83  /// - \ref wwiseplugin_xml_properties_tag
84  /// - AK::Wwise::IAudioPlugin::SetPluginPropertySet()
85  /// - \ref wwiseplugin_propertyset
87  {
88  public:
89  /// Get the value of a property for a specified platform.
90  /// \return True if successful, False otherwise
91  /// \sa
92  /// - \ref wwiseplugin_bank
93  virtual bool GetValue(
94  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
95  LPCWSTR in_pszPropertyName, ///< The name of the property
96  VARIANT & out_varProperty ///< The returned value of the property
97  ) = 0;
98 
99  /// Set the value of a property for a specified platform.
100  /// \return True if successful, False otherwise.
101  virtual bool SetValue(
102  const GUID & in_guidPlatform, ///< The unique ID of the platform to modify
103  LPCWSTR in_pszPropertyName, ///< The name of the property
104  const VARIANT & in_varProperty ///< The value to set
105  ) = 0;
106 
107  /// Get the RTPC binding status for a specified property.
108  /// \return True if property is bound to a RTPC, False otherwise.
109  virtual bool PropertyHasRTPC(
110  LPCWSTR in_pszPropertyName ///< The name of the property
111  ) = 0;
112 
113  /// This function is called by Wwise to get the current platform's identifier.
114  /// This can be passed to any function that has a parameter
115  /// for a platform ID, such as GetValue() or SetValue(), when you want to make
116  /// the call for the currently active platform.
117  /// \return The unique ID of the current platform
118  virtual GUID GetCurrentPlatform() = 0;
119 
120  /// This function is called by Wwise to get the current base platform
121  /// \return The unique ID of the current base platform
123 
124  /// This function is called To retrieve the base platforms of the authoring tool.
126 
127  /// This function is called To retrieve the custom platform being used to run while in authoring
128  virtual GUID GetAuthoringPlaybackPlatform() = 0;
129 
130  /// Use this function to tell Wwise that something other than properties
131  /// has changed within the plugin. This will set the plugin dirty (for save)
132  /// and GetPluginData will be called when the plugin is about to play in Wwise, to
133  /// transfer the internal data to the Sound Engine part of the plugin.
134  /// Use ALL_PLUGIN_DATA_ID to tell that all the data has to be refreshed.
135  virtual void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty = true) = 0;
136 
137  /// Call this function when you are about to log an undo event to know if Wwise is
138  /// in a state where undos are enabled. Undo logging can be disabled for a particular
139  /// plugin object if it already lives in the undo stack or in the clipboard.
140  virtual bool CanLogUndos() = 0;
141 
142  /// Obtain the Undo Manager. The Undo Manager can be used to group undo together or
143  /// to check the status of the undo system.
144  virtual AK::Wwise::IUndoManager * GetUndoManager() = 0;
145 
146  /// Obtain licensing status for the plug-in. Refer to \ref wwiseplugin_dll_license for more information.
147  virtual void GetLicenseStatus(
148  const GUID & in_guidPlatform, ///< GUID of the platform
149  AK::Wwise::LicenseType & out_eType, ///< License Type
150  AK::Wwise::LicenseStatus & out_eStatus, ///< License Status
151  UINT32 & out_uDaysToExpiry ///< Days until license expiry
152  ) = 0;
153 
154  /// Obtain licensing status for a plug-in-specific asset ID. Refer to \ref wwiseplugin_dll_license for more information.
155  virtual void GetAssetLicenseStatus(
156  const GUID & in_guidPlatform, ///< GUID of the platform
157  AkUInt32 in_uAssetID, ///< ID of the asset
158  AK::Wwise::LicenseType & out_eType, ///< License Type
159  AK::Wwise::LicenseStatus & out_eStatus, ///< License Status
160  UINT32 & out_uDaysToExpiry ///< Days until license expiry
161  ) = 0;
162 
163  /// Obtain the unique identifier of the corresponding IWObject.
164  virtual const GUID& GetID() const = 0;
165 
166  /// Find and call the specified procedure. Calls made using this function are always blocking.
167  virtual void WaapiCall(
168  const char* in_szUri, ///< URI of the procedure to call
169  const char* in_szArgs, ///< JSON string (utf-8) of arguments to pass to the procedure or NULL for no arguments
170  const char* in_szOptions, ///< JSON string (utf-8) of options to pass to the procedure or NULL for no options
171  AK::IAkPluginMemAlloc* in_pAlloc, ///< Allocator used to allocate memory for the results or the error
172  char*& out_szResults, ///< JSON string (utf-8) containing the results (if any)
173  char*& out_szError ///< JSON string (utf-8) containing the error (if any)
174  ) const = 0;
175  };
176 
177  /// Plug-in object store interface. An instance of this class is created and
178  /// assigned to each plug-in, which in turn can use it to manage its inner objects.
179  /// Inner objects can be created from the inner types defined in the plug-in's XML
180  /// definition file.
181  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
182  /// \sa
183  /// - AK::Wwise::IAudioPlugin::SetPluginObjectStore()
184  /// - \ref wwiseplugin_objectstore
185  /// - \ref wwiseplugin_xml_properties_tag
187  {
188  public:
189  /// Inserts an object into the specified list at the specified position. To create objects,
190  /// use CreateObject. Note that an object can only be inside one list.
191  /// Pass (unsigned int)-1 as the index to insert at the end of the list
192  virtual void InsertObject(
193  LPCWSTR in_pszListName,
194  unsigned int in_uiIndex,
195  IPluginPropertySet* in_pPropertySet
196  ) = 0;
197 
198  /// Removes an object from its list. The list is not specified and is automatically found.
199  /// The function \c DeleteObject must be called if the object is no longer necessary.
200  /// \return True if successful, False otherwise
201  virtual bool RemoveObject(
202  IPluginPropertySet* in_pPropertySet
203  ) = 0;
204 
205  /// Gets an object inside the specified list at the specified position.
206  /// \return The object in the specified list at the specified position, NULL if list or index are invalid
207  virtual IPluginPropertySet* GetObject(
208  LPCWSTR in_pszListName,
209  unsigned int in_uiIndex
210  ) const = 0;
211 
212  /// Get the number of object inside the specified list.
213  /// \return Number of object inside the specified list.
214  virtual unsigned int GetObjectCount(
215  LPCWSTR in_pszListName
216  ) const = 0;
217 
218  /// Create a new object instance of the specified type. The type must be defined in the Plugin XML definition.
219  /// See the \c InnerTypes section in the plug-in definition.
220  /// \return The instance of the newly created object, NULL if not successful
222  LPCWSTR in_pszType
223  ) = 0;
224 
225  /// Frees the object. It will also remove the object from its list if the object is still in a list.
226  /// Do not use the object after calling this function.
227  virtual void DeleteObject(
228  IPluginPropertySet* in_pPropertySet
229  ) = 0;
230 
231  /// Gets the number of lists.
232  /// \return The number of lists.
233  virtual unsigned int GetListCount() const = 0;
234 
235  /// Get the name of the list at the specified position. The buffer must be large enough to copy the list name.
236  /// When the buffer is too small, the function do not write to the buffer and return zero.
237  /// \return Number of characters written to the buffer, zero if failed.
238  virtual unsigned int GetListName(
239  unsigned int in_uiListIndex,
240  LPWSTR out_pszListName,
241  unsigned int in_uiBufferSize
242  ) const = 0;
243  };
244 
245  /// Plug-in object media interface. An instance of this class is created and
246  /// assigned to each plug-in that supports media file handling.
247  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
248  /// \sa
249  /// - AK::Wwise::IAudioPlugin::SetPluginObjectMedia()
251  {
252  public:
253 
254  /// Requests to set the specified file as a data input file.
255  virtual bool SetMediaSource(
256  LPCWSTR in_pszFilePathToImport, ///< File path: can be null in the case of plugin-generated data not requiring an original file
257  unsigned int in_Index = 0, ///< Optional index
258  bool in_bReplace = false ///< Optional: set to true to replace existing file if the name is already in used
259  ) = 0;
260 
261  /// Requests to remove the specified index file s a data input file.
262  virtual void RemoveMediaSource(
263  unsigned int in_Index = 0 ///< Optional index
264  ) = 0;
265 
266  /// Retrieve the number of dataSource, it will be then possible to
267  /// call GetMediaFileName or RemoveMediaSource using the provided index
268  virtual unsigned int GetMediaSourceCount() const = 0;
269 
270  /// Retrieve the file name of the source plug-in data relative to the
271  /// original directory at the specified index.
272  /// Mostly used to allow the Plug-in to display this information.
273  /// \return Number of characters written to the buffer, zero if failed.
274  virtual unsigned int GetMediaSourceFileName(
275  LPWSTR out_pszFileName, ///< Relative path of the associated file
276  unsigned int in_uiBufferSize, ///< Size of the provided string buffer
277  unsigned int in_Index = 0 ///< Optional index
278  ) const = 0;
279 
280  /// Retrieve the file path of the source plug-in data at the specified index.
281  /// \return Number of characters written to the buffer, zero if failed.
282  virtual unsigned int GetMediaSourceOriginalFilePath(
283  LPWSTR out_pszFileName, ///< Relative path of the associated file
284  unsigned int in_uiBufferSize, ///< Size of the provided string buffer
285  unsigned int in_Index = 0 ///< Optional index
286  ) const = 0;
287 
288  /// Retrieve the file path of the converted plug-in data at the specified index.
289  /// \return Number of characters written to the buffer, zero if failed.
290  virtual unsigned int GetMediaSourceConvertedFilePath(
291  LPWSTR out_pszFileName, ///< Relative path of the associated file
292  unsigned int in_uiBufferSize, ///< Size of the provided string buffer
293  const GUID & in_guidPlatform, ///< The GUID of the platform
294  unsigned int in_Index = 0 ///< Optional index
295  ) const = 0;
296 
297  /// Request Wwise to perform any required conversion on the data
298  virtual void InvalidateMediaSource( unsigned int in_Index = 0 ) = 0;
299 
300  /// Obtain the Original directory for the plugin
301  /// \return Number of characters written to the buffer, zero if failed.
302  virtual unsigned int GetOriginalDirectory(
303  LPWSTR out_pszDirectory, ///< Pointer to the buffer that will hold the directory string
304  unsigned int in_uiBufferSize ///< Size of the buffer pointed by out_pszDirectory
305  ) const = 0;
306 
307  /// Obtain the Converted directory for the plugin and platform
308  /// \return Number of characters written to the buffer, zero if failed.
309  virtual unsigned int GetConvertedDirectory(
310  LPWSTR out_pszDirectory, ///< Pointer to the buffer that will hold the directory string
311  unsigned int in_uiBufferSize, ///< Size of the buffer pointed by out_pszDirectory
312  const GUID & in_guidPlatform ///< The GUID of the platform
313  ) const = 0;
314  };
315 
316  /// Wwise plug-in interface. This must be implemented for each source or
317  /// effect plug-in that is exposed in Wwise.
318  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
319  /// \sa
320  /// - \ref wwiseplugin_object
322  : public IPluginBase
323  {
324  public:
325  /// Dialog type. Source plug-ins can be edited in the Property Editor or
326  /// the Contents Editor, while effect plug-ins can only be edited in the
327  /// Effect Editor.
328  /// \sa
329  /// - \ref wwiseplugin_dialogcode
330  enum eDialog
331  {
332  SettingsDialog, ///< Main plug-in dialog. This is the dialog used in the Property
333  ///< Editor for source plug-ins, and in the Effect Editor for
334  ///< effect plug-ins.
335  ContentsEditorDialog ///< Contents Editor dialog. This is the small dialog used in the
336  ///< Contents Editor for source plug-ins.
337  };
338 
339  /// Type of operation for the NotifyInnerObjectAddedRemoved function.
341  {
344  };
345 
346  struct MonitorData
347  {
349  void* pData;
350  unsigned int uDataSize;
351  };
352 
353  /// The property set interface is given to the plug-in through this method. It is called by Wwise during
354  /// initialization of the plug-in, before most other calls.
355  /// \warning This function is guaranteed to be called by a single thread at a time.
356  /// \sa
357  /// - \ref wwiseplugin_propertyset
358  virtual void SetPluginPropertySet(
359  IPluginPropertySet * in_pPSet ///< A pointer to the property set interface
360  ) = 0;
361 
362  /// The plugin object store interface is given to the plug-in through this method.
363  /// It is called by Wwise during initialization of the plug-in, before most other calls.
364  /// Use this interface to manage plugin inner objects.
365  /// \warning This function is guaranteed to be called by a single thread at a time.
366  /// \sa
367  /// - \ref wwiseplugin_objectstore
368  virtual void SetPluginObjectStore(
369  IPluginObjectStore * in_pObjectStore ///< A pointer to the plugin object store
370  ) = 0;
371 
372  /// The plugin object data file interface is given to the plug-in through this method.
373  /// Set plugin object media, that allows to create and manage media files
374  /// Use this interface to manage plugin media objects.
375  ///
376  /// NOTE: If the plug-in does not handle plugin media, this function should be
377  /// implemented as a void function by the plug-in.
378  ///
379  /// \warning This function is guaranteed to be called by a single thread at a time.
380  /// \sa
381  /// - \ref effectplugin_media
382  virtual void SetPluginObjectMedia(
383  IPluginObjectMedia * in_pObjectMedia
384  ) = 0;
385 
386  /// This function is called by Wwise to determine if the plug-in is in a playable state.
387  /// \warning This function is guaranteed to be called by a single thread at a time.
388  /// \return True if the plug-in is in a playable state, False otherwise
389  virtual bool IsPlayable() const = 0;
390 
391  /// Initialize custom data to default values. This is called by Wwise after SetPluginPropertySet()
392  /// when creating a new instance of the plug-in (i.e. not during a load). The properties on the
393  /// PropertySet do not need to be initialized in this method.
394  /// \warning This function is guaranteed to be called by a single thread at a time.
395  virtual void InitToDefault() = 0;
396 
397  /// Delete function called when the user press "delete" button on a plugin. This entry point must
398  /// set the undo/redo action properly.
399  /// \warning This function is guaranteed to be called by a single thread at a time.
400  virtual void Delete() = 0;
401 
402  /// Load file
403  /// \return \b true if load succeeded.
404  virtual bool Load( IXmlTextReader* in_pReader ) = 0;
405 
406  /// Save file
407  /// \return \b true if save succeeded.
408  virtual bool Save( IXmlTextWriter* in_pWriter ) = 0;
409 
410  /// Copy the plugin's custom data into another instance of the same plugin. This is used
411  /// during copy/paste and delete. The properties on the PropertySet do not need to
412  /// be copied in this method.
413  /// \warning This function is guaranteed to be called by a single thread at a time.
414  virtual bool CopyInto(
415  IAudioPlugin* io_pWObject // The object that will receive the custom data of this object.
416  ) const = 0;
417 
418  /// This function is called by Wwise when the current platform changes.
419  /// \warning This function is guaranteed to be called by a single thread at a time.
420  /// \sa
421  /// - \ref wwiseplugin_platformchange
422  virtual void NotifyCurrentPlatformChanged(
423  const GUID & in_guidCurrentPlatform ///< The unique ID of the new platform
424  ) = 0;
425 
426  /// This function is called by Wwise when a plug-in property changes (for example,
427  /// through interaction with a UI control bound to a property, or through undo/redo operations).
428  /// This function is also called during undo or redo operations
429  /// \warning This function is guaranteed to be called by a single thread at a time.
430  /// \sa
431  /// - \ref wwiseplugin_propertychange
432  virtual void NotifyPropertyChanged(
433  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
434  LPCWSTR in_pszPropertyName ///< The name of the property
435  ) = 0;
436 
437  /// This function is called by Wwise when a inner object property changes (for example,
438  /// through interaction with a UI control bound to a property, or through undo/redo operations).
439  /// See the Plugin Object Store for more information about inner objects.
440  /// This function is also called during undo or redo operations
441  /// \warning This function is guaranteed to be called by a single thread at a time.
442  /// \sa
443  /// - \ref wwiseplugin_propertychange
444  virtual void NotifyInnerObjectPropertyChanged(
445  IPluginPropertySet* in_pPSet, ///< The inner object that changed
446  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
447  LPCWSTR in_pszPropertyName ///< The name of the property
448  ) = 0;
449 
450  /// This function is called by Wwise when a inner object property changes (for example,
451  /// through interaction with a UI control bound to a property, or through undo/redo operations).
452  /// See the Plugin Object Store for more information about inner objects.
453  /// \warning This function is guaranteed to be called by a single thread at a time.
454  /// \sa
455  /// - \ref wwiseplugin_propertychange
456  virtual void NotifyInnerObjectAddedRemoved(
457  IPluginPropertySet* in_pPSet, ///< The inner object that was added or removed
458  unsigned int in_uiIndex, ///< The insertion/removal index
459  NotifyInnerObjectOperation in_eOperation ///< InnerObjectAdded or InnerObjectRemoved
460  ) = 0;
461 
462  /// This function is called by Wwise when a the plugin media changes.
463  /// It is called when plugin media is added, removed or changes.
464  /// This function is also called during undo or redo operations
465  /// Use AK::Wwise::IAudioPlugin::SetPluginObjectMedia and AK::Wwise::IPluginObjectMedia to
466  /// set plugin media.
467  /// \warning This function is guaranteed to be called by a single thread at a time.
468  /// \sa
469  /// - \ref wwiseplugin_propertychange
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  virtual void NotifyMonitorData(
586  const MonitorData * in_pDataArray, ///< Array of blobs of data
587  unsigned int in_uCount, ///< Number of elements in array 'in_pDataArray'
588  bool in_bNeedsByteSwap, ///< True if data comes from platform with a different byte ordering (i.e. Big Endian)
589  bool in_bRealtime ///< True if monitoring in real-time, false if scrubbing through profiler history
590  ) = 0;
591 
592  /// Retrieve a pointer to the class implementing IPluginObjectMedia. Plug-ins using the media sources
593  /// functionality can simply return a pointer to themselves while other not using the functionality should return NULL
595 
596  /// Retrieve the licensing status of the plug-in for the given platform.
597  /// \return Licensing status of the plug-in; LicenseStatus_Unlicensed or LicenseStatus_Expired will prevent the plug-in from being included in a SoundBank.
598  /// \sa
599  /// - \ref IPluginPropertySet::GetLicenseStatus
600  /// - \ref IPluginPropertySet::GetAssetLicenseStatus
601  /// - \ref wwiseplugin_dll_license
603  const GUID & in_guidPlatform, ///< GUID of the platform
604  AK::Wwise::Severity& out_eSeverity, ///< (Optional) If set, the string placed in out_pszMessage will be shown in the log with the corresponding severity.
605  LPWSTR out_pszMessage, ///< Pointer to the buffer that will hold the message string
606  unsigned int in_uiBufferSize ///< Size of the buffer pointed by out_pszMessage (in number of WCHAR, including null terminator)
607  ) = 0;
608 
609  /// Return the minimum and maximum duration, in seconds. This function is only useful with source plug-ins.
610  /// \return True if the duration values are valid, False otherwise.
611  virtual bool GetSourceDuration(
612  double& out_dblMinDuration, ///< Minimum duration, in seconds
613  double& out_dblMaxDuration ///< Maximum duration, in seconds
614  ) const = 0;
615  };
616 
617  /// Use this base class to quickly implement most plugin functions empty
619  {
620  public:
621  virtual void SetPluginPropertySet( IPluginPropertySet * in_pPSet ){}
622  virtual void SetPluginObjectStore( IPluginObjectStore * in_pObjectStore ){}
623  virtual void SetPluginObjectMedia( IPluginObjectMedia * in_pObjectMedia ){}
624  virtual bool IsPlayable() const { return true; }
625  virtual void InitToDefault() {}
626  virtual void Delete() {}
627  virtual bool Load( IXmlTextReader* in_pReader ) { return false; }
628  virtual bool Save( IXmlTextWriter* in_pWriter ) { return false; }
629  virtual bool CopyInto( IAudioPlugin* io_pWObject ) const { return true; }
630  virtual void NotifyCurrentPlatformChanged( const GUID & in_guidCurrentPlatform ) {}
631  virtual void NotifyPropertyChanged( const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
632  virtual void NotifyInnerObjectPropertyChanged( IPluginPropertySet* in_pPSet, const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
633  virtual void NotifyInnerObjectAddedRemoved( IPluginPropertySet* in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation ) {}
634  virtual void NotifyPluginMediaChanged() {}
635  virtual bool GetBankParameters( const GUID & in_guidPlatform, IWriteData* in_pDataWriter ) const { return false; }
636  virtual bool GetPluginData( const GUID & in_guidPlatform, AkPluginParamID in_idParam, IWriteData* in_pDataWriter ) const { return false; }
637  virtual bool WindowProc( eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult ){ return false; }
638  virtual bool DisplayNameForProp( LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount ) const { return false; }
639  virtual bool DisplayNamesForPropValues( LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount ) const { return false; }
640  virtual bool Help( HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode ) const { return false; }
641  virtual void NotifyMonitorData( const AK::Wwise::IAudioPlugin::MonitorData * in_pData, unsigned int in_uDataSize, bool in_bNeedsByteSwap, bool in_bRealtime){}
643  virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &, AK::Wwise::Severity&, LPWSTR, unsigned int in_uiBufferSize){ return AK::Wwise::LicenseStatus_Valid; }
644  virtual bool GetSourceDuration( double& out_dblMinDuration, double& out_dblMaxDuration ) const { out_dblMinDuration = 0.f; out_dblMaxDuration = FLT_MAX; return false; }
645  virtual HINSTANCE GetResourceHandle() const { return NULL; }
646  virtual bool GetDialog(eDialog in_eDialog, UINT& out_uiDialogID, PopulateTableItem*& out_pTable) const { return false; }
647  };
648 
651  {
652  if (!g_pAKPluginList)
653  {
654  AKASSERT(!"g_pAKPluginList is NULL. Did you use the AK_STATIC_LINK_PLUGIN macro in your DLL?"); // Should be populated by now.
655  return AK_Fail;
656  }
657 
658  HMODULE hLib = ::LoadLibrary(L"WwiseSoundEngine.dll");
659  if (hLib == NULL)
660  return AK_Fail;
661 
662  RegisterWwisePluginFn pReg = (RegisterWwisePluginFn)::GetProcAddress(hLib, "RegisterWwisePlugin");
663  if (pReg == NULL)
664  return AK_Fail;
665 
666  return pReg(g_pAKPluginList);
667  }
668 
669  /// Struct to be used with the function GetSinkPluginDevices to return devices.
670 #define AK_MAX_OUTPUTDEVICEDESCRIPTOR 256
672  {
673  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.
674  AkUInt32 idDevice; /// ID of the device as used with AK::SoundEngine::AddOutput.
675  /// This will be passed back to the plugin through AK::IAkSinkPluginContext::GetOutputID.
676  /// Default device ID can be 0.
677  };
678  }
679 }
680 
681 /// Private message sent to Wwise window to open a topic in the help file
682 /// the WPARAM defines the help topic ID
683 #define WM_AK_PRIVATE_SHOW_HELP_TOPIC 0x4981
684 
685 #endif // _AK_WWISE_AUDIOPLUGIN_H
virtual void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty=true)=0
virtual bool PropertyHasRTPC(LPCWSTR in_pszPropertyName)=0
WCHAR name[AK_MAX_OUTPUTDEVICEDESCRIPTOR]
Definition: AudioPlugin.h:673
virtual IPluginPropertySet * GetObject(LPCWSTR in_pszListName, unsigned int in_uiIndex) const =0
virtual const GUID & GetID() const =0
Obtain the unique identifier of the corresponding IWObject.
virtual void NotifyMonitorData(const AK::Wwise::IAudioPlugin::MonitorData *in_pData, unsigned int in_uDataSize, bool in_bNeedsByteSwap, bool in_bRealtime)
Definition: AudioPlugin.h:641
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.
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID.
Definition: AkTypes.h:76
AKRESULT RegisterWwisePlugin()
Definition: AudioPlugin.h:650
virtual HINSTANCE GetResourceHandle() const
Definition: AudioPlugin.h:645
virtual BasePlatformID GetDefaultNativeAuthoringPlaybackPlatform()=0
This function is called To retrieve the base platforms of the authoring tool.
virtual bool Save(IXmlTextWriter *in_pWriter)=0
virtual BasePlatformID GetCurrentBasePlatform()=0
virtual void NotifyInnerObjectPropertyChanged(IPluginPropertySet *in_pPSet, const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)=0
virtual bool SetValue(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName, const VARIANT &in_varProperty)=0
virtual unsigned int GetConvertedDirectory(LPWSTR out_pszDirectory, unsigned int in_uiBufferSize, const GUID &in_guidPlatform) const =0
virtual bool GetPluginData(const GUID &in_guidPlatform, AkPluginParamID in_idParam, IWriteData *in_pDataWriter) const
Definition: AudioPlugin.h:636
virtual bool GetDialog(eDialog in_eDialog, UINT &out_uiDialogID, PopulateTableItem *&out_pTable) const
Definition: AudioPlugin.h:646
AKRESULT
Standard function call result.
Definition: AkTypes.h:126
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:79
virtual unsigned int GetListCount() const =0
Audiokinetic namespace.
AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList
Definition: IAkPlugin.h:81
The operation failed.
Definition: AkTypes.h:130
virtual void SetPluginObjectMedia(IPluginObjectMedia *in_pObjectMedia)
Definition: AudioPlugin.h:623
virtual bool CopyInto(IAudioPlugin *io_pWObject) const
Definition: AudioPlugin.h:629
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 bool Load(IXmlTextReader *in_pReader)
Definition: AudioPlugin.h:627
virtual unsigned int GetMediaSourceConvertedFilePath(LPWSTR out_pszFileName, unsigned int in_uiBufferSize, const GUID &in_guidPlatform, unsigned int in_Index=0) const =0
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 NotifyPropertyChanged(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)
Definition: AudioPlugin.h:631
#define AKASSERT(Condition)
Definition: AkAssert.h:69
virtual void NotifyCurrentPlatformChanged(const GUID &in_guidCurrentPlatform)=0
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const
Definition: AudioPlugin.h:644
virtual void NotifyInnerObjectAddedRemoved(IPluginPropertySet *in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation)
Definition: AudioPlugin.h:633
A license is found and is valid.
Definition: Utilities.h:109
virtual bool Help(HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode) const
Definition: AudioPlugin.h:640
virtual bool WindowProc(eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT &out_lResult)=0
virtual ULONG GetCurrentConversionSettingsHash(const GUID &in_guidPlatform, AkUInt32 in_uSampleRate=0, AkUInt32 in_uBlockLength=0)=0
virtual bool CanLogUndos()=0
virtual void NotifyPropertyChanged(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)=0
virtual bool IsPlayable() const =0
virtual IPluginMediaConverter * GetPluginMediaConverterInterface()=0
virtual bool Load(IXmlTextReader *in_pReader)=0
virtual HINSTANCE GetResourceHandle() const =0
virtual bool GetBankParameters(const GUID &in_guidPlatform, IWriteData *in_pDataWriter) const =0
LicenseStatus
License status.
Definition: Utilities.h:105
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const =0
virtual void DeleteObject(IPluginPropertySet *in_pPropertySet)=0
virtual void InsertObject(LPCWSTR in_pszListName, unsigned int in_uiIndex, IPluginPropertySet *in_pPropertySet)=0
virtual unsigned int GetMediaSourceFileName(LPWSTR out_pszFileName, unsigned int in_uiBufferSize, unsigned int in_Index=0) const =0
virtual unsigned int GetMediaSourceCount() const =0
virtual unsigned int GetListName(unsigned int in_uiListIndex, LPWSTR out_pszListName, unsigned int in_uiBufferSize) const =0
virtual bool Save(IXmlTextWriter *in_pWriter)
Definition: AudioPlugin.h:628
virtual bool CopyInto(IAudioPlugin *io_pWObject) const =0
virtual void SetPluginPropertySet(IPluginPropertySet *in_pPSet)=0
virtual void Delete()=0
virtual bool WindowProc(eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT &out_lResult)
Definition: AudioPlugin.h:637
virtual void NotifyPluginMediaChanged()=0
virtual void NotifyCurrentPlatformChanged(const GUID &in_guidCurrentPlatform)
Definition: AudioPlugin.h:630
virtual bool Help(HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode) const =0
virtual void RemoveMediaSource(unsigned int in_Index=0)=0
Requests to remove the specified index file s a data input file.
AKRESULT(CALLBACK * RegisterWwisePluginFn)(AK::PluginRegistration *in_pList)
Definition: AudioPlugin.h:649
#define NULL
Definition: AkTypes.h:49
virtual AK::Wwise::IUndoManager * GetUndoManager()=0
virtual bool GetDialog(eDialog in_eDialog, UINT &out_uiDialogID, PopulateTableItem *&out_pTable) const =0
ConversionResult
Conversion error code.
Definition: Utilities.h:218
virtual void NotifyMonitorData(const MonitorData *in_pDataArray, unsigned int in_uCount, bool in_bNeedsByteSwap, bool in_bRealtime)=0
AkUInt32 idDevice
Display name of the device. Null terminated. Note that the name can't be more than 256 characters inc...
Definition: AudioPlugin.h:674
virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &, AK::Wwise::Severity &, LPWSTR, unsigned int in_uiBufferSize)
Definition: AudioPlugin.h:643
virtual GUID GetCurrentPlatform()=0
virtual void SetPluginObjectMedia(IPluginObjectMedia *in_pObjectMedia)=0
virtual void NotifyInnerObjectAddedRemoved(IPluginPropertySet *in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation)=0
virtual void InitToDefault()=0
#define AK_MAX_OUTPUTDEVICEDESCRIPTOR
Struct to be used with the function GetSinkPluginDevices to return devices.
Definition: AudioPlugin.h:670
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
virtual unsigned int GetMediaSourceOriginalFilePath(LPWSTR out_pszFileName, unsigned int in_uiBufferSize, unsigned int in_Index=0) const =0
virtual bool GetBankParameters(const GUID &in_guidPlatform, IWriteData *in_pDataWriter) const
Definition: AudioPlugin.h:635
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
virtual unsigned int GetObjectCount(LPCWSTR in_pszListName) const =0
LicenseType
License type.
Definition: Utilities.h:97
virtual bool RemoveObject(IPluginPropertySet *in_pPropertySet)=0
virtual IPluginMediaConverter * GetPluginMediaConverterInterface()
Definition: AudioPlugin.h:642
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:622
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:78
virtual void SetPluginPropertySet(IPluginPropertySet *in_pPSet)
Definition: AudioPlugin.h:621
virtual void InvalidateMediaSource(unsigned int in_Index=0)=0
Request Wwise to perform any required conversion on the data.
virtual bool DisplayNamesForPropValues(LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount) const
Definition: AudioPlugin.h:639
virtual bool GetPluginData(const GUID &in_guidPlatform, AkPluginParamID in_idParam, IWriteData *in_pDataWriter) const =0
virtual bool GetValue(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName, VARIANT &out_varProperty)=0
virtual IPluginPropertySet * CreateObject(LPCWSTR in_pszType)=0
virtual bool DisplayNameForProp(LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount) const
Definition: AudioPlugin.h:638
virtual bool DisplayNameForProp(LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount) const =0
NotifyInnerObjectOperation
Type of operation for the NotifyInnerObjectAddedRemoved function.
Definition: AudioPlugin.h:340
virtual void NotifyInnerObjectPropertyChanged(IPluginPropertySet *in_pPSet, const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)
Definition: AudioPlugin.h:632
virtual void SetPluginObjectStore(IPluginObjectStore *in_pObjectStore)=0
Severity
Log message severity.
Definition: Utilities.h:115
virtual unsigned int GetOriginalDirectory(LPWSTR out_pszDirectory, unsigned int in_uiBufferSize) const =0
Use this base class to quickly implement most plugin functions empty.
Definition: AudioPlugin.h:618
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...