バージョン

    その他のドキュメント

menu_open
Wwise SDK 2023.1.2
Wwise プラグインでWwise Authoring APIを使用する

リモート・プロシージャの呼び出し

Wwise Authoring API は、AK::Wwise::Plugin::Host::WaapiCall() メソッドを使用して、Wwiseプラグインからリモート・プロシージャ・コールを発行するために使用できます。 このメソッドはHostコンポーネントによって提供され、 AK::Wwise::Plugin::RequestHost から継承することでこれをリクエストできます。

注釈: AK::Wwise::Plugin::Host::WaapiCall()メソッドへの呼び出しは常にブロックされます。

ユーティリティクラスが提供されていますので、呼び出し側がメモリ割り当ての方策を提供できるようになります。AK::Wwise::Mallocator は、 mallocfreerealloc などCライブラリの関数を使ったデフォルトの実装を提供します。 AK::IAkPluginMemAlloc を実装するクラスを定義することで、カスタムストラテジーを簡単に提供できます。最後に、タイプセーフと自動メモリ管理を確かにするために、ラッパークラスAK::Wwise::SafeAllocatorを使用します。

例:

#include <rapidjson/document.h>
// Use the default allocation strategy for results and errors
// Issue a remote procedure call to the Wwise Authoring API
m_host.WaapiCall("ak.wwise.core.getInfo", NULL, NULL, alloc, szResults, szError);
if (!szError)
{
// Parse the results JSON string
results.Parse(szResults);
// ...
}
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
// Use the default allocation strategy for results and errors
// Build a JSON object that contains the procedure's parameters
args.SetObject();
args.AddMember("classId", 8192003, args.GetAllocator());
args.AddMember("property", "ModDepth", args.GetAllocator());
// Stringify the JSON object
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
args.Accept(writer);
// Issue a remote procedure call to the Wwise Authoring API
m_host.WaapiCall("ak.wwise.core.plugin.getProperty", buffer.GetString(), NULL, alloc, szResults, szError);
if (!szError)
{
// Parse the results JSON string
results.Parse(szResults);
// ...
}
注釈: ここでは、RapidJSON はデモンストレーション目的でのみ使用されており、決して必須ではありません。

Wwiseプラグインに関する詳細は、Authoring Plug-in Library Format をご覧ください。

#define NULL
Definition: AkTypes.h:46

このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう