[mythtv] CD/DVD/Writer Detection and Idea

Matthew Wire devel at mrwire.co.uk
Sat May 27 19:03:54 UTC 2006

On Sat, 2006-05-27 at 19:25 +0100, Matthew Wire wrote:
> 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
> capabilities.  
> 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.
And this time with the attachments...
I realised I'd missed part of the code so I've just created a new patch
which combines cdwriters.diff and cd-capabilities.diff into one.

One thing I don't like at the moment is the hardcoded list of drive
speeds in the setup screen.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: cd-devices.diff
Type: text/x-patch
Size: 34235 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20060527/ba1cb4a1/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythdvd-cddetect.diff
Type: text/x-patch
Size: 3189 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20060527/ba1cb4a1/attachment-0001.bin 

More information about the mythtv-dev mailing list