[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio
From: |
Rocky Bernstein |
Subject: |
Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio |
Date: |
Thu, 28 Jan 2010 05:19:54 -0500 |
Yes, I think libcdio should have a mmc_get_discmode, so additions are most
welcome here.
I had thought recent work that Thomas added here covered this, but I don't
see it. Perhaps I was thinking about information he recently added to the
libcdio glossary under "Media models and profiles" which may be of some
help?
On Wed, Jan 27, 2010 at 1:10 PM, Frank Endres <address@hidden>wrote:
> 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 "http://www.13thmonkey.org/documentation/SCSI/mmc-r10a.pdf,"
> 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 (http://simpleburn.tuxfamily.org - 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 http://www.13thmonkey.org/documentation/SCSI/mmc-r10a.pdf, tables
> 129-134.
> @return true if the disc is erasable (rewritable), false otherwise.
> */
> bool
> mmc_get_disc_erasable ( const CdIo_t *p_cdio) {
> mmc_cdb_t cdb = {{0, }};
>
> uint8_t buf[42] = { 0, };
>
> CDIO_MMC_SET_COMMAND (cdb.field, CDIO_MMC_GPCMD_READ_DISC_INFO);
> 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;
> else
> 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
>
- [Libcdio-devel] Re: Submission of new mmc function for libcdio, Frank Endres, 2010/01/27
- [Libcdio-devel] Re: Submission of new mmc function for libcdio, Thomas Schmitt, 2010/01/27
- Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio,
Rocky Bernstein <=
- [Libcdio-devel] Re: Submission of new mmc function for libcdio, Thomas Schmitt, 2010/01/28
- Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio, Frank Endres, 2010/01/28
- Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio, Rocky Bernstein, 2010/01/28
- Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio, Rocky Bernstein, 2010/01/28
- [Libcdio-devel] Re: Submission of new mmc function for libcdio, Thomas Schmitt, 2010/01/29
- Re: [Libcdio-devel] Re: Submission of new mmc function for libcdio, Rocky Bernstein, 2010/01/29