Ticket #3379: cddec.diff

File cddec.diff, 2.0 KB (added by leoweppelman@…, 17 years ago)

cd-speed patch for mythmusic audio cd's - slow them down

  • playbackbox.cpp

     
    272272        lcd->switchToTime();
    273273}
    274274
    275 bool PlaybackBoxMusic::onMediaEvent(MythMediaDevice*)
     275bool PlaybackBoxMusic::onMediaEvent(MythMediaDevice* pDev)
    276276{
    277277    return scan_for_cd;
    278278}
  • main.cpp

     
    297297void runScan(void);
    298298
    299299
    300 void handleMedia(MythMediaDevice *)
     300void handleMedia(MythMediaDevice *pDev)
    301301{
     302 
     303    // Set the CD/DVD drive on default speed... Although a speed of '1' should
     304    // always be sufficiant for both audio and mp3's and the likes....
     305    int dvdDriveSpeed = gContext->GetNumSetting("DVDDriveSpeed", 2);
     306    pDev->setSpeed(dvdDriveSpeed);
     307
    302308    if (gContext->GetNumSetting("AutoPlayCD", 0))
    303309        runMusicPlayback();
    304310    else
  • 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)
     
    114115        return FALSE;
    115116    }
    116117
     118    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
     119
     120    if (mon != NULL ) {
     121        MythMediaDevice *pMedia = mon->GetMedia(devicename);
     122        if (mon->ValidateAndLock(pMedia))
     123        {
     124            // This should move to mythmedia too.....
     125            int dvdDriveSpeed = gContext->GetNumSetting("DVDDriveSpeed", 2);
     126
     127            pMedia->setSpeed(dvdDriveSpeed);
     128            mon->Unlock(pMedia);
     129        }
     130    }
     131
    117132    cdda_verbose_set(device, CDDA_MESSAGE_FORGETIT, CDDA_MESSAGE_FORGETIT);
    118133    start = cdda_track_firstsector(device, tracknum);
    119134    end = cdda_track_lastsector(device, tracknum);