#1 Burning Software

It is currently Thu Dec 19, 2024 7:26 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to detect if something is written to a CD/DVD?
PostPosted: Mon Jul 24, 2006 11:23 am 
Offline

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 25, 2006 10:01 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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 :)


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
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)?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 9:32 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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)?


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
When do I have to full erase the disc and when its enought to use fast erasing?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 9:38 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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?


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
Is it possible to detect those "problematic" media?
The multi/single-session problem is only for DVD-RW (not DVD+RW, CD-RW)?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 9:52 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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)?


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
Does "StarBurn_CdvdBurnerGrabber_GetTrackInformation" returns "EN_FULL_ERASE_REQUIRED" or do I have to call another function?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 10:05 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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?


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 10:18 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 11:12 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
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.


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

Joined: Fri Oct 14, 2005 10:00 am
Posts: 24
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group