本文整理汇总了C++中MythMediaDevice::isUsable方法的典型用法代码示例。如果您正苦于以下问题:C++ MythMediaDevice::isUsable方法的具体用法?C++ MythMediaDevice::isUsable怎么用?C++ MythMediaDevice::isUsable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythMediaDevice
的用法示例。
在下文中一共展示了MythMediaDevice::isUsable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventFilter
/**
* Installed into the main window's event chain,
* so that the main thread can safely jump to plugin code.
*/
bool MediaMonitor::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == MythMediaEvent::kEventType)
{
MythMediaDevice *pDev = ((MythMediaEvent*)event)->getDevice();
if (!pDev)
{
VERBOSE(VB_IMPORTANT,
"MediaMonitor::eventFilter() got a bad media event?");
return true;
}
if (pDev->isUsable())
JumpToMediaHandler(pDev);
else
{
// We don't want to jump around in the menus, but should
// call each plugin's callback so it can track this change.
QMap<QString, MHData>::Iterator itr = m_handlerMap.begin();
while (itr != m_handlerMap.end())
{
if ((*itr).MythMediaType & (int)pDev->getMediaType())
(*itr).callback(pDev);
itr++;
}
}
return false; // Don't eat the event
}
// standard event processing
return QObject::eventFilter(obj, event);
}