本文整理汇总了C++中QAudioEngineFactoryInterface类的典型用法代码示例。如果您正苦于以下问题:C++ QAudioEngineFactoryInterface类的具体用法?C++ QAudioEngineFactoryInterface怎么用?C++ QAudioEngineFactoryInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QAudioEngineFactoryInterface类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defaultOutputDevice
QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice()
{
QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default")));
if (plugin) {
QList<QByteArray> list = plugin->deviceList(QAudio::AudioOutput);
if (list.size() > 0)
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioOutput);
}
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultOutputDevice(), QAudio::AudioOutput);
#endif
return QAudioDeviceInfo();
}
示例2: defaultInputDevice
QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice()
{
QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default")));
if (plugin) {
QList<QByteArray> list = plugin->availableDevices(QAudio::AudioInput);
if (list.size() > 0)
return QAudioDeviceInfo(QLatin1String("default"), list.at(0), QAudio::AudioInput);
}
#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
return QAudioDeviceInfo(QLatin1String("builtin"), QAudioDeviceInfoInternal::defaultInputDevice(), QAudio::AudioInput);
#endif
#endif
return QAudioDeviceInfo();
}
示例3: QNullOutputDevice
QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format)
{
if (deviceInfo.isNull())
return new QNullOutputDevice();
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
if (deviceInfo.realm() == QLatin1String("builtin"))
return new QAudioOutputPrivate(deviceInfo.handle(), format);
#endif
QAudioEngineFactoryInterface* plugin =
qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
if (plugin)
return plugin->createOutput(deviceInfo.handle(), format);
return new QNullOutputDevice();
}
示例4: defined
QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &realm, const QByteArray &handle, QAudio::Mode mode)
{
QAbstractAudioDeviceInfo *rc = 0;
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA))
if (realm == QLatin1String("builtin"))
return new QAudioDeviceInfoInternal(handle, mode);
#endif
QAudioEngineFactoryInterface* plugin =
qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(realm));
if (plugin)
rc = plugin->createDeviceInfo(handle, mode);
return rc == 0 ? new QNullDeviceInfo() : rc;
}
示例5: QNullOutputDevice
QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo const& deviceInfo, QAudioFormat const &format)
{
if (deviceInfo.isNull())
return new QNullOutputDevice();
#ifndef QT_NO_AUDIO_BACKEND
#if (defined(Q_OS_WIN) || defined(Q_OS_MAC) || defined(HAS_ALSA) || defined(Q_OS_SYMBIAN))
if (deviceInfo.realm() == QLatin1String("builtin"))
return new QAudioOutputPrivate(deviceInfo.handle(), format);
#endif
#endif
#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
QAudioEngineFactoryInterface* plugin =
qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm()));
if (plugin)
return plugin->createOutput(deviceInfo.handle(), format);
#endif
return new QNullOutputDevice();
}