diff --git mythtv/libs/libmyth/mythmediamonitor.cpp mythtv/libs/libmyth/mythmediamonitor.cpp
index 3dac2ff..3743f6e 100644
|
|
|
void MediaMonitor::StopMonitoring(void)
|
| 446 | 446 | * |
| 447 | 447 | * NOTE: This function can block. |
| 448 | 448 | * |
| 449 | | * \sa Unlock(MythMediaDevice *pMedia), GetMedias(MediaType mediatype) |
| | 449 | * \sa Unlock(MythMediaDevice *pMedia), GetMedias(unsigned mediatypes) |
| 450 | 450 | */ |
| 451 | 451 | bool MediaMonitor::ValidateAndLock(MythMediaDevice *pMedia) |
| 452 | 452 | { |
| … |
… |
bool MediaMonitor::ValidateAndLock(MythMediaDevice *pMedia)
|
| 463 | 463 | /** \fn MediaMonitor::Unlock(MythMediaDevice *pMedia) |
| 464 | 464 | * \brief decrements the MythMediaDevices reference count |
| 465 | 465 | * |
| 466 | | * \sa ValidateAndLock(MythMediaDevice *pMedia), GetMedias(MediaType mediatype) |
| | 466 | * \sa ValidateAndLock(MythMediaDevice *pMedia), GetMedias(unsigned mediatypes) |
| 467 | 467 | */ |
| 468 | 468 | void MediaMonitor::Unlock(MythMediaDevice *pMedia) |
| 469 | 469 | { |
| … |
… |
QString MediaMonitor::GetMountPath(const QString& devPath)
|
| 530 | 530 | return mountPath; |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | | /** \fn MediaMonitor::GetMedias(MediaType mediatype) |
| | 533 | /** \fn MediaMonitor::GetMedias(unsigned mediatypes) |
| 534 | 534 | * \brief Ask for available media. Must be locked with ValidateAndLock(). |
| 535 | 535 | * |
| 536 | 536 | * This method returns a list of MythMediaDevice pointers which match |
| … |
… |
QString MediaMonitor::GetMountPath(const QString& devPath)
|
| 548 | 548 | * \sa ValidateAndLock(MythMediaDevice *pMedia) |
| 549 | 549 | * \sa Unlock(MythMediaDevice *pMedia) |
| 550 | 550 | */ |
| 551 | | QList<MythMediaDevice*> MediaMonitor::GetMedias(MediaType mediatype) |
| | 551 | QList<MythMediaDevice*> MediaMonitor::GetMedias(unsigned mediatypes) |
| 552 | 552 | { |
| 553 | 553 | QMutexLocker locker(&m_DevicesLock); |
| 554 | 554 | |
| … |
… |
QList<MythMediaDevice*> MediaMonitor::GetMedias(MediaType mediatype)
|
| 557 | 557 | QList<MythMediaDevice*>::iterator it = m_Devices.begin(); |
| 558 | 558 | for (;it != m_Devices.end(); it++) |
| 559 | 559 | { |
| 560 | | if (((*it)->getMediaType() == mediatype) && |
| | 560 | if (((*it)->getMediaType() & mediatypes) && |
| 561 | 561 | (((*it)->getStatus() == MEDIASTAT_USEABLE) || |
| 562 | 562 | ((*it)->getStatus() == MEDIASTAT_MOUNTED) || |
| 563 | 563 | ((*it)->getStatus() == MEDIASTAT_NOTMOUNTED))) |
| … |
… |
void MediaMonitor::JumpToMediaHandler(MythMediaDevice* pMedia)
|
| 633 | 633 | { |
| 634 | 634 | if (((*itr).MediaType & (int)pMedia->getMediaType())) |
| 635 | 635 | { |
| 636 | | VERBOSE(VB_IMPORTANT, "Found a handler - '" + itr.key() + "'"); |
| | 636 | VERBOSE(VB_IMPORTANT, QString("Found a handler for %1 - '%2'"). |
| | 637 | arg(pMedia->MediaTypeString()).arg(itr.key()) ); |
| 637 | 638 | handlers.append(*itr); |
| 638 | 639 | } |
| 639 | 640 | itr++; |
diff --git mythtv/libs/libmyth/mythmediamonitor.h mythtv/libs/libmyth/mythmediamonitor.h
index ff70f0f..5c2e4bc 100644
|
|
|
class MPUBLIC MediaMonitor : public QObject
|
| 73 | 73 | // first validate the pointer with ValidateAndLock(), if true is returned |
| 74 | 74 | // it is safe to dereference the pointer. When finished call Unlock() |
| 75 | 75 | QList<MythMediaDevice*> GetRemovable(bool mounted=false); |
| 76 | | QList<MythMediaDevice*> GetMedias(MediaType mediatype); |
| | 76 | QList<MythMediaDevice*> GetMedias(unsigned mediatypes); |
| 77 | 77 | MythMediaDevice* GetMedia(const QString &path); |
| 78 | 78 | |
| 79 | 79 | void MonitorRegisterExtensions(uint mediaType, const QString &extensions); |