#1 Burning Software

It is currently Thu Mar 28, 2024 11:38 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Request for some more callbacks
PostPosted: Tue Jun 24, 2008 7:39 pm 
Offline

Joined: Wed Apr 30, 2008 2:11 pm
Posts: 31
Location: England
Hi,

Greetings from sunny Britain. It really is, actually, just for once. Anyway, is there any prospect of having some additional callbacks when burning a CD (or DVD):
- preparing, with the estimated number of blocks to be written
- closing a session, also with the estimated number of blocks to be written

And, when erasing, would it be possible to have the estimated number of blocks to be written notified to the callback routine.

My reason for asking for these is that I like to tell the user that these things are happening and roughly how long they will take.

Many thanks,


Top
 Profile  
 
 Post subject: Re: Request for some more callbacks
PostPosted: Wed Jun 25, 2008 5:17 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
With the close session and erase it's more or less possible, but I'm not sure what do you mean under "preparing"... Preparing for WHAT? :)

alpinesoft wrote:
Hi,

Greetings from sunny Britain. It really is, actually, just for once. Anyway, is there any prospect of having some additional callbacks when burning a CD (or DVD):
- preparing, with the estimated number of blocks to be written
- closing a session, also with the estimated number of blocks to be written

And, when erasing, would it be possible to have the estimated number of blocks to be written notified to the callback routine.

My reason for asking for these is that I like to tell the user that these things are happening and roughly how long they will take.

Many thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 26, 2008 12:36 pm 
Offline

Joined: Wed Apr 30, 2008 2:11 pm
Posts: 31
Location: England
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 9:51 am 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
Actually you know both burning speed and burning data amount. So calculate erase (short and long) and close session (lead-in fixation) time is trivial.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 27, 2008 10:15 am 
Offline

Joined: Wed Apr 30, 2008 2:11 pm
Posts: 31
Location: England
Hi,

OK, but I have to guess burning amount so my figures are probably wrong. Perhaps you could consider adding an API similar to my 'GetBlockCounts' method to return this information for the currently loaded media at the currently selected write speed. I would think people would prefer times to be returned in seconds, rather than the slightly weird way I do it.

Thanks again for a great product.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 30, 2008 1:38 pm 
Offline
Site Admin

Joined: Fri Jun 18, 2004 12:03 am
Posts: 4089
Location: British Virgin Islands
OK, sounds good.

alpinesoft wrote:
Hi,

OK, but I have to guess burning amount so my figures are probably wrong. Perhaps you could consider adding an API similar to my 'GetBlockCounts' method to return this information for the currently loaded media at the currently selected write speed. I would think people would prefer times to be returned in seconds, rather than the slightly weird way I do it.

Thanks again for a great product.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 17 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