本文整理汇总了C++中MythMediaDevice::getMediaType方法的典型用法代码示例。如果您正苦于以下问题:C++ MythMediaDevice::getMediaType方法的具体用法?C++ MythMediaDevice::getMediaType怎么用?C++ MythMediaDevice::getMediaType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythMediaDevice
的用法示例。
在下文中一共展示了MythMediaDevice::getMediaType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mediaEvent
/**
* \copydoc MythUIType::mediaEvent()
*/
void MythThemedMenu::mediaEvent(MythMediaEvent* event)
{
if (!event)
return;
MythMediaDevice *device = event->getDevice();
if (!device)
return;
MythMediaType type = device->getMediaType();
MythMediaStatus status = device->getStatus();
if ((status & ~MEDIASTAT_USEABLE) &&
(status & ~MEDIASTAT_MOUNTED))
return;
switch (type)
{
case MEDIATYPE_DVD :
// DVD Available
break;
case MEDIATYPE_BD :
// Blu-ray Available
break;
default :
return;
}
}
示例2: 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);
}