add media type to hal

Bastien Nocera hadess at hadess.net
Thu Mar 25 17:02:23 EET 2004


Hey Robert,

On Wed, 2004-03-24 at 19:58 -0500, Robert Love wrote:
> Hey, David.
> 
> Following patch adds a "storage.cdrom.media_type" string property to
> CD-ROM discs, which describes the type of disc media.  Credit for this
> idea goes to Bastien Nocera.

I didn't bring up the idea, I whinged ;)

> Aside from being genuinely useful information, I have a larger plan: I
> want to get rid of Linux-specific code in g-v-m and have it rely on HAL
> 100% - that is the point of HAL, after all.
> 
> Currently, the valid values for "storage.cdrom.media_type" are "audio",
> "iso9660", "mixed", "blank", and "unknown".

One small comment below.

> Patch is against today's CVS.
<snip>
> +			switch (type) {
> +			case CDS_AUDIO:		/* audio CD */
> +				ds_property_set_string (child,
> +						"storage.cdrom.media_type",
> +						"audio");
> +				break;
> +			case CDS_MIXED:		/* mixed mode CD (CD Plus) */
> +				ds_property_set_string (child,
> +						"storage.cdrom.media_type",
> +						"mixed");
> +				break;
> +			case CDS_DATA_1:	/* data CD */
> +			case CDS_DATA_2:
> +			case CDS_XA_2_1:
> +			case CDS_XA_2_2:
> +				ds_property_set_string (child,
> +						"storage.cdrom.media_type",
> +						"iso9660");
> +				break;

CDS_XA_* aren't really iso9660. They're a bit like mixed CDs, the only
difference between the 2 is what the main purpose is for the CD: CD
Extra has a data track at the end (main purpose is audio playback), the
Mixed CD has it at the front (main purpose is the data, with bonus
tracks at the end, like some old games or magazine CDs used to have).

BTW, CD Plus is the old name for CD Extra, a Mixed CD isn't a CD Plus :)

---
Bastien Nocera <hadess at hadess.net> 
If at first you don't succeed, remove all evidence you ever tried.





More information about the xdg mailing list