Go to the documentation of this file.
45 #define AK_WWISESDK_VERSION_NATIVE_COMBINED ((AK_WWISESDK_VERSION_MAJOR << 19) | (AK_WWISESDK_VERSION_MINOR << 16) | AK_WWISESDK_VERSION_SUBMINOR)
62 template <
bool = false>
85 template <
typename CInterface>
103 template <
typename CInterface,
typename CInstance =
typename CInterface::Instance>
126 template <
typename CPPInstance,
bool in_baseInstance>
140 template <
typename CPPInstance>
161 static CInstance* GetCInterfaceInstance()
164 for (
int i = 0; i < pluginInfo->m_arraySize; ++i)
189 template <InterfaceType in_
interfaceType, InterfaceVersion in_
interfaceVersion>
206 #define AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(in_name) \
207 template<> struct KnownInterfaceClass<(AK::Wwise::Plugin::InterfaceType)in_name::k_interfaceType, in_name::k_interfaceVersion> \
209 using Type = in_name; \
210 using Interface = typename Type::Interface; \
222 template <
typename T>
238 #define AK_WWISE_PLUGIN_SPECIALIZE_HOST_INTERFACE(in_name, in_varname, ...) \
240 class RequestedHostInterface<in_name> : public HostInterfaceGlue<in_name, true> __VA_ARGS__ \
243 using HostInterfaceDefinition = HostInterfaceGlue<in_name, true>; \
244 in_name::Interface& g_ ## in_varname ## Interface = HostInterfaceDefinition::g_cppinterface; \
245 HostInterfaceDefinition::Instance& m_ ## in_varname = *HostInterfaceDefinition::m_instance; \
247 RequestedHostInterface() {} \
263 #define AK_WWISE_PLUGIN_SPECIALIZE_HOST_INTERFACE_NO_BASE_INSTANCE(in_name, in_varname) \
265 class RequestedHostInterface<in_name> : public HostInterfaceGlue<in_name, false> \
268 using HostInterfaceDefinition = HostInterfaceGlue<in_name, false>; \
269 in_name::Interface& g_ ## in_varname ## Interface = HostInterfaceDefinition::g_cppinterface; \
271 RequestedHostInterface() {} \
282 template <InterfaceType in_
interfaceType>
296 #define AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(in_interface) \
298 struct LatestInterfaceVersion<(InterfaceType)in_interface::k_interfaceType> \
300 enum { k_interfaceVersion = (InterfaceVersion)in_interface::k_interfaceVersion }; \
327 template <
typename PluginT>
335 template <InterfaceType in_
interfaceType>
351 template <uint32_t... in_versions>
352 struct VersionPack :
public std::integer_sequence<uint32_t, in_versions...>
361 return (in_versions, ...);
376 template <uint32_t in_interfaceVersion =
k_latestInterfaceVersion, uint32_t... in_requestedVersions, uint32_t... in_providedVersions>
379 if constexpr (in_interfaceVersion >= 1)
383 std::is_base_of_v<RequestedHostInterface<InterfaceClass>, PluginT>,
384 VersionPack<in_interfaceVersion, in_requestedVersions...>,
385 VersionPack<in_requestedVersions...>>;
387 std::is_base_of_v<InterfaceClass, PluginT>,
388 VersionPack<in_interfaceVersion, in_providedVersions...>,
389 VersionPack<in_providedVersions...>>;
397 return std::pair<VersionPack<in_requestedVersions...>, VersionPack<in_providedVersions...>>();
436 k_requested = RequestedInterfaceVersions::size() >= 1,
444 k_provides = ProvidedInterfaceVersions::size() >= 1,
449 k_has = k_requested || k_provides
452 static_assert(RequestedInterfaceVersions::size() <= 1,
"Plugin can't request more than one version of the same interface");
453 static_assert(ProvidedInterfaceVersions::size() <= 1,
"Plugin can't provide more than one version of the same interface");
454 static_assert(!(k_requested && k_provides),
"Requested interfaces can't be provided and provided interfaces can't be requested");
470 if constexpr (k_requested)
472 return RequestedInterfaceVersions::GetLatest();
474 else if constexpr (k_provides)
476 return ProvidedInterfaceVersions::GetLatest();
533 return &s_placeholder;
579 template <InterfaceType in_
interfaceType>
601 template <InterfaceType in_
interfaceType>
606 GenerateInterfaceArray<(InterfaceType)(in_interfaceType + 1)>(
616 return out_interfaces;
624 template <InterfaceType in_
interfaceType>
657 template <InterfaceType in_
interfaceType = (InterfaceType)(AK_WWISE_PLUGIN_INTERFACE_TYPE_UNKNOWN + 1)>
742 auto plugin =
new PluginT;
762 auto voidinstance = in_instance[0].
m_instance;
766 delete[] in_instance;
778 &in_pluginRegistration->m_ulCompanyID,
779 &in_pluginRegistration->m_ulPluginID,
780 &in_pluginRegistration->m_eType,
782 in_pluginRegistration,
795 uint32_t in_pluginFlags = 0) :
822 template <
typename PluginT>
827 #define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME2(prefix,suffix) prefix##suffix
828 #define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(prefix,suffix) AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME2(prefix, suffix)
831 #if defined(DOXYGEN_INCLUDE)
835 #define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __COUNTER__)
836 #elif !defined(__COUNTER__)
837 #define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __LINE__)
838 #elif __COUNTER__ == __COUNTER__
839 #define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __LINE__)
841 #define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __COUNTER__)
853 #define AK_DECLARE_PLUGIN_CONTAINER(ContainerName) extern AK::Wwise::Plugin::PluginContainer& GetPluginContainer ## ContainerName()
862 #define AK_DEFINE_PLUGIN_CONTAINER(ContainerName) \
863 AK::Wwise::Plugin::PluginContainer& GetPluginContainer ## ContainerName() \
865 static AK::Wwise::Plugin::PluginContainer singleton; \
880 #define AK_EXPORT_PLUGIN_CONTAINER(ContainerName) \
881 extern "C" __declspec(dllexport) AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_ ## ContainerName; \
882 AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_ ## ContainerName = &GetPluginContainer ## ContainerName()
884 #define AK_EXPORT_PLUGIN_CONTAINER(ContainerName) \
885 extern "C" __attribute__ ((visibility ("default"))) AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_lib ## ContainerName; \
886 AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_lib ## ContainerName = &GetPluginContainer ## ContainerName()
905 #define AK_ADD_PLUGIN_CLASS_TO_CONTAINER(ContainerName, WwiseClassName, AudioEngineRegisteredName) \
906 extern AK::PluginRegistration AudioEngineRegisteredName ## Registration; \
907 namespace { namespace AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME { \
908 static struct UserGeneratedPluginInfo : private AK::Wwise::Plugin::PluginInfoGenerator<WwiseClassName> \
910 UserGeneratedPluginInfo() : \
911 PluginInfoGenerator(&AudioEngineRegisteredName ## Registration) \
913 m_pluginInfo.m_next = GetPluginContainer ## ContainerName().m_pluginInfos; \
914 GetPluginContainer ## ContainerName().m_pluginInfos = &m_pluginInfo; \
934 #define AK_ADD_PLUGIN_CLASSID_TO_CONTAINER(ContainerName, WwiseClassName, CompanyID, PluginID, Type) \
935 namespace { namespace AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME { \
936 static struct UserGeneratedPluginInfo : private AK::Wwise::Plugin::PluginInfoGenerator<WwiseClassName> \
938 const AkUInt32 m_companyID = CompanyID; \
939 const AkUInt32 m_pluginID = PluginID; \
940 const AkPluginType m_type = Type; \
941 UserGeneratedPluginInfo() : \
942 PluginInfoGenerator(&m_companyID, &m_pluginID, &m_type) \
944 m_pluginInfo.m_next = GetPluginContainer ## ContainerName().m_pluginInfos; \
945 GetPluginContainer ## ContainerName().m_pluginInfos = &m_pluginInfo; \
951 #define AK_AUDIOPLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME
954 #define DECLARE_AUDIOPLUGIN_CONTAINER(x) AK_DECLARE_PLUGIN_CONTAINER(x)
957 #define DEFINE_AUDIOPLUGIN_CONTAINER(x) AK_DEFINE_PLUGIN_CONTAINER(x)
960 #define EXPORT_AUDIOPLUGIN_CONTAINER(x) AK_EXPORT_PLUGIN_CONTAINER(x)
963 #define ADD_AUDIOPLUGIN_CLASS_TO_CONTAINER(x, y, z) AK_ADD_PLUGIN_CLASS_TO_CONTAINER(x, y, z)
966 #define ADD_AUDIOPLUGIN_CLASSID_TO_CONTAINER(x, y, a, b, c) AK_ADD_PLUGIN_CLASSID_TO_CONTAINER(x, y, a, b, c)
968 #endif // of __cplusplus
static PluginInfoGenerator * g_instance
The unique generator instance for this particular plug-in.
static void UpdateCInterface(const InterfaceArrayItem in_original[k_interfaceCount], int in_count=0)
PluginInfoGenerator: For each plug-in interface type, provides a single static instance used througho...
static void Constructor(InterfaceArrayItem &out_interface, const InterfaceArrayItem &in_original, PluginT *in_instance)
static void Constructor(InterfaceArrayItem out_interfaces[k_interfaceCount], const InterfaceArrayItem in_original[k_interfaceCount], PluginT *in_instance, int in_count=0)
decltype(BaseInterface::m_interface) InterfaceType
PluginInfoGenerator: Type for the m_interface value in BaseInterface.
Generic base for all plug-in instances. In C++, this is derived. In C, they are equivalent.
PluginInfoGenerator(const AkUInt32 *in_companyID, const AkUInt32 *in_pluginID, const AkPluginType *in_pluginType, uint32_t in_pluginFlags=0)
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_PLUGIN_CONTAINER
2021.1 Plug-in container plug-in. Contains all the other plug-ins. ak_wwise_plugin_container
The interface information of the plug-in currently being instantiated.
static constexpr InterfaceArrayItem GenerateInterface()
Generates the InterfaceArrayItem for our particular type.
ak_wwise_plugin_interface_type m_interface
Interface type (see ak_wwise_plugin_interface_type)
typename UsedInterfaceVersions::first_type RequestedInterfaceVersions
VersionPack containing the requested versions of the interface by the plug-in.
static constexpr InterfaceArrayItem * GenerateInterfaceArray(InterfaceArrayItem out_interfaces[k_interfaceCount])
typename UsedInterfaceVersions::second_type ProvidedInterfaceVersions
VersionPack containing the provided versions of the interface by the plug-in.
static GluedInterface * g_cinterface
The unique instance of the CInterface interface. Defined at nullptr first, overridden by the Host onc...
typename Super::CInstance CInstance
typename CInterface::Instance Instance
decltype(BaseInterface::m_version) InterfaceVersion
PluginInfoGenerator: Type for the m_version value in BaseInterface.
typename KnownInterfaceClass< in_interfaceType, k_interfaceVersion >::Type InterfaceClass
Interface class of the versioned interface type.
static GluedInterface g_cppinterface
The unique interface for this plug-in interface.
InterfaceArrayItem m_interfaceArray[k_interfaceCount]
Current array of interfaces, used in the bridge between host and plug-in.
typename Super::Instance Instance
CInterfaceArrayItem InterfaceArrayItem
A single instantiatable plug-in interface.
Casts the plug-in class to the requested interface class.
uint32_t m_version
Version of the interface.
PluginInfoGenerator: Compile-time dictionary of known interface-version.
static void UpdateCInterface(const InterfaceArrayItem &in_original)
#define AK_WWISESDK_VERSION_NATIVE_COMBINED
The specific version for native plug-in interfaces. Must be identical down to the build number.
Generates the constructor for our particular type.
PluginInfoGenerator: Requests a host-provided service, and optionally receives a variable containing ...
@ k_latestInterfaceVersion
Most up-to-date version of the interface in the current SDK.
Compile-time dictionary about a particular interface type.
PluginInfoGenerator: Defines a compile-time dictionary with the latest version known to the SDK for e...
Root interface allowing a logical unit (variable, library) to contain more than one interface.
static InterfaceArrayItem * Instantiate(PluginInfo *in_pluginInfo)
Plug-in instance constructor, as shared with the host.
static constexpr void GenerateInterfaceArray(InterfaceArrayItem out_interfaces[k_interfaceCount], int in_count, InterfaceArrayItem)
Recursively generates an interface array of all the Interfaces pointers.
static thread_local PluginInfo * tls_pluginInfo
static void Disembody(InterfaceArrayItem *in_instance)
Plug-in instance destructor, as shared to the host.
Generic base for all plug-in instances in C++.
PluginInfoGenerator: Associates an existing C Interface with a variable that can be used....
CPluginContainer PluginContainer
Root interface allowing a logical unit (variable, library) to contain more than one interface.
HostInterfaceGlue(CInstance *in_instance)
PluginInfo m_pluginInfo
The unique m_pluginInfo used in the ak_wwise_plugin_container for that particular plug-in.
Compile-time container of version numbers.
CInterface GluedInterface
PluginInfoGenerator(PluginRegistration *in_pluginRegistration, uint32_t in_pluginFlags=0)
PluginInfoGenerator: Base class for every C++ instance that retrieves a service from the Wwise Author...
decltype(GetUsedInterfaceVersions()) UsedInterfaceVersions
Pair type containing a VersionPack of the requested versions and a VersionPack of the provided versio...
Recursively generates the constructors and interface pointer updater for all the Interfaces.
std::underlying_type< InterfaceType >::type InterfaceTypeValue
PluginInfoGenerator: Underlying storage type for the m_interface value in BaseInterface.
@ k_interfaceVersion
Version of the interface used by the plug-in or k_latestInterfaceVersion if unused.
typename CPPInstance::GluedInterface GluedInterface
static constexpr uint32_t GetLatest()
Get the latest version stored in the container. Assumes the container is sorted in ascending order.
static constexpr uint32_t GetInterfaceVersion()
Extract the version of the interface used by the plug-in.
static constexpr auto GetUsedInterfaceVersions(VersionPack< in_requestedVersions... >={}, VersionPack< in_providedVersions... >={})
Recursively accumulate each version of the interface requested or provided by the plug-in (there shou...
Interface description and base class for every Wwise Authoring plug-in interface.
static BaseInterface * GetPlaceholderPointer()
Get a Placeholder Pointer object.
Host API to retrieve a link to the plug-in's backend instance.
C++ PluginInfo Generator.
Wwise Authoring Plug-ins - Root interface allowing a logical unit (variable, library) to contain more...
constexpr static InterfaceClass * Cast(PluginT *in_plugin)
A single instantiatable plug-in interface.
typename Super::GluedInterface GluedInterface
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_UNKNOWN
2021.1 Unknown plug-in ID (0 - error, invalid, uninitialized)
CPPInstance * m_instance
The default instance for this plug-in interface.
@ AK_WWISE_PLUGIN_INTERFACE_TYPE_NUM
typename CPPInstance::Instance CInstance
ak_wwise_plugin_instance_ptr m_instance
That particular instance.
ak_wwise_plugin_interface_ptr m_interface
The interface. Should be identical for every instance of this DLL.
@ k_interfaceCount
Number of interfaces we are currently using.
static constexpr size_t CountInterfaces()
Count the number of interfaces we are currently using.
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