Ticket #3077: default-cd.2.diff

File default-cd.2.diff, 25.0 KB (added by devel@…, 18 years ago)

Updated patch

  • mythtv/libs/libmyth/mythmediamonitor.h

     
    6868
    6969    void MonitorRegisterExtensions(uint mediaType, const QString &extensions);
    7070
     71    // Plugins should use these if they need to access optical disks:
     72    static QString defaultCDdevice();
     73    static QString defaultVCDdevice();
     74    static QString defaultDVDdevice();
     75    static QString defaultWriter();
     76
    7177    virtual QStringList GetCDROMBlockDevices(void) = 0;
    7278
    7379  public slots:
     
    7985    virtual bool AddDevice(MythMediaDevice* pDevice) = 0;
    8086    bool RemoveDevice(const QString &dev);
    8187
     88    static QString   defaultDevice(const QString setting, const QString label);
     89    MythMediaDevice *selectDrivePopup(const QString label, bool mounted=false);
     90
    8291  protected:
    8392    QMutex                       m_DevicesLock;
    8493    QValueList<MythMediaDevice*> m_Devices;
  • mythtv/libs/libmyth/mythmediamonitor.cpp

     
    9595    return str;
    9696}
    9797
     98/**
     99 * \brief Popup a dialog box for the user to select one drive.
     100 * 
     101 * Has to iterate through all devices to check if any are suitable,
     102 * prevent drawing a list if there is only one drive, et cetera
     103 */
     104MythMediaDevice * MediaMonitor::selectDrivePopup(const QString label,
     105                                                 bool          listMounted)
     106{       
     107    QValueList <MythMediaDevice *>           drives;
     108    QValueList <MythMediaDevice *>::iterator it = m_Devices.begin();
     109    QMutexLocker                             locker(&m_DevicesLock);
     110
     111    //while (it != m_Devices.end())
     112    for (it = m_Devices.begin(); it != m_Devices.end(); ++it)
     113    {
     114        // We can't currently tell if a MediaMonitor device is a CD/DVD,
     115        // but if the device is ejectable that's probably safe.
     116        // Caller can also request mounted drives to be listed:
     117
     118        if ((*it)->getAllowEject() || (listMounted && (*it)->isMounted()))
     119            drives.append(*it);
     120
     121        //it++;
     122    }
     123
     124    if (drives.count() == 0)
     125    {
     126        VERBOSE(VB_MEDIA, "MediaMonitor::selectDrivePopup("
     127                          + label + ") - No suitable devices");
     128        return NULL;
     129    }
     130
     131    if (drives.count() == 1)
     132    {
     133        VERBOSE(VB_MEDIA, "MediaMonitor::selectDrivePopup("
     134                          + label + ") - One suitable device");
     135        return drives.front();
     136    }
     137
     138    MythPopupBox box(gContext->GetMainWindow(), "select drive");
     139    box.addLabel(label);
     140    //it = drives.begin();
     141    //while (it != drives.end())
     142    //    box.addButton(DevName(*it++));
     143    for (it = drives.begin(); it != drives.end(); ++it)
     144        box.addButton(DevName(*it));
     145
     146    box.addButton(tr("Cancel"))->setFocus();
     147
     148    int ret = box.ExecPopup();
     149
     150    if ((uint)ret < drives.count())
     151        return drives[ret];
     152
     153    return NULL;
     154}
     155
     156
    98157/** \fn MediaMonitor::ChooseAndEjectMedia(void)
    99158 *  \brief Unmounts and ejects removable media devices.
    100159 *
     
    105164 */
    106165void MediaMonitor::ChooseAndEjectMedia(void)
    107166{
    108     MythMediaDevice *selected = NULL;
     167    MythMediaDevice *selected;
    109168
    110     QMutexLocker locker(&m_DevicesLock);
    111169
    112     if (m_Devices.count() == 1)
    113     {
    114         if (m_Devices.first()->getAllowEject())
    115             selected = m_Devices.first();
    116     }
    117     else if (m_Devices.count() > 1)
    118     {
    119         MythPopupBox ejectbox(gContext->GetMainWindow(), "eject media");
     170    selected = selectDrivePopup(tr("Select removable media to eject"), true);
    120171
    121         ejectbox.addLabel(tr("Select removable media to eject"));
    122 
    123         QValueList <MythMediaDevice *> shownDevices;
    124         QValueList <MythMediaDevice *>::iterator it = m_Devices.begin();
    125         while (it != m_Devices.end())
    126         {
    127             // if the device is ejectable (ie a CD or DVD device)
    128             // or if it is mounted (ie a USB memory stick)
    129             // then add it to the list of choices
    130             if ((*it)->getAllowEject() || (*it)->isMounted(true))
    131             {
    132                 shownDevices.append(*it);
    133                 ejectbox.addButton(DevName(*it));
    134             }
    135 
    136             it++;
    137         }
    138 
    139         ejectbox.addButton(tr("Cancel"))->setFocus();
    140 
    141         int ret = ejectbox.ExecPopup();
    142 
    143         if ((uint)ret < shownDevices.count())
    144             selected = shownDevices[ret];
    145     }
    146     else
     172    if (!selected)
    147173    {
    148174        MythPopupBox::showOkPopup(gContext->GetMainWindow(),
    149175                                  "nothing to eject ",
    150176                                  tr("No devices to eject"));
     177        return;
    151178    }
    152179
    153     if (!selected)
    154         return;
    155 
    156180    bool doEject = false;
    157181    int   status = selected->getStatus();
    158182    QString  dev = DevName(selected);
     
    176200        VERBOSE(VB_MEDIA, QString("Disk %1 is mounted? Unmounting").arg(dev));
    177201        selected->unmount();
    178202
    179         if (selected->isMounted(true))
     203        if (selected->isMounted(true) == MEDIAERR_FAILED)
    180204        {
    181205            MythPopupBox::showOkPopup(gContext->GetMainWindow(),
    182206                                      "eject unmount fail",
     
    438462        pMedia->clearData();
    439463    }
    440464}
     465
     466/*
     467 * These methods return the user's preferred devices for playing and burning
     468 * CDs and DVDs. Traditionally we had a database setting to remember this,
     469 * but that is a bit wasteful when most users only have one drive.
     470 *
     471 * To make it a bit more beginner friendly, if no database default exists,
     472 * or if it contins "default", the code tries to guess the correct drive,
     473 * or put a dialog box up if there are several valid options.
     474 *
     475 * Ideally, these would return a MythMediaDevice * instead of a QString
     476 */
     477
     478QString MediaMonitor::defaultDevice(QString dbSetting, QString label)
     479{
     480    QString device = gContext->GetSetting(dbSetting);
     481
     482    // No settings database defaults. Try to choose one:
     483    if (device.isEmpty() || device == "default")
     484    {
     485        if (!c_monitor)
     486            c_monitor = GetMediaMonitor();
     487
     488        if (c_monitor)
     489        {
     490            MythMediaDevice *d = c_monitor->selectDrivePopup(label);
     491
     492            if (d)
     493                return d->getDevicePath();
     494        }
     495    }
     496
     497    return device;
     498}
     499
     500/**
     501 * CDDevice, user-selected drive, or /dev/cdrom
     502 */
     503QString MediaMonitor::defaultCDdevice()
     504{
     505    QString device = defaultDevice("CDDevice",
     506                                   tr("Select a CD drive"));
     507    if (device.length())
     508        return device;
     509
     510    // Last resort:
     511    return "/dev/cdrom";
     512}
     513
     514/**
     515 * VCDDeviceLocation, user-selected drive, or /dev/cdrom
     516 */
     517QString MediaMonitor::defaultVCDdevice()
     518{
     519    QString device = defaultDevice("VCDDeviceLocation",
     520                                   tr("Select a VCD drive"));
     521    if (device.length())
     522        return device;
     523
     524    // Last resort:
     525    return "/dev/cdrom";
     526}
     527
     528/**
     529 * DVDDeviceLocation, user-selected drive, or /dev/dvd
     530 */
     531QString MediaMonitor::defaultDVDdevice()
     532{
     533    QString device = defaultDevice("DVDDeviceLocation",
     534                                   tr("Select a DVD drive"));
     535    if (device.length())
     536        return device;
     537
     538    // Last resort:
     539    return "/dev/dvd";
     540}
     541
     542/**
     543 * \brief MythArchiveDVDLocation, user-selected drive, or /dev/dvd
     544 *
     545 * This should also look for drives with blanks or RWs in them,
     546 * but Nigel hasn't worked out how to do this tidily (yet).
     547 */
     548QString MediaMonitor::defaultWriter()
     549{
     550    QString device = defaultDevice("MythArchiveDVDLocation",
     551                                   tr("Select a DVD writer"));
     552    if (device.length())
     553        return device;
     554
     555    // Absolute last resort:
     556    return "/dev/dvd";
     557}
  • mythplugins/mythmusic/mythmusic/globalsettings.cpp

     
    4949    return gc;
    5050};
    5151
    52 static HostComboBox *CDDevice()
    53 {
    54     HostComboBox *gc = new HostComboBox("CDDevice", true);
    55     gc->setLabel(QObject::tr("CD device"));
    56     QDir dev("/dev", "cdrom*", QDir::Name, QDir::System);
    57     gc->fillSelectionsFromDir(dev);
    58     dev.setNameFilter("scd*");
    59     gc->fillSelectionsFromDir(dev);
    60     dev.setNameFilter("hd*");
    61     gc->fillSelectionsFromDir(dev);
    62 
    63     dev.setNameFilter("cdrom*");
    64     dev.setPath("/dev/cdroms");
    65     gc->fillSelectionsFromDir(dev);
    66     gc->setHelpText(QObject::tr("CDRom device used for ripping/playback."));
    67     return gc;
    68 };
    69 
    7052static HostLineEdit *TreeLevels()
    7153{
    7254    HostLineEdit *gc = new HostLineEdit("TreeLevels", true);
     
    420402    return gc;
    421403};
    422404
    423 static HostComboBox *CDWriterDevice()
    424 {
    425     HostComboBox *gc = new HostComboBox("CDWriterDevice");
    426 
    427     QString argadd[3]  = { "", "-dev=ATA", "-dev=ATAPI" };
    428     QString prepend[3] = { "", "ATA:", "ATAPI:" };
    429 
    430     for (int i = 0; i < 3; i++)
    431     {
    432         QStringList args;
    433         QStringList result;
    434 
    435         args = "cdrecord";
    436         args += "--scanbus";
    437 
    438         if (argadd[i].length() > 1)
    439             args += argadd[i];
    440 
    441         QString  cmd = args.join(" ");
    442         QProcess proc(args);
    443 
    444         MythTimer totaltimer;
    445    
    446         if (proc.start())
    447         {
    448             totaltimer.start();
    449 
    450             while (1)
    451             {
    452                 while (proc.canReadLineStdout())
    453                     result += proc.readLineStdout();
    454                 if (proc.isRunning())
    455                 {
    456                     qApp->processEvents();
    457                     usleep(10000);
    458                 }
    459                 else
    460                 {
    461                     if (!proc.normalExit())
    462                         VERBOSE(VB_GENERAL,
    463                                 QString("Failed to run '%1'").arg(cmd));
    464                     break;
    465                 }
    466 
    467                 if (totaltimer.elapsed() > 1500)
    468                 {
    469                     //VERBOSE(VB_GENERAL, QString("Killed '%1' after %2ms")
    470                     //                    .arg(cmd).arg(totaltimer.elapsed()));
    471                     proc.kill();
    472                 }
    473             }
    474         }
    475         else
    476             VERBOSE(VB_GENERAL, QString("Failed to run '%1'").arg(cmd));
    477 
    478         while (proc.canReadLineStdout())
    479             result += proc.readLineStdout();
    480 
    481         for (QStringList::Iterator it = result.begin(); it != result.end();
    482              ++it)
    483         {
    484             QString line = *it;
    485             if (line.length() > 12)
    486             {
    487                 if (line[10] == ')' && line[12] != '*')
    488                 {
    489                     QString dev  = prepend[i] + line.mid(1, 5);
    490                     QString name = line.mid(24, 16);
    491 
    492                     gc->addSelection(name, dev);
    493                     VERBOSE(VB_GENERAL, "MythMusic adding CD-Writer: "
    494                                         + dev + " -- " + name);
    495                 }
    496             }
    497         }
    498     }
    499    
    500     gc->setLabel(QObject::tr("CD-Writer Device"));
    501     gc->setHelpText(QObject::tr("Select the SCSI or IDE Device for CD Writing."));
    502     return gc;
    503 };
    504 
    505405static HostComboBox *CDDiskSize()
    506406{
    507407    HostComboBox *gc = new HostComboBox("CDDiskSize");
     
    553453    general->setLabel(QObject::tr("General Settings"));
    554454    general->addChild(SetMusicDirectory());
    555455    general->addChild(MusicAudioDevice());
    556     general->addChild(CDDevice());
    557456    general->addChild(TreeLevels());
    558457    general->addChild(NonID3FileNameFormat());
    559458    general->addChild(IgnoreID3Tags());
     
    566465    VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);
    567466    general2->setLabel(QObject::tr("CD Recording Settings"));
    568467    general2->addChild(CDWriterEnabled());
    569     general2->addChild(CDWriterDevice());
    570468    general2->addChild(CDDiskSize());
    571469    general2->addChild(CDCreateDir());
    572470    general2->addChild(CDWriteSpeed());
  • mythplugins/mythmusic/mythmusic/playlist.cpp

     
    66#include "playlist.h"
    77#include "qdatetime.h"
    88#include <mythtv/mythcontext.h>
     9#include <mythtv/mythmediamonitor.h>
    910#include "smartplaylist.h"
    1011#include <mythtv/mythdbcon.h>
    1112
     
    16011602        return 1;
    16021603    }
    16031604
    1604     QString scsidev = gContext->GetSetting("CDWriterDevice");
    1605     if (scsidev.isEmpty() || scsidev.isNull())
    1606     {
    1607         VERBOSE(VB_GENERAL, "No CD Writer device defined.");
    1608         return 1;
    1609     }
     1605    QString scsidev = MediaMonitor::defaultWriter();
    16101606
    16111607    int disksize = gContext->GetNumSetting("CDDiskSize", 2);
    16121608    QString writespeed = gContext->GetSetting("CDWriteSpeed", "2");
  • mythplugins/mythmusic/mythmusic/cdrip.cpp

     
    167167    sendEvent(ST_TRACK_PROGRESS, 0);
    168168
    169169    QString textstatus;
    170     QString cddevice = gContext->GetSetting("CDDevice");
     170    QString cddevice = MediaMonitor::defaultCDdevice();
    171171    QString encodertype = gContext->GetSetting("EncoderType");
    172172    bool mp3usevbr = gContext->GetNumSetting("Mp3UseVBR", 0);
    173173
     
    734734
    735735void Ripper::scanCD(void)
    736736{
    737     QString cddevice = gContext->GetSetting("CDDevice");
     737    QString cddevice = MediaMonitor::defaultCDdevice();
    738738
    739739    int cdrom_fd = cd_init_device((char*)cddevice.ascii());
    740740    if (cdrom_fd == -1)
     
    11441144
    11451145void Ripper::ejectCD()
    11461146{
    1147     QString cddevice = gContext->GetSetting("CDDevice");
     1147    QString cddevice = MediaMonitor::defaultCDdevice();
    11481148    bool bEjectCD = gContext->GetNumSetting("EjectCDAfterRipping",1);
    11491149    if (bEjectCD)
    11501150    {
  • mythplugins/mythmusic/mythmusic/databasebox.cpp

     
    1818
    1919#include <mythtv/dialogbox.h>
    2020#include <mythtv/mythcontext.h>
     21#include <mythtv/mythmediamonitor.h>   
    2122#include <mythtv/lcddevice.h>
    2223#include <mythtv/uitypes.h>
    2324#include <mythtv/uilistbtntype.h>
     
    409410        return;
    410411    }
    411412
    412     QString scsidev = gContext->GetSetting("CDWriterDevice");
     413    QString scsidev = MediaMonitor::defaultWriter();
    413414    if (scsidev.length()==0)
    414415    {
    415416        VERBOSE(VB_GENERAL, "We don't have SCSI devices");
     
    838839
    839840    if (gContext->GetNumSetting("CDWriterEnabled"))
    840841    {
    841         QString scsidev = gContext->GetSetting("CDWriterDevice");
     842        QString scsidev = MediaMonitor::defaultWriter();
    842843        if (!scsidev.isEmpty() && !scsidev.isNull())
    843844            cdwriter = true;
    844845    }
  • mythplugins/mythmusic/mythmusic/cddecoder.cpp

     
    1313#include "metadata.h"
    1414
    1515#include <mythtv/mythcontext.h>
     16#include <mythtv/mythmediamonitor.h>
    1617
    1718CdDecoder::CdDecoder(const QString &file, DecoderFactory *d, QIODevice *i,
    1819                     AudioOutput *o)
     
    4041
    4142    settracknum = -1;
    4243
    43     devicename = gContext->GetSetting("CDDevice");
     44    devicename = MediaMonitor::defaultCDdevice();
    4445}
    4546
    4647CdDecoder::~CdDecoder(void)
  • mythplugins/mytharchive/mytharchive/archivesettings.cpp

     
    5050    return gc;
    5151};
    5252
    53 static HostLineEdit *MythArchiveDVDLocation()
    54 {
    55     HostLineEdit *gc = new HostLineEdit("MythArchiveDVDLocation");
    56     gc->setLabel(QObject::tr("Location of DVD"));
    57     gc->setValue("/dev/dvd");
    58     gc->setHelpText(QObject::tr("Which DVD drive to use when burning discs."));
    59     return gc;
    60 };
    61 
    6253static HostLineEdit *MythArchiveDVDPlayerCmd()
    6354{
    6455    HostLineEdit *gc = new HostLineEdit("MythArchiveDVDPlayerCmd");
     
    276267    vcg1->addChild(MythArchiveShareDir());
    277268    vcg1->addChild(PALNTSC());
    278269    vcg1->addChild(MythArchiveFileFilter());
    279     vcg1->addChild(MythArchiveDVDLocation());
    280270    vcg1->addChild(MythArchiveDVDPlayerCmd());
    281271    addChild(vcg1);
    282272
  • mythplugins/mytharchive/mytharchivehelper/main.cpp

     
    2323// MythTV headers
    2424#include <mythtv/mythcontext.h>
    2525#include <mythtv/util.h>
    26 #include <mythtv/mythcontext.h>
     26#include <mythtv/mythmediamonitor.h>
    2727#include <mythtv/exitcodes.h>
    2828#include <mythtv/mythdbcon.h>
    2929#include <ffmpeg/avcodec.h>
     
    164164
    165165int burnISOImage(int mediaType, bool bEraseDVDRW, bool nativeFormat)
    166166{
    167     QString dvdDrive = gContext->GetSetting("MythArchiveDVDLocation", "/dev/dvd");
     167    QString dvdDrive = MediaMonitor::defaultWriter();
    168168    VERBOSE(VB_JOBQUEUE, "Burning ISO image to " + dvdDrive);
    169169
    170170    QString tempDirectory = getTempDirectory();
  • mythplugins/mythvideo/mtd/mtd.cpp

     
    1616
    1717#include <mythtv/util.h>
    1818#include <mythtv/mythcontext.h>
     19#include <mythtv/mythmediamonitor.h>
    1920
    2021#include "mtd.h"
    2122#include "logging.h"
     
    173174    //  timer to query whether the thread is done or not
    174175    //
    175176       
    176     QString dvd_device = gContext->GetSetting("DVDDeviceLocation");
    177     if(dvd_device.length() < 1)
    178     {
    179         cerr << "dvdripbox.o: Can't get a value for DVD device location. Did you run setup?" << endl;
    180         exit(0);
    181     }
     177    QString dvd_device = MediaMonitor::defaultDVDdevice();
    182178    dvd_probe = new DVDProbe(dvd_device);
    183179    disc_checking_thread = new DiscCheckingThread(this, dvd_probe, dvd_drive_access, titles_mutex);
    184180    disc_checking_thread->start();
     
    678674
    679675    QString file_name = dir_and_file.section("/", -1, -1);
    680676
     677    QString dvd_device = MediaMonitor::defaultDVDdevice();
    681678
    682     QString dvd_device = gContext->GetSetting("DVDDeviceLocation");
    683     if(dvd_device.length() < 1)
    684     {
    685         emit writeToLog("crapity crap crap - all set to launch a dvd job and you don't have a dvd device defined");
    686         return;
    687     }
    688 
    689679    //
    690680    //  OK, we are ready to launch this job
    691681    //
  • mythplugins/mythvideo/mythvideo/globalsettings.cpp

     
    272272
    273273// General Settings
    274274
    275 HostLineEdit *SetVCDDevice()
    276 {
    277     HostLineEdit *gc = new HostLineEdit("VCDDeviceLocation");
    278     gc->setLabel(QObject::tr("Location of VCD device"));
    279     gc->setValue("/dev/cdrom");
    280     gc->setHelpText(QObject::tr("This device must exist, and the user "
    281                     "running MythDVD needs to have read permission "
    282                     "on the device."));
    283     return gc;
    284 }
    285 
    286 HostLineEdit *SetDVDDevice()
    287 {
    288     HostLineEdit *gc = new HostLineEdit("DVDDeviceLocation");
    289     gc->setLabel(QObject::tr("Location of DVD device"));
    290     gc->setValue("/dev/dvd");
    291     gc->setHelpText(QObject::tr("This device must exist, and the user "
    292                     "running MythDVD needs to have read permission "
    293                     "on the device."));
    294     return gc;
    295 }
    296 
    297275HostComboBox *SetOnInsertDVD()
    298276{
    299277    HostComboBox *gc = new HostComboBox("DVDOnInsertDVD");
     
    557535            new VerticalConfigurationGroup(false);
    558536    general3->setLabel(QObject::tr("General Settings (%1/%2)")
    559537                       .arg(3).arg(pages));
    560     general3->addChild(SetDVDDevice());
    561     general3->addChild(SetVCDDevice());
    562538    general3->addChild(SetOnInsertDVD());
    563539    general3->addChild(SetDVDDriveSpeed());
    564540    general3->addChild(new DVDBookmarkSettings());
  • mythplugins/mythvideo/mythvideo/main.cpp

     
    1717#include <mythtv/lcddevice.h>
    1818#include <mythtv/libmythui/myththemedmenu.h>
    1919#include <mythtv/mythpluginapi.h>
     20#include <mythtv/mythmediamonitor.h>
    2021#include <mythtv/mythmedia.h>
    2122#include <mythtv/util.h>
    2223
     
    251252                //
    252253                //  Need to do device substitution
    253254                //
    254                 QString vcd_device = gContext->GetSetting("VCDDeviceLocation");
    255                 if(vcd_device.length() < 1)
    256                 {
    257                     //
    258                     //  RTF README
    259                     //
    260                     DialogBox *no_device_dialog =
    261                             new DialogBox(gContext->GetMainWindow(),
    262                             QObject::tr("\n\nYou have no VCD Device defined."));
    263                     no_device_dialog->
    264                             AddButton(QObject::tr("OK, I'll go run Setup"));
    265                     no_device_dialog->exec();
    266 
    267                     delete no_device_dialog;
    268                     gContext->removeCurrentLocation();
    269 
    270                     return;
    271                 }
    272                 else
    273                 {
    274                     command_string =
    275                             command_string.replace(QRegExp("%d"), vcd_device);
    276                 }
     255                QString vcd_device = MediaMonitor::defaultVCDdevice();
     256                command_string
     257                    = command_string.replace(QRegExp("%d"), vcd_device);
    277258            }
    278259            myth_system(command_string);
    279260            gContext->GetMainWindow()->raise();
     
    296277        QString dvd_device = gDVDdevice;
    297278
    298279        if (dvd_device.isNull())
    299             dvd_device = gContext->GetSetting("DVDDeviceLocation");
     280            dvd_device = MediaMonitor::defaultDVDdevice();
    300281
    301         if(dvd_device.length() < 1)
    302         {
    303             //
    304             //  RTF README
    305             //
    306             DialogBox *no_device_dialog =
    307                     new DialogBox(gContext->GetMainWindow(),
    308                     QObject::tr("\n\nYou have no DVD Device defined."));
    309             no_device_dialog->AddButton(QObject::tr("OK, I'll go run Setup"));
    310             no_device_dialog->exec();
    311 
    312             delete no_device_dialog;
    313             gContext->removeCurrentLocation();
    314 
    315             return;
    316         }
    317 
    318282        gContext->addCurrentLocation("playdvd");
    319283
    320284        if ((command_string.find("internal", 0, false) > -1) ||
  • mythplugins/mythvideo/mythvideo/dvdripbox.cpp

     
    1414using namespace std;
    1515
    1616#include <mythtv/mythcontext.h>
     17#include <mythtv/mythmediamonitor.h>
    1718#include <mythtv/uitypes.h>
    1819
    1920#include "dvdripbox.h"
     
    138139    //  timer to query whether the thread is done or not
    139140    //
    140141       
    141     QString dvd_device = gContext->GetSetting("DVDDeviceLocation");
    142     if(dvd_device.length() < 1)
    143     {
    144         cerr << "dvdripbox.o: Can't get a value for DVD device location. Did you run setup?" << endl;
    145         exit(0);
    146     }
     142    QString dvd_device = MediaMonitor::defaultDVDdevice();
    147143    dvd_info = NULL;
    148144    disc_checking_timer = new QTimer();
    149145    disc_checking_timer->start(600);
  • mythplugins/mythvideo/mythvideo/titledialog.cpp

     
    1717
    1818#include <mythtv/util.h>
    1919#include <mythtv/uitypes.h>
     20#include <mythtv/mythmediamonitor.h>
    2021
    2122#include "titledialog.h"
    2223
     
    324325        return;
    325326    }
    326327
    327     QString dvd_device = gContext->GetSetting("DVDDeviceLocation");
    328     if(dvd_device.length() < 1)
    329     {
    330         cerr << "titledialog.o: No DVD device defined" << endl;
    331         return;
    332     }
     328    QString dvd_device = MediaMonitor::defaultDVDdevice();
    333329   
    334330    int audio_track = 1;
    335331    int channels = 2;
     
    366362            player_string += player_append;
    367363        }
    368364    }
    369     // cout << "PLAYER STRING: " << player_string << endl;
    370 
     365    cout << "PLAYER STRING: " << player_string << endl;
     366   
    371367    myth_system(player_string);
    372368    gContext->GetMainWindow()->raise();
    373369    gContext->GetMainWindow()->setActiveWindow();