版本

menu_open
Wwise SDK 2023.1.4

◆ GetCount()

virtual int AK.Wwise::Plugin::V1::SinkDevices::GetCount ( ) const
pure virtual

Get a count of the number of interfaces currently available.

Provided by your plug-in, this should return a count.

备注: Due to the unpredictable nature of hardware configuration changes, an unpadded, basic system would return a configuration that can change between a GetCount and subsequent objects retrieval.

As a plug-in designer, you are responsible to address this by returning adequate values that make sense as a whole.

To guide you, Sink Devices interface is used for retrieval and data copy in a tight loop over a single thread at once. Host will retrieve the count, followed by the Name (GetName) and DeviceID (GetDeviceID), in the order the compiler sees fit. Data is expected to survive for the amount of time this tight loop exists.

int count = m_interface->GetCount(m_instance);
for (int i = 0; i < count; ++i)
{
result.emplace_back(
m_interface->GetName(m_instance, i),
m_interface->GetDeviceID(m_instance, i)
);
}

A proposal is to use GetCount to internally retrieve the device names and IDs, make a static internal cache, and then return name and device ID based on this cache.

You can also spawn an event listener or an update thread, and ensure the data is up to date when the calls come in, and block updates until all calls are accounted for.

返回
int Count of the number of interfaces available.

此页面对您是否有帮助?

需要技术支持?

仍有疑问?或者问题?需要更多信息?欢迎联系我们,我们可以提供帮助!

查看我们的“技术支持”页面

介绍一下自己的项目。我们会竭力为您提供帮助。

来注册自己的项目,我们帮您快速入门,不带任何附加条件!

开始 Wwise 之旅