Version

menu_open
Wwise SDK 2021.1.14
License.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: v2021.1.14 Build: 6590
25  Copyright (c) 2006-2023 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /**
29  * \brief Wwise Authoring Plug-ins - Plug-in API for licensing.
30  * \file AK/Wwise/Plugin/License.h
31  */
32 
33 #pragma once
34 
35 #include "PluginInfoGenerator.h"
36 
37 /**
38  * \brief Backend API to specify licensing requirements
39  */
41 #ifdef __cplusplus
43 #endif
44 {
45 #ifndef __cplusplus
46  ak_wwise_plugin_base_interface m_baseInterface;
47 #endif
48 
49 #ifdef __cplusplus
50  /// Base instance type for providing licensing information.
52 
55  {}
56 #endif
57 
58  /**
59  * \brief Retrieve the licensing status of the plug-in for the given platform.
60  *
61  * \param[in] in_this Current instance of this interface.
62  * \param[in] in_guidPlatform GUID of the platform.
63  * \param[out] out_eSeverity (Optional) If set, the string placed in out_pszMessage will be shown
64  * in the log with the corresponding severity.
65  * \param[out] out_pszMessage Pointer to the buffer of size in_uiBufferSize that will hold the
66  * message string.
67  * \param[in] in_uiBufferSize Null-terminated size of the buffer pointed by out_pszMessage.
68 
69  * \return Licensing status of the plug-in; LicenseStatus_Unlicensed or LicenseStatus_Expired
70  * will prevent the plug-in from being included in a SoundBank.
71  *
72  * \sa
73  * - \ref AK::Wwise::Plugin::Host::GetLicenseStatus
74  * - \ref AK::Wwise::Plugin::Host::GetAssetLicenseStatus
75  * - \ref wwiseplugin_dll_license
76  */
78  const struct ak_wwise_plugin_license_instance_v1* in_this,
79  const GUID* in_guidPlatform, ///< GUID of the platform
80  AK::Wwise::Plugin::Severity* out_eSeverity, ///< (Optional) If set, the string placed in out_pszMessage will be shown in the log with the corresponding severity.
81  char * out_pszMessage, ///< Pointer to the buffer that will hold the message string
82  unsigned int in_uiBufferSize ///< Size of the buffer pointed by out_pszMessage (in number of WCHAR, including null terminator)
83  );
84 
85 };
86 #define AK_WWISE_PLUGIN_LICENSE_V1_ID() \
87  AK_WWISE_PLUGIN_BASE_INTERFACE_FROM_ID(AK_WWISE_PLUGIN_INTERFACE_TYPE_LICENSE, 1)
88 #define AK_WWISE_PLUGIN_LICENSE_V1_CTOR(/* ak_wwise_plugin_info* */ in_pluginInfo, /* void* */ in_data) \
89 { \
90  .m_baseInterface = AK_WWISE_PLUGIN_BASE_INTERFACE_CTOR(AK_WWISE_PLUGIN_LICENSE_V1_ID(), in_pluginInfo, in_data) \
91 }
92 
93 #ifdef __cplusplus
94 namespace AK::Wwise::Plugin
95 {
96  namespace V1
97  {
99  class License : public CLicense::Instance
100  {
101  public:
102  /**
103  * \brief The interface type, as provided by this plug-in.
104  */
105  enum : InterfaceTypeValue
106  {
107  /**
108  * \brief The interface type, as provided by this plug-in.
109  */
111  };
112  /**
113  * \brief The interface version, as provided by this plug-in.
114  */
115  enum : InterfaceVersion
116  {
117  /**
118  * \brief The interface version, as provided by this plug-in.
119  */
121  };
122 
123  /**
124  * \brief The C interface, fulfilled by your plug-in.
125  */
126  struct Interface : public CLicense
127  {
128  using Instance = License;
130  {
132  const struct ak_wwise_plugin_license_instance_v1* in_this,
133  const GUID* in_guidPlatform,
134  Severity* out_eSeverity,
135  char * out_pszMessage,
136  unsigned int in_uiBufferSize)
137  {
138  return (LicenseStatus)static_cast<const Instance*>(in_this)->GetLicenseStatus(
139  *in_guidPlatform,
140  *out_eSeverity,
141  out_pszMessage,
142  in_uiBufferSize);
143  };
144  }
145  };
146 
148  static Interface g_interface;
149  return &g_interface;
150  }
152  return this;
153  }
155  return this;
156  }
157 
159  CLicense::Instance()
160  {
161  }
162 
163  virtual ~License() {}
164 
165  /**
166  * \brief Retrieve the licensing status of the plug-in for the given platform.
167  *
168  * \param[in] in_guidPlatform GUID of the platform.
169  * \param[out] out_eSeverity (Optional) If set, the string placed in out_pszMessage will be shown
170  * in the log with the corresponding severity.
171  * \param[out] out_pszMessage Pointer to the buffer of size in_uiBufferSize that will hold the
172  * message string.
173  * \param[in] in_uiBufferSize Null-terminated size of the buffer pointed by out_pszMessage.
174 
175  * \return Licensing status of the plug-in; LicenseStatus_Unlicensed or LicenseStatus_Expired
176  * will prevent the plug-in from being included in a SoundBank.
177  *
178  * \sa
179  * - \ref AK::Wwise::Plugin::Host::GetLicenseStatus
180  * - \ref AK::Wwise::Plugin::Host::GetAssetLicenseStatus
181  * - \ref wwiseplugin_dll_license
182  */
184  const GUID & in_guidPlatform,
185  Severity & out_eSeverity,
186  char * out_pszMessage,
187  unsigned int in_uiBufferSize
188  ) const { return LicenseStatus::LicenseStatus_Valid; }
189  };
190  } // of namespace V1
191 
192  /// Latest version of the C License interface.
194  /// Latest version of the C++ License interface.
196 
199 } // of namespace AK::Wwise::Plugin
200 
201 #endif
InterfacePtr GetInterfacePointer()
Definition: License.h:147
@ k_interfaceType
The interface type, as provided by this plug-in.
Definition: License.h:110
virtual LicenseStatus GetLicenseStatus(const GUID &in_guidPlatform, Severity &out_eSeverity, char *out_pszMessage, unsigned int in_uiBufferSize) const
Retrieve the licensing status of the plug-in for the given platform.
Definition: License.h:183
decltype(BaseInterface::m_version) InterfaceVersion
PluginInfoGenerator: Type for the m_version value in BaseInterface.
@ LicenseStatus_Valid
A license is found and is valid.
Definition: Utilities.h:97
const CLicense::Instance * GetInstancePointer() const
Definition: License.h:154
Wwise Authoring Plug-ins - C++ class helper to automatically determine the plug-in interfaces used in...
The C interface, fulfilled by your plug-in.
Definition: License.h:127
CInterfacePtr InterfacePtr
Definition: PluginDef.h:968
Base instance type for providing licensing information, through ak_wwise_plugin_license_v1.
Definition: PluginDef.h:877
std::underlying_type< InterfaceType >::type InterfaceTypeValue
PluginInfoGenerator: Underlying storage type for the m_interface value in BaseInterface.
AK::Wwise::Plugin::LicenseStatus(* GetLicenseStatus)(const struct ak_wwise_plugin_license_instance_v1 *in_this, const GUID *in_guidPlatform, AK::Wwise::Plugin::Severity *out_eSeverity, char *out_pszMessage, unsigned int in_uiBufferSize)
Retrieve the licensing status of the plug-in for the given platform.
Definition: License.h:77
Severity
Log message severity.
Definition: PluginDef.h:104
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(AudioPlugin)
ak_wwise_plugin_license_v1 CLicense
Definition: License.h:98
CLicense::Instance * GetInstancePointer()
Definition: License.h:151
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_LICENSE
2021.1 Licensing. ak_wwise_plugin_license_v1
ak_wwise_plugin_license_v1()
Definition: License.h:53
Interface description and base class for every Wwise Authoring plug-in interface.
V1::License License
Latest version of the C++ License interface.
Definition: License.h:195
LicenseStatus
License status.
Definition: PluginDef.h:68
Backend API to specify licensing requirements.
Definition: License.h:44
@ k_interfaceVersion
The interface version, as provided by this plug-in.
Definition: License.h:120
AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(AudioPlugin)
Definition: PluginHelpers.h:46

Cette page a-t-elle été utile ?

Besoin d'aide ?

Des questions ? Des problèmes ? Besoin de plus d'informations ? Contactez-nous, nous pouvons vous aider !

Visitez notre page d'Aide

Décrivez-nous de votre projet. Nous sommes là pour vous aider.

Enregistrez votre projet et nous vous aiderons à démarrer sans aucune obligation !

Partir du bon pied avec Wwise