版本

menu_open
Wwise SDK 2023.1.7
PluginInfoGeneratorPriv.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 #pragma once
27 
28 #include "PluginInfoGenerator.h"
29 
30 #ifdef __cplusplus
31 
32 namespace AK::Wwise::Plugin::V1
33 {
34  /**
35  * \brief Assign arguments for the FrontendModel service request
36  * \param[in,out] io_pluginInfo PluginInfo structure to assign the argument instance to
37  * \param[in] in_args Pointer to a global argument structure for HostFrontendModel
38  * \sa
39  * - AK::Wwise::Plugin::FrontendModel
40  */
42  AK::Wwise::Plugin::PluginInfo& io_pluginInfo,
44  {
45  for (size_t i = 0; i < io_pluginInfo.m_arraySize; ++i)
46  {
47  if (auto& intf = io_pluginInfo.m_interfaces[i];
49  intf.m_interface->m_version == 1)
50  {
51  intf.m_instance = in_args;
52  break;
53  }
54  }
55  }
56 } // of namespace AK::Wwise::Plugin
57 
58 /**
59  * \brief (C++) Adds a Wwise Authoring frontend plug-in and a Sound Engine plug-in to a plug-in container.
60  *
61  * Creates a custom namespace with custom plug-in info, that contains the generated plug-in info structure. Then,
62  * statically points it to the next pointer for the container.
63  *
64  * This uses the Sound Engine part to retrieve the plug-in information (Company id, Plug-in ID and Plug-in Type). It
65  * also adds up the Sound Engine's registration structure, so the host can initialize this part on first instantiation.
66  *
67  * This uses the Frontend Model to build and manage the lifetime of the plug-in frontend's widgets.
68  *
69  * \param ContainerName Container name.
70  * \param WwiseClassName Class name of the plug-in to add to the container.
71  * \param AudioEngineRegisteredName Sound Engine's class name.
72  * \param TemplateName Frontend Model's template name of the plug-in.
73  *
74  */
75 #define AK_ADD_FRONTEND_PLUGIN_CLASS_TO_CONTAINER(ContainerName, WwiseClassName, AudioEngineRegisteredName, TemplateName) \
76  extern AK::PluginRegistration AudioEngineRegisteredName ## Registration; \
77  namespace { namespace AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME { \
78  static struct UserGeneratedPluginInfo : private AK::Wwise::Plugin::PluginInfoGenerator<WwiseClassName> \
79  { \
80  ak_wwise_plugin_host_frontend_model_args_v1 frontend_args; \
81  UserGeneratedPluginInfo() : \
82  PluginInfoGenerator(&AudioEngineRegisteredName ## Registration) \
83  { \
84  m_pluginInfo.m_next = GetPluginContainer ## ContainerName()->m_pluginInfos; \
85  frontend_args.templateName = TemplateName; \
86  AK::Wwise::Plugin::V1::AssignFrontendModelArgs(m_pluginInfo, &frontend_args); \
87  GetPluginContainer ## ContainerName()->m_pluginInfos = &m_pluginInfo; \
88  } \
89  } g_singleton; \
90  } }
91 
92 /**
93  * \brief (C++) Adds a Wwise Authoring frontend plug-in to a plug-in container.
94  *
95  * Creates a custom namespace with custom plug-in info, that contains the generated plug-in info structure. Then,
96  * statically points it to the next pointer for the container.
97  *
98  * \param ContainerName Container name.
99  * \param WwiseClassName Class name of the plug-in to add to the container.
100  * \param CompanyID Plug-in vendor's Company ID, as provided by Audiokinetic.
101  * \param PluginID Plug-in ID, as provided by Audiokinetic.
102  * \param Type Plug-in type.
103  * \param TemplateName Frontend Model's template name of the plug-in.
104  *
105  * This uses the Frontend Model to build and manage the lifetime of the plug-in frontend's widgets.
106  */
107 #define AK_ADD_FRONTEND_PLUGIN_CLASSID_TO_CONTAINER(ContainerName, WwiseClassName, CompanyID, PluginID, Type, TemplateName) \
108  namespace { namespace AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME { \
109  static struct UserGeneratedPluginInfo : private AK::Wwise::Plugin::PluginInfoGenerator<WwiseClassName> \
110  { \
111  const AkUInt32 m_companyID = CompanyID; \
112  const AkUInt32 m_pluginID = PluginID; \
113  const AkPluginType m_type = Type; \
114  ak_wwise_plugin_host_frontend_model_args_v1 frontend_args; \
115  UserGeneratedPluginInfo() : \
116  PluginInfoGenerator(&m_companyID, &m_pluginID, &m_type) \
117  { \
118  m_pluginInfo.m_next = GetPluginContainer ## ContainerName()->m_pluginInfos; \
119  frontend_args.templateName = TemplateName; \
120  AK::Wwise::Plugin::V1::AssignFrontendModelArgs(m_pluginInfo, &frontend_args); \
121  GetPluginContainer ## ContainerName()->m_pluginInfos = &m_pluginInfo; \
122  } \
123  } g_singleton; \
124  } }
125 
126 #endif // __cplusplus
Wwise Authoring Plug-ins - C++ class helper to automatically determine the plug-in interfaces used in...
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_HOST_FRONTEND_MODEL
void AssignFrontendModelArgs(AK::Wwise::Plugin::PluginInfo &io_pluginInfo, ak_wwise_plugin_host_frontend_model_args_v1 *in_args)
Assign arguments for the FrontendModel service request
struct ak_wwise_plugin_interface_array_item * m_interfaces
Definition: PluginInfo.h:57
ak_wwise_plugin_interface_ptr m_interface
The interface. Should be identical for every instance of this DLL.

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅