[mythtv] CD/DVD/Writer Detection and Idea

Matthew Wire devel at mrwire.co.uk
Sat May 27 18:25:24 UTC 2006

On Sat, 2006-05-27 at 17:35 +1000, Aaron McCarthy wrote:
> On Saturday 27 May 2006 04:00, Matthew Wire wrote:
> > What I am suggesting is that some sort of cd detection class is created
> > that can be used for all detection needs.  It would need methods such as
> > getCDDriveList, isCD, isDVD, isCDWriter, isDVDWriter (or similar).  This
> > would make cd device selection much simpler in my opinion and the user
> > would not have to deal with device names.
> > For IDE devices, device names can be mapped to the description
> > in /proc/ide/hd*/model.  There must be a similar method for scsi, usb
> > drives.
> > Not sure how/if this would want integration with mythmediamonitor or
> > not?
> > Not sure if USB/Firewire cd devices would show up
> > in /proc/sys/dev/cdrom/info?
> > Also, not sure where this would want to be implemented as yet, though if
> > I read the developer docs a little better I should be able to get a
> > better idea - any help welcome though!
> >
> > Please note that I am quite happy to code this myself, but I want to
> > throw it into the open first to get some opinions and ideas.
> You wont need to do that.  Here is the code that does it.  I wrote this ages 
> ago to go along with some changes to MythGallery to archive photos to DVD.  
> These may not apply to latest SVN anymore.

Updated versions of Aaron's patches to compile against latest SVN.
cdwriters.diff - Adds cd-writer preferences to general setup screen.

cd-capabilities.diff - Add methods for querying cd drives and obtaining
I've added a method getDeviceString and modified detectCapabilities to
allow a isDVDReader property to be used.  getOpticalDevices now takes
two parameters: writeableOnly and dvdOnly.

mythdvd-cddetect.diff - Adds the above detection routines to mythdvd for
dvd and vcd devices.

Please take a look at this code, especially my additions (this is the
first time I've used Qt and it's a while since I've used c++ so I've
probably done some silly things...).  If the code appears ok I'll write
patches for the rest of the plugins to use the detection code.

Matthew Wire

More information about the mythtv-dev mailing list