调用远程程序
Wwise Authoring API 可以用来从 Wwise 插件内使用 AK::Wwise::IPluginPropertySet::WaapiCall()
的方法发出远程程序调用。
提供了工具类,供调用者提供内存分配的策略。AK::Wwise::Mallocator
使用 malloc
和 free
提供默认的实现,但提供自定义实现也很方便,方法是定义类来实现 AK::IAkPluginMemAlloc
接口。最终,封装类 AK::Wwise::SafeAllocator
被用于保证类型安全和自动内存管理。
示例:
#include <rapidjson/document.h>
m_pPSet->WaapiCall(
"ak.wwise.core.getInfo",
NULL,
NULL, &alloc, szResults, szError);
if (!szError)
{
rapidjson::Document results;
results.Parse(szResults);
}
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
rapidjson::Document args;
args.SetObject();
args.AddMember("classId", 8192003, args.GetAllocator());
args.AddMember("property", "ModDepth", args.GetAllocator());
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
args.Accept(writer);
m_pPSet->WaapiCall(
"ak.wwise.core.plugin.getProperty", buffer.GetString(),
NULL, &alloc, szResults, szError);
if (!szError)
{
rapidjson::Document results;
results.Parse(szResults);
}
 |
备注: 这里用到的 RapidJSON 只是出于演示目的,并不是必须的库。 |
请参阅 如何创建 Wwise 插件 DLL 了解 Wwise plug-ins 的更多详情。