版本

menu_open
Wwise SDK 2024.1.0
Host.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 /**
28  * \brief Wwise Authoring Plug-ins - API to request host's current state and services.
29  * \file AK/Wwise/Plugin/Host.h
30  */
31 
32 #pragma once
33 
34 #include "./V1/Host.h"
35 #include "PlatformID.h"
36 #include "PluginInfoGenerator.h"
37 
38 /**
39  * \brief API to request host's current state and services.
40  *
41  * If requested, this contains information on the current state of the host as well as generic operations.
42  *
43  * For example, the currently selected platform, tools to post
44  * when internal plug-in data changed, or a way to make Waapi calls.
45  *
46  * In order to be reactive to host's state, you should consider implementing ak_wwise_plugin_notifications_host_v1
47  * notifications.
48  */
50 #ifdef __cplusplus
51  : public ak_wwise_plugin_host_v1
52 #endif
53 {
54 #ifndef __cplusplus
55  ak_wwise_plugin_host_v1 m_host_v1;
56 #else
57  /// Base host-provided instance type.
58  using Instance = ak_wwise_plugin_host_instance_v2;
60  ak_wwise_plugin_host_v1(/*in_version = */ 2)
61  {
62  }
63 #endif
64 
65  /**
66  * \brief Obtain the project license ID
67  *
68  * This ID is composed of 8 characters and is used to identify a project
69  * with Audiokinetic. You may use this ID as a key to identify a given
70  * project when implementing a custom licensing scheme.
71  *
72  * \param[in] in_this Current instance of this interface.
73  * \return An instance of LicenseID filled with the project license ID, or
74  * zeroed-out if the project has no license.
75  */
77 };
78 
79 #define AK_WWISE_PLUGIN_HOST_V2_ID() \
80  AK_WWISE_PLUGIN_BASE_INTERFACE_FROM_ID(AK_WWISE_PLUGIN_INTERFACE_TYPE_HOST, 2)
81 #define AK_WWISE_PLUGIN_HOST_V2_CTOR() \
82 { \
83  .m_host_v1.m_baseInterface = AK_WWISE_PLUGIN_HOST_V2_ID() \
84 }
85 
86 #ifdef __cplusplus
87 namespace AK::Wwise::Plugin
88 {
89  namespace V2
90  {
92 
93  /// \copydoc ak_wwise_plugin_host_v2
94  class Host : public AK::Wwise::Plugin::V1::HostBase<CHost, 2>
95  {
96  public:
97  using Interface = CHost;
99 
100  /**
101  * \brief Obtain the project license ID
102  *
103  * This ID is composed of 8 characters and is used to identify a project
104  * with Audiokinetic. You may use this ID as a key to identify a given
105  * project when implementing a custom licensing scheme.
106  *
107  * \param[in] in_this Current instance of this interface.
108  * \return An instance of LicenseID filled with the project license ID, or
109  * zeroed-out if the project has no license.
110  */
112  {
113  return g_cinterface->GetProjectLicenseID(g_cinterface);
114  }
115 
116  #if defined( DOXYGEN_INCLUDE )
117  GUID GetCurrentPlatform() const;
121  void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty);
123  const GUID& in_guidPlatform,
124  LicenseType& out_eType,
125  LicenseStatus& out_eStatus,
126  uint32_t& out_uDaysToExpiry
127  ) const;
129  const GUID& in_guidPlatform,
130  AkUInt32 in_uAssetID,
131  LicenseType& out_eType,
132  LicenseStatus& out_eStatus,
133  uint32_t& out_uDaysToExpiry
134  ) const;
135  void WaapiCall(
136  const char* in_szUri,
137  const char* in_szArgs,
138  const char* in_szOptions,
139  AK::IAkPluginMemAlloc& in_alloc,
140  char*& out_szResults,
141  char*& out_szError
142  ) const;
143  #endif
144  };
145 
146  /**
147  * \brief Requests a Host interface, provided as m_host variable.
148  *
149  * Deriving your plug-in class from RequestHost will automatically request both Host and
150  * Notifications::Host_ interfaces. From this point, you will be able to derive from the virtual
151  * functions as defined in Notifications::Host_, and access the host-provided functions in the
152  * \c m_host variable.
153  */
155 
156  } // of namespace V2
157 
158  /// Latest version of the C Host interface.
159  using CHost = V2::CHost;
160  /// Latest version of the C++ Host interface.
161  using Host = V2::Host;
162  /// Latest version of the requested C++ Host interface.
164 
168 } // of namespace AK::Wwise::Plugin
169 
170 #endif
void GetLicenseStatus(const GUID &in_guidPlatform, LicenseType &out_eType, LicenseStatus &out_eStatus, uint32_t &out_uDaysToExpiry) const
LicenseID GetProjectLicenseID() const
Obtain the project license ID
Definition: Host.h:111
void WaapiCall(const char *in_szUri, const char *in_szArgs, const char *in_szOptions, AK::IAkPluginMemAlloc &in_alloc, char *&out_szResults, char *&out_szError) const
RequestedHostInterface< Host > RequestHost
Requests a Host interface, provided as m_host variable.
Definition: Host.h:154
AK::Wwise::Plugin::LicenseID(* GetProjectLicenseID)(const struct ak_wwise_plugin_host_v2 *in_this)
Obtain the project license ID
Definition: Host.h:76
V2::Host Host
Latest version of the C++ Host interface.
Definition: Host.h:161
GUID GetCurrentPlatform() const
LicenseType
License type.
Definition: PluginDef.h:59
BasePlatformID GetCurrentBasePlatform() const
Wwise Authoring Plug-ins - C++ class helper to automatically determine the plug-in interfaces used in...
GUID GetAuthoringPlaybackPlatform() const
API to request host's current state and services.
Definition: Host.h:53
ak_wwise_plugin_host_v2 CHost
Definition: Host.h:91
CHost::Instance Instance
Definition: Host.h:98
API to request host's current state and services.
Definition: Host.h:95
void GetAssetLicenseStatus(const GUID &in_guidPlatform, AkUInt32 in_uAssetID, LicenseType &out_eType, LicenseStatus &out_eStatus, uint32_t &out_uDaysToExpiry) const
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(AudioPlugin)
void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty)
uint32_t AkUInt32
Unsigned 32-bit integer
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID
Definition: AkTypes.h:66
BasePlatformID GetDefaultNativeAuthoringPlaybackPlatform() const
LicenseStatus
License status.
Definition: PluginDef.h:67
#define AK_WWISE_PLUGIN_SPECIALIZE_HOST_INTERFACE(in_name, in_varname,...)
PluginInfoGenerator: Creates a C++ host specialization for interface class specified in in_name,...
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(AudioPlugin)
ak_wwise_plugin_host_instance_v2 Instance
Base host-provided instance type.
Definition: Host.h:58

此页面对您是否有帮助?

需要技术支持?

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

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

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

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

开始 Wwise 之旅