Ticket #9520: 1057-mediamonitor-medias.diff

File 1057-mediamonitor-medias.diff, 3.3 KB (added by Lawrence Rust <lvr@…>, 14 years ago)
  • mythtv/libs/libmyth/mythmediamonitor.cpp

    diff --git mythtv/libs/libmyth/mythmediamonitor.cpp mythtv/libs/libmyth/mythmediamonitor.cpp
    index 3dac2ff..3743f6e 100644
    void MediaMonitor::StopMonitoring(void) 
    446446 *
    447447 *   NOTE: This function can block.
    448448 *
    449  *  \sa Unlock(MythMediaDevice *pMedia), GetMedias(MediaType mediatype)
     449 *  \sa Unlock(MythMediaDevice *pMedia), GetMedias(unsigned mediatypes)
    450450 */
    451451bool MediaMonitor::ValidateAndLock(MythMediaDevice *pMedia)
    452452{
    bool MediaMonitor::ValidateAndLock(MythMediaDevice *pMedia) 
    463463/** \fn MediaMonitor::Unlock(MythMediaDevice *pMedia)
    464464 *  \brief decrements the MythMediaDevices reference count
    465465 *
    466  *  \sa ValidateAndLock(MythMediaDevice *pMedia), GetMedias(MediaType mediatype)
     466 *  \sa ValidateAndLock(MythMediaDevice *pMedia), GetMedias(unsigned mediatypes)
    467467 */
    468468void MediaMonitor::Unlock(MythMediaDevice *pMedia)
    469469{
    QString MediaMonitor::GetMountPath(const QString& devPath) 
    530530    return mountPath;
    531531}
    532532
    533 /** \fn MediaMonitor::GetMedias(MediaType mediatype)
     533/** \fn MediaMonitor::GetMedias(unsigned mediatypes)
    534534 *  \brief Ask for available media. Must be locked with ValidateAndLock().
    535535 *
    536536 *   This method returns a list of MythMediaDevice pointers which match
    QString MediaMonitor::GetMountPath(const QString& devPath) 
    548548 *  \sa ValidateAndLock(MythMediaDevice *pMedia)
    549549 *  \sa Unlock(MythMediaDevice *pMedia)
    550550 */
    551 QList<MythMediaDevice*> MediaMonitor::GetMedias(MediaType mediatype)
     551QList<MythMediaDevice*> MediaMonitor::GetMedias(unsigned mediatypes)
    552552{
    553553    QMutexLocker locker(&m_DevicesLock);
    554554
    QList<MythMediaDevice*> MediaMonitor::GetMedias(MediaType mediatype) 
    557557    QList<MythMediaDevice*>::iterator it = m_Devices.begin();
    558558    for (;it != m_Devices.end(); it++)
    559559    {
    560         if (((*it)->getMediaType() == mediatype) &&
     560        if (((*it)->getMediaType() & mediatypes) &&
    561561            (((*it)->getStatus() == MEDIASTAT_USEABLE) ||
    562562             ((*it)->getStatus() == MEDIASTAT_MOUNTED) ||
    563563             ((*it)->getStatus() == MEDIASTAT_NOTMOUNTED)))
    void MediaMonitor::JumpToMediaHandler(MythMediaDevice* pMedia) 
    633633    {
    634634        if (((*itr).MediaType & (int)pMedia->getMediaType()))
    635635        {
    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()) );
    637638            handlers.append(*itr);
    638639        }
    639640        itr++;
  • mythtv/libs/libmyth/mythmediamonitor.h

    diff --git mythtv/libs/libmyth/mythmediamonitor.h mythtv/libs/libmyth/mythmediamonitor.h
    index ff70f0f..5c2e4bc 100644
    class MPUBLIC MediaMonitor : public QObject 
    7373    // first validate the pointer with ValidateAndLock(), if true is returned
    7474    // it is safe to dereference the pointer. When finished call Unlock()
    7575    QList<MythMediaDevice*> GetRemovable(bool mounted=false);
    76     QList<MythMediaDevice*> GetMedias(MediaType mediatype);
     76    QList<MythMediaDevice*> GetMedias(unsigned mediatypes);
    7777    MythMediaDevice*        GetMedia(const QString &path);
    7878
    7979    void MonitorRegisterExtensions(uint mediaType, const QString &extensions);