リモート・プロシージャの呼び出し
Wwise Authoring API は、AK::Wwise::Plugin::Host::WaapiCall()
メソッドを使用して、Wwiseプラグインからリモート・プロシージャ・コールを発行するために使用できます。 このメソッドはHostコンポーネントによって提供され、 AK::Wwise::Plugin::RequestHost
から継承することでこれをリクエストできます。
|
注釈: AK::Wwise::Plugin::Host::WaapiCall() メソッドへの呼び出しは常にブロックされます。 |
ユーティリティクラスが提供されていますので、呼び出し側がメモリ割り当ての方策を提供できるようになります。AK::Wwise::Mallocator
は、 malloc
、 free
、 realloc
などCライブラリの関数を使ったデフォルトの実装を提供します。 AK::IAkPluginMemAlloc
を実装するクラスを定義することで、カスタムストラテジーを簡単に提供できます。最後に、タイプセーフと自動メモリ管理を確かにするために、ラッパークラスAK::Wwise::SafeAllocator
を使用します。
例:
#include <rapidjson/document.h>
m_host.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_host.WaapiCall(
"ak.wwise.core.plugin.getProperty", buffer.GetString(),
NULL, alloc, szResults, szError);
if (!szError)
{
rapidjson::Document results;
results.Parse(szResults);
}
|
注釈: ここでは、RapidJSON はデモンストレーション目的でのみ使用されており、決して必須ではありません。 |
Wwiseプラグインに関する詳細は、Authoring Plug-in Library Format をご覧ください。