Hi,
Yes, good question, I'm not sure either. But IMAPI has a notification for it (IDiscMasterProgressEvents::NotifyPreparingBurn (long nEstimatedSeconds) (which does get called) and I noticed that when burning an SAO disc Starburn issues one CN_CDVD_WRITE_PROGRESS callback immediately but then does not issue another one for quite a while (several seconds). Perhaps you can educate me as to what might be going on here.
In fact, now I think things over a bit more, I'd like to modify my request slightly. I try to estimate the time that will be needed for all phases of a burn (including erase, if appropriate) before I start. I then add these up and display an 'approximate time to go' figure, and I then do my best to keep that up to date as things progress.
But to do this, I need to know how long each phase will take 'up front'. I currently guesstimate these, based on timings I have actually measured, but this varies from drive to drive, and also on whether you are burning a write-once or a rewriteable disc, whether the disc already contains data, whether you plan to finalise it, whether it is an audio disc or a data disc, etc. etc.
At the risk of boring you, here's a code snippet to try and explain what I am up to (my estimates are expressed in CD blocks, rather than seconds):
Code:
// As returned by GetBlockCounts
typedef struct
{
int erase_blocks; // for estimating burn times
int prepare_blocks;
int close_blocks;
} CDB_BLOCK_COUNTS;
// Returns timings (in blocks) for erase, prepare and close session
// Close blocks are a slight over-estimate
int CDBurnerStarBurn::GetBlockCounts (int image_type, int media_type,
int burn_mode, bool multi_session, CDB_BLOCK_COUNTS *block_counts)
{
...
if (image_type == CDB_AUDIO_CD) // Audio CD
{ // @ 4x (= 4 x 75 blks per sec)
switch (burn_mode)
{
case CDB_BURNMODE_TAO:
block_counts->close_blocks = 28000;
break;
case CDB_BURNMODE_SAO:
block_counts->prepare_blocks = 13500;
block_counts->close_blocks = 16000;
break;
case CDB_BURNMODE_DAO_PQ:
block_counts->prepare_blocks = 16000;
block_counts->close_blocks = 12000;
break;
case CDB_BURNMODE_DAO_RAWPW:
block_counts->prepare_blocks = 13500;
block_counts->close_blocks = 12000;
break;
}
}
else // Joliet CD / DVD (always TAO)
{
if (is_cd) // CDR(W) @ 4x (= 4 x 75 blks per sec)
block_counts->close_blocks = (multi_session) ? 14000 : 28000;
else
{
if (media_type == CDB_MEDIA_DVDR) // DVDR @ 8x (= 72 x 75 blks per sec)
{
block_counts->prepare_blocks = 150000;
block_counts->close_blocks = 100000;
}
else // DVDRW @ 4x (= 36 x 75 blks per sec)
{
block_counts->prepare_blocks = 60000;
block_counts->close_blocks = 100000;
}
}
}
}
Perhaps I am trying a bit too hard with this. There are a lot of variables and actual (as opposed to promised) write speeds seem to vary a lot. But maybe StarBurn can provide better estimates than my hard-coded numbers as it knows a bit more about what is going on behind the scenes.
Anyway, what I have works, up to a point. Thanks for listening.