Version
menu

Wwise SDK 2025.1.0
Host.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2025 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
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  * \return An instance of LicenseID filled with the project license ID, or
108  * zeroed-out if the project has no license.
109  */
111  {
113  }
114 
115  #if defined( DOXYGEN_INCLUDE )
116  GUID GetCurrentPlatform() const;
120  void NotifyInternalDataChanged(AkPluginParamID in_idData, bool in_bMakeProjectDirty);
122  const GUID& in_guidPlatform,
123  LicenseType& out_eType,
124  LicenseStatus& out_eStatus,
125  uint32_t& out_uDaysToExpiry
126  ) const;
128  const GUID& in_guidPlatform,
129  AkUInt32 in_uAssetID,
130  LicenseType& out_eType,
131  LicenseStatus& out_eStatus,
132  uint32_t& out_uDaysToExpiry
133  ) const;
134  void WaapiCall(
135  const char* in_szUri,
136  const char* in_szArgs,
137  const char* in_szOptions,
138  AK::IAkPluginMemAlloc& in_alloc,
139  char*& out_szResults,
140  char*& out_szError
141  ) const;
142  #endif
143  };
144 
145  /**
146  * \brief Requests a Host interface, provided as m_host variable.
147  *
148  * Deriving your plug-in class from RequestHost will automatically request both Host and
149  * Notifications::Host_ interfaces. From this point, you will be able to derive from the virtual
150  * functions as defined in Notifications::Host_, and access the host-provided functions in the
151  * \c m_host variable.
152  */
154 
155  } // of namespace V2
156 
157  /// Latest version of the C Host interface.
158  using CHost = V2::CHost;
159  /// Latest version of the C++ Host interface.
160  using Host = V2::Host;
161  /// Latest version of the requested C++ Host interface.
163 
167 } // of namespace AK::Wwise::Plugin
168 
169 #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:110
API to request host's current state and services.
Definition: Host.h:245
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:153
static GluedInterface * g_cinterface
The unique instance of the CInterface interface. Defined at nullptr first, overridden by the Host onc...
AK::Wwise::Plugin::LicenseID(* GetProjectLicenseID)(const struct ak_wwise_plugin_host_v2 *in_this)
Obtain the project license ID.
Definition: Host.h:76
AkInt16 AkPluginParamID
Source or effect plug-in parameter ID.
Definition: AkTypedefs.h:53
GUID GetCurrentPlatform() const
LicenseType
License type.
Definition: PluginDef.h:60
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)
API to request host's current state and services.
Definition: Host.h:52
uint32_t AkUInt32
Unsigned 32-bit integer.
BasePlatformID GetDefaultNativeAuthoringPlaybackPlatform() const
API to receive host's update notifications.
Definition: Host.h:392
V1::Notifications::Host_ Host
Latest version of the C++ Host notification interface.
Definition: Host.h:483
LicenseStatus
License status.
Definition: PluginDef.h:68
#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)
Wwise Authoring Plug-ins - API to request host's current state and services.
ak_wwise_plugin_host_instance_v2 Instance
Base host-provided instance type.
Definition: Host.h:58

Was this page helpful?

Need Support?

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

Visit our Support page

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

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

Get started with Wwise