버전

menu_open
Wwise SDK 2022.1.18
AudioPlugin.h
이 파일의 문서화 페이지로 가기
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  /// \sa
327  /// - \ref effectpluginwwise
329  : public IPluginBase
330  {
331  public:
332  /// Dialog type. Source plug-ins can be edited in the Property Editor or
333  /// the Contents Editor, while effect plug-ins can only be edited in the
334  /// Effect Editor.
335  /// \sa
336  /// - \ref wwiseplugin_dialogcode
337  enum eDialog
338  {
339  SettingsDialog, ///< Main plug-in dialog. This is the dialog used in the Property
340  ///< Editor for source plug-ins, and in the Effect Editor for
341  ///< effect plug-ins.
342  ContentsEditorDialog ///< Contents Editor dialog. This is the small dialog used in the
343  ///< Contents Editor for source plug-ins.
344  };
345 
346  /// Type of operation for the NotifyInnerObjectAddedRemoved function.
348  {
351  };
352 
353  struct MonitorData
354  {
356  void* pData;
357  unsigned int uDataSize;
358  };
359 
360  /// The property set interface is given to the plug-in through this method. It is called by Wwise during
361  /// initialization of the plug-in, before most other calls.
362  /// \warning This function is guaranteed to be called by a single thread at a time.
363  /// \sa
364  /// - \ref wwiseplugin_propertyset
365  virtual void SetPluginPropertySet(
366  IPluginPropertySet * in_pPSet ///< A pointer to the property set interface
367  ) = 0;
368 
369  /// The plugin object store interface is given to the plug-in through this method.
370  /// It is called by Wwise during initialization of the plug-in, before most other calls.
371  /// Use this interface to manage plugin inner objects.
372  /// \warning This function is guaranteed to be called by a single thread at a time.
373  /// \sa
374  /// - \ref wwiseplugin_objectstore
375  virtual void SetPluginObjectStore(
376  IPluginObjectStore * in_pObjectStore ///< A pointer to the plugin object store
377  ) = 0;
378 
379  /// The plugin object data file interface is given to the plug-in through this method.
380  /// Set plugin object media, that allows to create and manage media files
381  /// Use this interface to manage plugin media objects.
382  ///
383  /// NOTE: If the plug-in does not handle plugin media, this function should be
384  /// implemented as a void function by the plug-in.
385  ///
386  /// \warning This function is guaranteed to be called by a single thread at a time.
387  /// \sa
388  /// - \ref effectplugin_media
389  virtual void SetPluginObjectMedia(
390  IPluginObjectMedia * in_pObjectMedia
391  ) = 0;
392 
393  /// This function is called by Wwise to determine if the plug-in is in a playable state.
394  /// \warning This function is guaranteed to be called by a single thread at a time.
395  /// \return True if the plug-in is in a playable state, False otherwise
396  virtual bool IsPlayable() const = 0;
397 
398  /// Initialize custom data to default values. This is called by Wwise after SetPluginPropertySet()
399  /// when creating a new instance of the plug-in (i.e. not during a load). The properties on the
400  /// PropertySet do not need to be initialized in this method.
401  /// \warning This function is guaranteed to be called by a single thread at a time.
402  virtual void InitToDefault() = 0;
403 
404  /// Delete function called when the user press "delete" button on a plugin. This entry point must
405  /// set the undo/redo action properly.
406  /// \warning This function is guaranteed to be called by a single thread at a time.
407  virtual void Delete() = 0;
408 
409  /// Load file
410  /// \return \b true if load succeeded.
411  virtual bool Load( AK::IXmlTextReader* in_pReader ) = 0;
412 
413  /// Save file
414  /// \return \b true if save succeeded.
415  virtual bool Save( AK::IXmlTextWriter* in_pWriter ) = 0;
416 
417  /// Copy the plugin's custom data into another instance of the same plugin. This is used
418  /// during copy/paste and delete. The properties on the PropertySet do not need to
419  /// be copied in this method.
420  /// \warning This function is guaranteed to be called by a single thread at a time.
421  virtual bool CopyInto(
422  IAudioPlugin* io_pWObject // The object that will receive the custom data of this object.
423  ) const = 0;
424 
425  /// This function is called by Wwise when the current platform changes.
426  /// \warning This function is guaranteed to be called by a single thread at a time.
427  /// \sa
428  /// - \ref wwiseplugin_platformchange
430  const GUID & in_guidCurrentPlatform ///< The unique ID of the new platform
431  ) = 0;
432 
433  /// This function is called by Wwise when a plug-in property changes (for example,
434  /// through interaction with a UI control bound to a property, or through undo/redo operations).
435  /// This function is also called during undo or redo operations
436  /// \warning This function is guaranteed to be called by a single thread at a time.
437  virtual void NotifyPropertyChanged(
438  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
439  LPCWSTR in_pszPropertyName ///< The name of the property
440  ) = 0;
441 
442  /// This function is called by Wwise when a inner object property changes (for example,
443  /// through interaction with a UI control bound to a property, or through undo/redo operations).
444  /// See the Plugin Object Store for more information about inner objects.
445  /// This function is also called during undo or redo operations
446  /// \warning This function is guaranteed to be called by a single thread at a time.
448  IPluginPropertySet* in_pPSet, ///< The inner object that changed
449  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
450  LPCWSTR in_pszPropertyName ///< The name of the property
451  ) = 0;
452 
453  /// This function is called by Wwise when a inner object property changes (for example,
454  /// through interaction with a UI control bound to a property, or through undo/redo operations).
455  /// See the Plugin Object Store for more information about inner objects.
456  /// \warning This function is guaranteed to be called by a single thread at a time.
458  IPluginPropertySet* in_pPSet, ///< The inner object that was added or removed
459  unsigned int in_uiIndex, ///< The insertion/removal index
460  NotifyInnerObjectOperation in_eOperation ///< InnerObjectAdded or InnerObjectRemoved
461  ) = 0;
462 
463  /// This function is called by Wwise when a the plugin media changes.
464  /// It is called when plugin media is added, removed or changes.
465  /// This function is also called during undo or redo operations
466  /// Use AK::Wwise::IAudioPlugin::SetPluginObjectMedia and AK::Wwise::IPluginObjectMedia to
467  /// set plugin media.
468  /// \warning This function is guaranteed to be called by a single thread at a time.
469  virtual void NotifyPluginMediaChanged() = 0;
470 
471  /// This function is called by Wwise to obtain parameters that will be written to a bank.
472  /// Because these can be changed at run-time, the parameter block should stay relatively small.
473  /// Larger data should be put in the Data Block.
474  /// \warning This function is guaranteed to be called by a single thread at a time.
475  /// \return True if the plug-in put some parameters in the bank, False otherwise
476  /// \sa
477  /// - \ref wwiseplugin_bank
478  /// - \ref wwiseplugin_propertyset
479  virtual bool GetBankParameters(
480  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
481  IWriteData* in_pDataWriter ///< A pointer to the data writer interface
482  ) const = 0;
483 
484  /// This function is called by Wwise to obtain parameters that will be sent to the
485  /// sound engine when Wwise is connected. This block should contain only data
486  /// that is NOT a property defined in the plugin xml file. The parameter ID
487  /// should be something different than the ones used in the plugin xml.
488  /// \warning This function is guaranteed to be called by a single thread at a time.
489  /// \return True if the plug-in has some plugin-defined data. False otherwise.
490  /// \sa
491  /// - AK::Wwise::IPluginPropertySet::NotifyInternalDataChanged
492  /// - AK::IAkPluginParam::ALL_PLUGIN_DATA_ID
493  /// - AK::IAkPluginParam::SetParam
494  virtual bool GetPluginData(
495  const GUID & in_guidPlatform, ///< The unique ID of the queried platform
496  AkPluginParamID in_idParam, ///< The plugin-defined parameter ID
497  IWriteData* in_pDataWriter ///< A pointer to the data writer interface
498  ) const = 0;
499 
500  /// This function is called by Wwise to get the plug-in's HINSTANCE used for loading resources.
501  /// \warning This function is guaranteed to be called by a single thread at a time.
502  /// \return A handle to the instance of the plug-in DLL
503  /// \sa
504  /// - \ref wwiseplugin_dialogcode
505  virtual HINSTANCE GetResourceHandle() const = 0;
506 
507  /// This function is called by Wwise to get the plug-in dialog parameters.
508  /// \warning This function is guaranteed to be called by a single thread at a time.
509  /// \return True if a dialog was returned, False otherwise
510  /// \sa
511  /// - \ref wwiseplugin_dialogcode
512  /// - \ref wwiseplugin_dialog_guide
513  virtual bool GetDialog(
514  eDialog in_eDialog, ///< The dialog type
515  UINT & out_uiDialogID, ///< The returned resource ID of the dialog
516  PopulateTableItem *& out_pTable ///< The returned table of property-control bindings (can be NULL)
517  ) const = 0;
518 
519  /// Window message handler for dialogs. This is very similar to a standard WIN32 window procedure.
520  /// \warning This function is guaranteed to be called by a single thread at a time.
521  /// \return True if the message has been processed by the plug-in, False otherwise
522  /// \sa
523  /// - \ref wwiseplugin_dialogcode
524  virtual bool WindowProc(
525  eDialog in_eDialog, ///< The dialog type
526  HWND in_hWnd, ///< The window handle of the dialog
527  UINT in_message, ///< The incoming message. This is a standard Windows message ID (ex. WM_PAINT).
528  WPARAM in_wParam, ///< The WPARAM of the message (see MSDN)
529  LPARAM in_lParam, ///< The LPARAM of the message (see MSDN)
530  LRESULT & out_lResult ///< The returned value if the message has been processed (it is only considered if the method also returns True)
531  ) = 0;
532 
533  /// DEPRECATED: This function is called by Wwise to get the user-friendly name of the specified property.
534  /// This function should write the user-friendly name of
535  /// the specified property to the WCHAR buffer out_pszDisplayName,
536  /// which is of length in_unCharCount.
537  /// \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.
538  /// \warning This function is guaranteed to be called by a single thread at a time.
539  /// \return True if the property has a user-friendly name, False otherwise
540  /// \sa
541  /// - \ref wwiseplugin_displaynames
542  virtual bool DisplayNameForProp(
543  LPCWSTR in_pszPropertyName, ///< The internal name of the property
544  LPWSTR out_pszDisplayName, ///< The returned user-friendly name
545  UINT in_unCharCount ///< The number of WCHAR in the buffer, including the terminating NULL
546  ) const = 0;
547 
548  /// DEPRECATED: This function is called by Wwise to get the user-friendly names of possible values for the
549  /// specified property.
550  /// This function should write pairs of value and text for the specified property to
551  /// the WCHAR buffer out_pszDisplayName, which is of length in_unCharCount.
552  /// Pairs are separated by commas, and each pair contains the value and the
553  /// text, separated by a colon. Here are a few examples:
554  /// - Numeric property: "-100:Left,0:Center,100:Right"
555  /// - Boolean property: "0:Off,1:On"
556  /// - 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"
557  ///
558  /// \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.
559  /// \warning This function is guaranteed to be called by a single thread at a time.
560  /// \return True if the property has user-friendly names for some values, False otherwise
561  /// \sa
562  /// - \ref wwiseplugin_displaynames
564  LPCWSTR in_pszPropertyName, ///< The internal name of the property
565  LPWSTR out_pszValuesName, ///< The returned property value names
566  UINT in_unCharCount ///< The number of WCHAR in the buffer, including the terminating NULL character
567  ) const = 0;
568 
569  /// Called when the user clicks on the '?' icon.
570  /// \warning This function is guaranteed to be called by a single thread at a time.
571  /// \return True if the plug-in handled the help request, false otherwise
572  /// \sa
573  /// - \ref wwiseplugin_help
574  virtual bool Help(
575  HWND in_hWnd, ///< The handle of the dialog
576  eDialog in_eDialog, ///< The dialog type
577  LPCWSTR in_szLanguageCode ///< The language code in ISO639-1
578  ) const = 0;
579 
580  /// Called when an instance of the run-time component of the plug-in sends data
581  /// using \c AK::IAkEffectPluginContext::PostMonitorData(), and this plug-in's settings
582  /// are being displayed in a window. Because multiple run-time instances may exist for a single
583  /// authoring tool plug-in, the data is batched together and passed at the end of the frame.
584  /// Define the CanSendMonitorData element to true in the plug-in XML to activate the monitoring user interface.
585  virtual void NotifyMonitorData(
586  AkTimeMs in_iTimeStamp, ///< Timestamp of the data (in milliseconds)
587  const MonitorData * in_pDataArray, ///< Array of blobs of data
588  unsigned int in_uCount, ///< Number of elements in array 'in_pDataArray'
589  bool in_bNeedsByteSwap, ///< True if data comes from platform with a different byte ordering (i.e. Big Endian)
590  bool in_bRealtime ///< True if monitoring in real-time, false if scrubbing through profiler history
591  ) = 0;
592 
593  /// Retrieve a pointer to the class implementing IPluginObjectMedia. Plug-ins using the media sources
594  /// functionality can simply return a pointer to themselves while other not using the functionality should return NULL
596 
597  /// Retrieve the licensing status of the plug-in for the given platform.
598  /// \return Licensing status of the plug-in; LicenseStatus_Unlicensed or LicenseStatus_Expired will prevent the plug-in from being included in a SoundBank.
599  /// \sa
600  /// - \ref IPluginPropertySet::GetLicenseStatus
601  /// - \ref IPluginPropertySet::GetAssetLicenseStatus
602  /// - \ref wwiseplugin_dll_license
604  const GUID & in_guidPlatform, ///< GUID of the platform
605  AK::Wwise::Severity& out_eSeverity, ///< (Optional) If set, the string placed in out_pszMessage will be shown in the log with the corresponding severity.
606  LPWSTR out_pszMessage, ///< Pointer to the buffer that will hold the message string
607  unsigned int in_uiBufferSize ///< Size of the buffer pointed by out_pszMessage (in number of WCHAR, including null terminator)
608  ) = 0;
609 
610  /// Return the minimum and maximum duration, in seconds. This function is only useful with source plug-ins.
611  /// \return True if the duration values are valid, False otherwise.
612  virtual bool GetSourceDuration(
613  double& out_dblMinDuration, ///< Minimum duration, in seconds
614  double& out_dblMaxDuration ///< Maximum duration, in seconds
615  ) const = 0;
616  };
617 
618  /// Use this base class to quickly implement most plugin functions empty
620  {
621  public:
622  virtual void SetPluginPropertySet( IPluginPropertySet * in_pPSet ){}
623  virtual void SetPluginObjectStore( IPluginObjectStore * in_pObjectStore ){}
624  virtual void SetPluginObjectMedia( IPluginObjectMedia * in_pObjectMedia ){}
625  virtual bool IsPlayable() const { return true; }
626  virtual void InitToDefault() {}
627  virtual void Delete() {}
628  virtual bool Load( AK::IXmlTextReader* in_pReader ) { return false; }
629  virtual bool Save( AK::IXmlTextWriter* in_pWriter ) { return false; }
630  virtual bool CopyInto( IAudioPlugin* io_pWObject ) const { return true; }
631  virtual void NotifyCurrentPlatformChanged( const GUID & in_guidCurrentPlatform ) {}
632  virtual void NotifyPropertyChanged( const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
633  virtual void NotifyInnerObjectPropertyChanged( IPluginPropertySet* in_pPSet, const GUID & in_guidPlatform, LPCWSTR in_pszPropertyName ) {}
634  virtual void NotifyInnerObjectAddedRemoved( IPluginPropertySet* in_pPSet, unsigned int in_uiIndex, NotifyInnerObjectOperation in_eOperation ) {}
635  virtual void NotifyPluginMediaChanged() {}
636  virtual bool GetBankParameters( const GUID & in_guidPlatform, IWriteData* in_pDataWriter ) const { return false; }
637  virtual bool GetPluginData( const GUID & in_guidPlatform, AkPluginParamID in_idParam, IWriteData* in_pDataWriter ) const { return false; }
638  virtual bool WindowProc( eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT & out_lResult ){ return false; }
639  virtual bool DisplayNameForProp( LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount ) const { return false; }
640  virtual bool DisplayNamesForPropValues( LPCWSTR in_pszPropertyName, LPWSTR out_pszValuesName, UINT in_unCharCount ) const { return false; }
641  virtual bool Help( HWND in_hWnd, eDialog in_eDialog, LPCWSTR in_szLanguageCode ) const { return false; }
642  virtual void NotifyMonitorData( AkTimeMs in_iTimeStamp, const AK::Wwise::IAudioPlugin::MonitorData * in_pData, unsigned int in_uDataSize, bool in_bNeedsByteSwap, bool in_bRealtime){}
644  virtual AK::Wwise::LicenseStatus GetLicenseStatus(const GUID &, AK::Wwise::Severity&, LPWSTR, unsigned int in_uiBufferSize){ return AK::Wwise::LicenseStatus_Valid; }
645  virtual bool GetSourceDuration( double& out_dblMinDuration, double& out_dblMaxDuration ) const { out_dblMinDuration = 0.f; out_dblMaxDuration = FLT_MAX; return false; }
646  virtual HINSTANCE GetResourceHandle() const { return NULL; }
647  virtual bool GetDialog(eDialog in_eDialog, UINT& out_uiDialogID, PopulateTableItem*& out_pTable) const { return false; }
648  };
649 
650  #ifdef AK_WIN
653  {
654  if (!g_pAKPluginList)
655  {
656  AKASSERT(!"g_pAKPluginList is NULL. Did you use the AK_STATIC_LINK_PLUGIN macro in your DLL?"); // Should be populated by now.
657  return AK_Fail;
658  }
659 
660  HMODULE hLib = ::LoadLibrary(L"WwiseSoundEngine.dll");
661  if (hLib == NULL)
662  return AK_Fail;
663 
664  RegisterWwisePluginFn pReg = (RegisterWwisePluginFn)::GetProcAddress(hLib, "RegisterWwisePlugin20192");
665  if (pReg == NULL)
666  return AK_Fail;
667 
668  return pReg(g_pAKPluginList);
669  }
670  #endif
671 
672  /// Struct to be used with the function GetSinkPluginDevices to return devices.
673 #define AK_MAX_OUTPUTDEVICEDESCRIPTOR 256
675  {
676  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.
677  AkUInt32 idDevice; /// ID of the device as used with AK::SoundEngine::AddOutput.
678  /// This will be passed back to the plugin through AK::IAkSinkPluginContext::GetOutputID.
679  /// Default device ID can be 0.
680  };
681  }
682 }
683 
684 /// Private message sent to Wwise window to open a topic in the help file
685 /// the WPARAM defines the help topic ID
686 #ifndef WM_AK_PRIVATE_SHOW_HELP_TOPIC
687 #define WM_AK_PRIVATE_SHOW_HELP_TOPIC 0x4981
688 #endif
689 
690 #endif // _AK_WWISE_AUDIOPLUGIN_H
virtual bool Load(AK::IXmlTextReader *in_pReader)
Definition: AudioPlugin.h:628
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:642
virtual bool WindowProc(eDialog in_eDialog, HWND in_hWnd, UINT in_message, WPARAM in_wParam, LPARAM in_lParam, LRESULT &out_lResult)
Definition: AudioPlugin.h:638
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:124
Audiokinetic namespace
@ AK_Fail
The operation failed.
Definition: AkTypes.h:202
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:652
AK_DLLEXPORT AK::PluginRegistration * g_pAKPluginList
Definition: IAkPlugin.h:89
virtual IPluginMediaConverter * GetPluginMediaConverterInterface()
Definition: AudioPlugin.h:643
virtual ULONG GetCurrentConversionSettingsHash(const GUID &in_guidPlatform, AkUInt32 in_uSampleRate=0, AkUInt32 in_uBlockLength=0)=0
virtual HINSTANCE GetResourceHandle() const
Definition: AudioPlugin.h:646
virtual bool GetBankParameters(const GUID &in_guidPlatform, IWriteData *in_pDataWriter) const
Definition: AudioPlugin.h:636
AKRESULT
Standard function call result.
Definition: AkTypes.h:199
virtual bool DisplayNameForProp(LPCWSTR in_pszPropertyName, LPWSTR out_pszDisplayName, UINT in_unCharCount) const
Definition: AudioPlugin.h:639
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:644
AkUInt32 idDevice
Display name of the device. Null terminated. Note that the name can't be more than 256 characters inc...
Definition: AudioPlugin.h:677
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:620
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:348
AKRESULT(CALLBACK * RegisterWwisePluginFn)(AK::PluginRegistration *in_pList)
Definition: AudioPlugin.h:651
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:622
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:676
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:640
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:623
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:641
LicenseStatus
License status.
Definition: Utilities.h:93
virtual bool GetSourceDuration(double &out_dblMinDuration, double &out_dblMaxDuration) const
Definition: AudioPlugin.h:645
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:634
virtual bool CopyInto(IAudioPlugin *io_pWObject) const
Definition: AudioPlugin.h:630
virtual bool Save(AK::IXmlTextWriter *in_pWriter)
Definition: AudioPlugin.h:629
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:673
virtual void NotifyPropertyChanged(const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)
Definition: AudioPlugin.h:632
uint32_t AkUInt32
Unsigned 32-bit integer
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID
Definition: AkTypes.h:134
virtual void NotifyInnerObjectPropertyChanged(IPluginPropertySet *in_pPSet, const GUID &in_guidPlatform, LPCWSTR in_pszPropertyName)
Definition: AudioPlugin.h:633
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:637
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:647
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:624
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:631
virtual void NotifyMonitorData(AkTimeMs in_iTimeStamp, const MonitorData *in_pDataArray, unsigned int in_uCount, bool in_bNeedsByteSwap, bool in_bRealtime)=0

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요