hal and disc type
hadess at hadess.net
Thu May 6 03:43:13 PDT 2004
On Thu, 2004-05-06 at 11:32 +0200, David Zeuthen wrote:
> I just committed a change yesterday with a number of changes to properties
> related to handling of storage devices - mostly cleanups and sane renaming
> of property keys.
> I did add some code (snitched from dvd+rw-tools, GPL stuff) to test for
> dvd discs and report back the correct type; this was done using some of
> the code Bastien added so I've copied him as well :-)
Did you get the code from the current libbacon CVS?
> So now volume.disc_type (this used to be called storage.cdrom.media_type)
> can assume the following values:
> - audio
> - mixed
> - data
> - blank
> - unknown
> - dvd_rom
> - dvd_r
> - dvd_ram
> - dvd_rw_restricted_overwrite
> - dvd_rw
> - dvd_plus_rw
> - dvd_plus_r
> Note that this corresponds to the type of the *disc* not the type of the
> drive (for optical drives storage.drive_type==cdrom and the booleans
> storage.cdrom.[cdr, cdrw, ..] are set accordingly).
> As I don't have any DVD writers nor media I'm not able to set this, so if
> anyone has the opportunity to provide some feedback it would be great.
> (in fact I'm not even sure what the dvd_rw_restricted_overwrite means, as
> I said I just snitched the code from dvd+rw-tools..)
> Now, I'm still not completely happy about this setup, I mean what value
> will volume.disc_type asssume for a cdrw disc? Or a non-closed cdr disc?
> I mean, desktop environments probably wants to aplly different policies
> (and select different icons) for a CD-R disc that is closed versus open.
I don't think you would really want to use that detection code. You have
2 choices, either you get information from the disc itself, and for
example, DVD+RW discs will appear as DVDs, because the booktype says so.
Otherwise, you can use the code currently in libbacon, and get the
physical type of the disc, which is very likely what you want.
nautilus-cd-burner would use that to know if the CD is blankeable for
If you're looking for data-type on the disc, the current code won't be
precise enough. You want to be able to know if the disc is:
- data only
- audio only
- video DVD
Which gives something useful to the applications. If a data DVD+RW
claims it's a DVD to be able to put it in a set-top DVD appliance, it's
pretty useless to the application writers, or the user...
> How about splitting volume.disc_type into the following properties
> volume.disc_type = audio|cd_rom|cd_r|cd_rw|dvd_rom|dvd_r|dvd_ram|dvd_rw|
> volume.disc_is_mixed = TRUE|FALSE ; TRUE iff there is also audio tracks
> on the disc
> volume.disc_is_closed = TRUE|FALSE ; TRUE iff no (further) writing can
> be done
> volume.disc_capacity = <int64>
> Looks sane?
No quite yet ;)
Bastien Nocera <hadess at hadess.net>
The young fighter had a hungry look, the kind you get from not eating
hal mailing list
hal at freedesktop.org
More information about the Hal