本文整理汇总了C++中AudioDecoder::initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioDecoder::initialize方法的具体用法?C++ AudioDecoder::initialize怎么用?C++ AudioDecoder::initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AudioDecoder
的用法示例。
在下文中一共展示了AudioDecoder::initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void AudioPluginCache::load(const QDir &dir)
{
qDebug() << Q_FUNC_INFO << dir.path();
/* Check that we can access the directory */
if (dir.exists() == false || dir.isReadable() == false)
return;
/* Loop through all files in the directory */
QStringListIterator it(dir.entryList());
while (it.hasNext() == true)
{
/* Attempt to load a plugin from the path */
QString fileName(it.next());
QString path = dir.absoluteFilePath(fileName);
QPluginLoader loader(path, this);
AudioDecoder* ptr = qobject_cast<AudioDecoder*> (loader.instance());
if (ptr != NULL)
{
qDebug() << "Loaded audio decoder plugin from" << fileName;
/* Just append the plugin path to be used at runtime
* for dynamic creation of instances */
ptr->initialize("");
m_pluginsPathList << path;
loader.unload();
}
else
qDebug() << "Failed to load plugin: " << loader.errorString();
}
}
示例2: getSupportedFormats
QStringList AudioPluginCache::getSupportedFormats()
{
QStringList caps;
foreach(QString path, m_pluginsPathList)
{
QPluginLoader loader(path, this);
AudioDecoder* ptr = qobject_cast<AudioDecoder*> (loader.instance());
if (ptr != NULL)
{
ptr->initialize("");
caps << ptr->supportedFormats();
loader.unload();
}
}