RocketDivision.Com Forum IndexRocketDivision.Com
RDS - software that rocks!
 
 FAQFAQ             
        

How to detect if something is written to a CD/DVD?
Goto page 1, 2  Next
 
      RocketDivision.Com Forum Index -> StarBurn SDK
View previous topic :: View next topic  
AuthorMessage
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Mon Jul 24, 2006 11:23 am    Post subject: How to detect if something is written to a CD/DVD?

Hi,

I have some trouble to detect if I can write to a CD/DVD or if I have to erase it before writing.

What I want to do:

Code:
if MediumFull then
  EraseMedium;

WriteToMedium;


I don't want multisession. If there is anything written to the medium it should be erased before writing. The tricky part is the function MediumFull. It seems that every kind of media (CD, CD-RW, DVD+RW, DVD-RW, DVD+R, DVD-R) has its own opinion. I can't rely on DiscStatus because it says "DISC_STATUS_INCOMPLETE" for an fresh DVD+RW. I thought it would be "DISC_STATUS_EMPTY", but no way. An erased DVD+RW says it is "DISC_STATUS_COMPLETE" and I have to check the OccupDiscSize to see that there is nothing written on it. The same fails for and CD-RW. There are some other combinations of media and results of discstatus/trackinformation/discsizeinfo which have to be checked. I'm afraid that I miss something here.
Is there any safe method to examine if I can write to the disc or not?

Regards,
Steffen
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Tue Jul 25, 2006 10:01 pm    Post subject:

Get track information about TRACK_NUMBER_INVISIBLE. If NextWritableAddress is not zero - disc was recorded and you want to erase it. If you cannot get track info for this track - disc is recorded and session closes with no next session allowed, thus again you want to erase it Smile
_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 8:43 am    Post subject:

Thanks this is the easy way I want to know.
Could it be that "StarBurn_CdvdBurnerGrabber_GetTrackInformation" fails (sbException EN_SUCCESS) because of other reasons (e.g. Disc not readable)?
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Wed Jul 26, 2006 9:32 am    Post subject:

In theory - yes. But you'd have to erase the media in any case (full erase) if it happens.

stebi wrote:
Thanks this is the easy way I want to know.
Could it be that "StarBurn_CdvdBurnerGrabber_GetTrackInformation" fails (sbException EN_SUCCESS) because of other reasons (e.g. Disc not readable)?

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 9:35 am    Post subject:

When do I have to full erase the disc and when its enought to use fast erasing?
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Wed Jul 26, 2006 9:38 am    Post subject:

Full erase is required when you're trying to recover "problematic" media. And when you have DVD-RW media and you want to use in in single session mode (and it was recorded in multisession) and vice versa.

stebi wrote:
When do I have to full erase the disc and when its enought to use fast erasing?

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 9:44 am    Post subject:

Is it possible to detect those "problematic" media?
The multi/single-session problem is only for DVD-RW (not DVD+RW, CD-RW)?
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Wed Jul 26, 2006 9:52 am    Post subject:

1) StarBurn would return XXX_FULL_ERASE_REQUIRED in this case.

2) Only DVD-RW.

stebi wrote:
Is it possible to detect those "problematic" media?
The multi/single-session problem is only for DVD-RW (not DVD+RW, CD-RW)?

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 9:57 am    Post subject:

Does "StarBurn_CdvdBurnerGrabber_GetTrackInformation" returns "EN_FULL_ERASE_REQUIRED" or do I have to call another function?
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Wed Jul 26, 2006 10:05 am    Post subject:

No. Burning APIs would fail with this code.

stebi wrote:
Does "StarBurn_CdvdBurnerGrabber_GetTrackInformation" returns "EN_FULL_ERASE_REQUIRED" or do I have to call another function?

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 10:07 am    Post subject:

Another question: How to detect if a disc is multisession or single session?

Is this assumption right?

Multisession: m__LONG__NextWritableAddress 0
Singlesession: StarBurn_CdvdBurnerGrabber_GetTrackInformation fails because disc is closed
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Wed Jul 26, 2006 10:18 am    Post subject:

GetTOCInformation and parse TOC structure.

stebi wrote:
Another question: How to detect if a disc is multisession or single session?

Is this assumption right?

Multisession: m__LONG__NextWritableAddress 0
Singlesession: StarBurn_CdvdBurnerGrabber_GetTrackInformation fails because disc is closed

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 11:05 am    Post subject:

Sorry, but I don't know what values to look for in the TOC structure. A single session (video) dvd says TOC.m__UCHAR__NumberOfSessions = 1. I assume a multisession dvd with only one session is identical.
Back to top
anton (staff)
Site Admin


Joined: 18 Jun 2004
Posts: 1459
Location: Ukraine

PostPosted: Wed Jul 26, 2006 11:12 am    Post subject:

1) NumberOfSessions and disc status (closed or not).

2) What exactly are you trying to do?

3) Create separate thread for each question. Difficult to maintain...

stebi wrote:
Sorry, but I don't know what values to look for in the TOC structure. A single session (video) dvd says TOC.m__UCHAR__NumberOfSessions = 1. I assume a multisession dvd with only one session is identical.

_________________
Regards,
Anton Kolomyeytsev

Rocket Division Software
Back to top
stebi



Joined: 14 Oct 2005
Posts: 22

PostPosted: Wed Jul 26, 2006 12:05 pm    Post subject:

1) Ok.
2) I want to erase if a user has inserted full disc. Because I write a single session disc I want to use full erase if it is a multisession-DVD-RW is inserted otherwise I use fast erase.
3) Ok for next question.
Back to top
      RocketDivision.Com Forum Index -> StarBurn SDK
Goto page 1, 2  Next
Page 1 of 2