Go to the documentation of this file.
44Â
#define AK_WWISESDK_VERSION_NATIVE_COMBINED ((AK_WWISESDK_VERSION_MAJOR << 19) | (AK_WWISESDK_VERSION_MINOR << 16) | AK_WWISESDK_VERSION_SUBMINOR)
61Â
template <
bool = false>
84Â
template <
typename CInterface>
102Â
template <
typename CInterface,
typename CInstance =
typename CInterface::Instance>
125Â
template <
typename CPPInstance,
bool in_baseInstance>
139Â
template <
typename CPPInstance>
160Â
static CInstance* GetCInterfaceInstance()
163Â
for (
int i = 0; i < pluginInfo->m_arraySize; ++i)
188Â
template <InterfaceType in_
interfaceType, InterfaceVersion in_
interfaceVersion>
205Â
#define AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_CLASS(in_name) \
206Â
template<> struct KnownInterfaceClass<(AK::Wwise::Plugin::InterfaceType)in_name::k_interfaceType, in_name::k_interfaceVersion> \
208Â
using Type = in_name; \
209Â
using Interface = typename Type::Interface; \
221Â
template <
typename T>
237Â
#define AK_WWISE_PLUGIN_SPECIALIZE_HOST_INTERFACE(in_name, in_varname, ...) \
239Â
class RequestedHostInterface<in_name> : public HostInterfaceGlue<in_name, true> __VA_ARGS__ \
242Â
using HostInterfaceDefinition = HostInterfaceGlue<in_name, true>; \
243Â
in_name::Interface& g_ ## in_varname ## Interface = HostInterfaceDefinition::g_cppinterface; \
244Â
HostInterfaceDefinition::Instance& m_ ## in_varname = *HostInterfaceDefinition::m_instance; \
246Â
RequestedHostInterface() {} \
262Â
#define AK_WWISE_PLUGIN_SPECIALIZE_HOST_INTERFACE_NO_BASE_INSTANCE(in_name, in_varname) \
264Â
class RequestedHostInterface<in_name> : public HostInterfaceGlue<in_name, false> \
267Â
using HostInterfaceDefinition = HostInterfaceGlue<in_name, false>; \
268Â
in_name::Interface& g_ ## in_varname ## Interface = HostInterfaceDefinition::g_cppinterface; \
270Â
RequestedHostInterface() {} \
281Â
template <InterfaceType in_
interfaceType>
295Â
#define AK_WWISE_PLUGIN_SPECIALIZE_INTERFACE_VERSION(in_interface) \
297Â
struct LatestInterfaceVersion<(InterfaceType)in_interface::k_interfaceType> \
299Â
enum { k_interfaceVersion = (InterfaceVersion)in_interface::k_interfaceVersion }; \
326Â
template <
typename PluginT>
334Â
template <InterfaceType in_
interfaceType>
350Â
template <uint32_t... in_versions>
351Â
struct VersionPack :
public std::integer_sequence<uint32_t, in_versions...>
360Â
return (in_versions, ...);
375Â
template <uint32_t in_interfaceVersion =
k_latestInterfaceVersion, uint32_t... in_requestedVersions, uint32_t... in_providedVersions>
378Â
if constexpr (in_interfaceVersion >= 1)
382Â std::is_base_of_v<RequestedHostInterface<InterfaceClass>, PluginT>,
383Â VersionPack<in_interfaceVersion, in_requestedVersions...>,
384Â VersionPack<in_requestedVersions...>>;
386Â std::is_base_of_v<InterfaceClass, PluginT>,
387Â VersionPack<in_interfaceVersion, in_providedVersions...>,
388Â VersionPack<in_providedVersions...>>;
396Â
return std::pair<VersionPack<in_requestedVersions...>, VersionPack<in_providedVersions...>>();
435Â k_requested = RequestedInterfaceVersions::size() >= 1,
443Â k_provides = ProvidedInterfaceVersions::size() >= 1,
448Â k_has = k_requested || k_provides
451Â static_assert(RequestedInterfaceVersions::size() <= 1,
"Plugin can't request more than one version of the same interface");
452Â static_assert(ProvidedInterfaceVersions::size() <= 1,
"Plugin can't provide more than one version of the same interface");
453Â static_assert(!(k_requested && k_provides),
"Requested interfaces can't be provided and provided interfaces can't be requested");
469Â
if constexpr (k_requested)
471Â
return RequestedInterfaceVersions::GetLatest();
473Â
else if constexpr (k_provides)
475Â
return ProvidedInterfaceVersions::GetLatest();
532Â
return &s_placeholder;
578Â
template <InterfaceType in_
interfaceType>
600Â
template <InterfaceType in_
interfaceType>
605Â GenerateInterfaceArray<(InterfaceType)(in_interfaceType + 1)>(
615Â
return out_interfaces;
623Â
template <InterfaceType in_
interfaceType>
656Â
template <InterfaceType in_
interfaceType = (InterfaceType)(AK_WWISE_PLUGIN_INTERFACE_TYPE_UNKNOWN + 1)>
724Â
auto plugin =
new PluginT;
744Â
auto voidinstance = in_instance[0].
m_instance;
748Â
delete[] in_instance;
760Â &in_pluginRegistration->m_ulCompanyID,
761Â &in_pluginRegistration->m_ulPluginID,
762Â &in_pluginRegistration->m_eType,
764Â in_pluginRegistration,
774Â uint32_t in_pluginFlags = 0) :
797Â
#define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME2(prefix,suffix) prefix##suffix
798Â
#define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(prefix,suffix) AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME2(prefix, suffix)
801Â
#if defined(DOXYGEN_INCLUDE)
805Â
#define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __COUNTER__)
806Â
#elif !defined(__COUNTER__)
807Â
#define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __LINE__)
808Â
#elif __COUNTER__ == __COUNTER__
809Â
#define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __LINE__)
811Â
#define AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME1(UserGeneratedPluginInfo, __COUNTER__)
824Â
#define AK_DECLARE_PLUGIN_CONTAINER(ContainerName) \
825Â
extern "C" __declspec(dllexport) AK::Wwise::Plugin::PluginContainer* GetPluginContainer ## ContainerName()
827Â
#define AK_DECLARE_PLUGIN_CONTAINER(ContainerName) \
828Â
extern "C" __attribute__ ((visibility ("default"))) AK::Wwise::Plugin::PluginContainer* GetPluginContainer ## ContainerName()
838Â
#define AK_DEFINE_PLUGIN_CONTAINER(ContainerName) \
840Â
AK::Wwise::Plugin::PluginContainer* GetPluginContainer ## ContainerName() \
842Â
static AK::Wwise::Plugin::PluginContainer singleton; \
843Â
return &singleton; \
857Â
#define AK_EXPORT_PLUGIN_CONTAINER(ContainerName) \
858Â
extern "C" __declspec(dllexport) AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_ ## ContainerName; \
859Â
AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_ ## ContainerName = GetPluginContainer ## ContainerName()
861Â
#define AK_EXPORT_PLUGIN_CONTAINER(ContainerName) \
862Â
extern "C" __attribute__ ((visibility ("default"))) AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_lib ## ContainerName; \
863Â
AK::Wwise::Plugin::PluginContainer * ak_wwise_plugin_container_export_lib ## ContainerName = GetPluginContainer ## ContainerName()
882Â
#define AK_ADD_PLUGIN_CLASS_TO_CONTAINER(ContainerName, WwiseClassName, AudioEngineRegisteredName) \
883Â
extern AK::PluginRegistration AudioEngineRegisteredName ## Registration; \
884Â
namespace { namespace AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME { \
885Â
static struct UserGeneratedPluginInfo : private AK::Wwise::Plugin::PluginInfoGenerator<WwiseClassName> \
887Â
UserGeneratedPluginInfo() : \
888Â
PluginInfoGenerator(&AudioEngineRegisteredName ## Registration) \
890Â
m_pluginInfo.m_next = GetPluginContainer ## ContainerName()->m_pluginInfos; \
891Â
GetPluginContainer ## ContainerName()->m_pluginInfos = &m_pluginInfo; \
911Â
#define AK_ADD_PLUGIN_CLASSID_TO_CONTAINER(ContainerName, WwiseClassName, CompanyID, PluginID, Type) \
912Â
namespace { namespace AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME { \
913Â
static struct UserGeneratedPluginInfo : private AK::Wwise::Plugin::PluginInfoGenerator<WwiseClassName> \
915Â
const AkUInt32 m_companyID = CompanyID; \
916Â
const AkUInt32 m_pluginID = PluginID; \
917Â
const AkPluginType m_type = Type; \
918Â
UserGeneratedPluginInfo() : \
919Â
PluginInfoGenerator(&m_companyID, &m_pluginID, &m_type) \
921Â
m_pluginInfo.m_next = GetPluginContainer ## ContainerName()->m_pluginInfos; \
922Â
GetPluginContainer ## ContainerName()->m_pluginInfos = &m_pluginInfo; \
928Â
#define AK_AUDIOPLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME AK_PLUGIN_USERGENERATEDPLUGININFO_NAMESPACE_NAME
931Â
#define DECLARE_AUDIOPLUGIN_CONTAINER(x) AK_DECLARE_PLUGIN_CONTAINER(x)
934Â
#define DEFINE_AUDIOPLUGIN_CONTAINER(x) AK_DEFINE_PLUGIN_CONTAINER(x)
937Â
#define EXPORT_AUDIOPLUGIN_CONTAINER(x) AK_EXPORT_PLUGIN_CONTAINER(x)
940Â
#define ADD_AUDIOPLUGIN_CLASS_TO_CONTAINER(x, y, z) AK_ADD_PLUGIN_CLASS_TO_CONTAINER(x, y, z)
943Â
#define ADD_AUDIOPLUGIN_CLASSID_TO_CONTAINER(x, y, a, b, c) AK_ADD_PLUGIN_CLASSID_TO_CONTAINER(x, y, a, b, c)
945Â
#endif // of __cplusplus
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...
Interface used to interact with the frontend model.
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]
Array of all used interfaces for the 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.
~PluginInfoGenerator()=default
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.
C++ PluginInfo Generator.
Wwise Authoring Plug-ins - Root interface allowing a logical unit (variable, library) to contain more...
uint32_t AkUInt32
Unsigned 32-bit integer.
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.
struct ak_wwise_plugin_interface_array_item * m_interfaces
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.
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