[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] Re: Submission of new mmc function for libcdio

From: Frank Endres
Subject: [Libcdio-devel] Re: Submission of new mmc function for libcdio
Date: Wed, 27 Jan 2010 17:10:28 -0100

Hi !

I use libcdio for only a short time, and found it easy to use (good examples
and documentation), except for mmc commands. Now, after long searches, I
have understood how it works, and I have a suggestion:
add a link to ",";
on your doc (mmc.h - if not already done, maybe I haven't looked in the
right place).

I want to use libcdio as an alternate method for device and media detection
in my SimpleBurn project ( - wait untill next
version to have that libcdio detection feature). I wanted a function to tell
me if a CD is rewritable or not, and didn't find it, so I wrote one (I have
seen no other solution than using a mmc command); if you find it usefull,
you can add it into libcdio:

   Detects if a disc (CD or DVD) is erasable or not.
   See, tables
   @return true if the disc is erasable (rewritable), false otherwise.
mmc_get_disc_erasable ( const CdIo_t *p_cdio) {
  mmc_cdb_t cdb = {{0, }};

  uint8_t buf[42] = { 0, };

  CDIO_MMC_SET_READ_LENGTH8 (cdb.field, sizeof(buf));

  mmc_run_cmd (p_cdio, 0, &cdb, SCSI_MMC_DATA_READ, sizeof(buf), &buf);

  if (buf[2] & 0x10) //works even if the 'mmc_run_cmd' command fails
    return true;
    return false;

If I have understood the source, even cdw doesn't use libcdio to detect a
device type (it uses dvd+rw-tools or cdrtools output I guess). It could be
interesting to add a feature to get more information on discs: (add some
values to (mmc)discmode_t enumeration for example: CDIO_DISC_MODE_CD_R,
CDIO_DISC_MODE_CD_RW, CDIO_DISC_MODE_CD_ROM), and a new function like:
"mmcdiscmode_t mmc_get_discmode (CdIo *p_cdio)". Tell me if you are
interested in this feature.

Best regards !

Frank Endres

reply via email to

[Prev in Thread] Current Thread [Next in Thread]