当前位置: 首页>>代码示例>>C++>>正文


C++ QAudioEngineFactoryInterface类代码示例

本文整理汇总了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();
}
开发者ID:dtbinh,项目名称:dviz,代码行数:14,代码来源:qaudiodevicefactory.cpp

示例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();
}
开发者ID:,项目名称:,代码行数:16,代码来源:

示例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();
}
开发者ID:dtbinh,项目名称:dviz,代码行数:16,代码来源:qaudiodevicefactory.cpp

示例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;
}
开发者ID:dtbinh,项目名称:dviz,代码行数:16,代码来源:qaudiodevicefactory.cpp

示例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();
}
开发者ID:PNIDigitalMedia,项目名称:emscripten-qt,代码行数:19,代码来源:qaudiodevicefactory.cpp


注:本文中的QAudioEngineFactoryInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。