Ticket #2990: cdrip.diff

File cdrip.diff, 1.8 KB (added by paulh, 17 years ago)

Patch to disable MediaMonitor? while ripping cds

  • mythmusic/mythmusic/cdrip.cpp

     
    3030#include <mythtv/mythwidgets.h>
    3131#include <mythtv/lcddevice.h>
    3232#include <mythtv/dialogbox.h>
     33#include <mythtv/mythmediamonitor.h>
    3334
    3435// MythMusic includes
    3536#include "cdrip.h"
     
    367368Ripper::Ripper(MythMainWindow *parent, const char *name)
    368369      : MythThemedDialog(parent, "cdripper", "music-", name, true)
    369370{
     371#ifndef _WIN32
     372    // if the MediaMonitor is running stop it
     373    m_mediaMonitorActive = false;
     374    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
     375    if (mon && mon->IsActive())
     376    {
     377        m_mediaMonitorActive = true;
     378        mon->StopMonitoring();
     379    }
     380#endif
     381
    370382    // Set this to false so we can tell if the ripper has done anything
    371383    // (i.e. we can tell if the user quit prior to ripping)
    372384    m_somethingwasripped = false;
     
    381393{
    382394    if (m_decoder)
    383395        delete m_decoder;
     396
     397#ifndef _WIN32
     398    // if the MediaMonitor was active when we started then restart it
     399    if (m_mediaMonitorActive)
     400    {
     401        MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
     402        if (mon)
     403            mon->StartMonitoring();
     404    }
     405#endif
    384406}
    385407
    386408void Ripper::wireupTheme(void)
  • mythmusic/mythmusic/cdrip.h

     
    145145    QString            m_albumName, m_artistName, m_genreName, m_year;
    146146    QStringList        m_searchList;
    147147    bool               m_somethingwasripped;
     148    bool               m_mediaMonitorActive;
    148149};
    149150
    150151