StarBurn SDK (Software Development Kit)
ContentsIndexHome
Example

This example allocates CdvdBurnerGrabber object, specifies the CD-Text for a disc and for 3 track and burns the disc. 

 

// Somewhere in the data region
PVOID l__PVOID__CdvdBurnerGrabber;
EXCEPTION_NUMBER l__EXCEPTION_NUMBER;
ULONG l__ULONG__SystemError;
CDB_FAILURE_INFORMATION l__CDB_FAILURE_INFORMATION;
DAO_DISC_LAYOUT l__DAO_DISC_LAYOUT;

// Prepare exception text buffer
RtlZeroMemory(
    &l__CHAR__ExceptionText,
    sizeof( l__CHAR__ExceptionText )
    );

// Prepare CDB failure information
RtlZeroMemory(
    &l__CDB_FAILURE_INFORMATION,
    sizeof( l__CDB_FAILURE_INFORMATION )
    );

// Try to create CdvdBurnerGrabber on 0:0:4:0 with 32MB of cache
l__EXCEPTION_NUMBER =
StarBurn_CdvdBurnerGrabber_Create(
    &l__PVOID__CdvdBurnerGrabber,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__SystemError,
    &l__CDB_FAILURE_INFORMATION,
    ( PCALLBACK )( StarBurn_Callback ),
    0,
    0,
    4,
    0,
    32
    );

// Check for correct reply
if (  l__EXCEPTION_NUMBER != EN_SUCCESS )
{
// Handle error here...
}

// Add files to burn here by filling l__DAO_DISC_LAYOUT information

// Try to set CD-Text information for 3-track
l__EXCEPTION_NUMBER =
StarBurn_CdvdBurnerGrabber_SetCDTextItem(
    l__PVOID__CdvdBurnerGrabber,
    3,
    "My band",
    "My new song",
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__Status
    );

// Check for success
if (l__EXCEPTION_NUMBER != EN_SUCCESS)
{
// Handle error here...
}
            
// Try to set CD-Text information for the disc
l__EXCEPTION_NUMBER =
StarBurn_CdvdBurnerGrabber_SetCDTextItem(
    l__PVOID__CdvdBurnerGrabber,
    0,
    "My band",
    "My first album",
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__Status
    );

// Check for success
if (l__EXCEPTION_NUMBER != EN_SUCCESS)
{
// Handle error here...
}
        
// Try to burn ISO/sound/MDS image to the disc as CDROM XA (MODE2 Form1) or CDDA (CD digital audio) in Disc-At-Once raw P-W mode
l__EXCEPTION_NUMBER =
StarBurn_CdvdBurnerGrabber_DiscAtOnceRawPWFromFile(
    l__PVOID__CdvdBurnerGrabber,
    ( PCHAR )( &l__CHAR__ExceptionText ),
    sizeof( l__CHAR__ExceptionText ),
    &l__ULONG__Status,
    &l__CDB_FAILURE_INFORMATION,
    &l__DAO_DISC_LAYOUT,
    FALSE,
    l__BOOLEAN__IsTestWrite,
    FALSE, // Next session allowed
    FALSE, // Do NOT repair broken subchannel
    WRITE_REPORT_DELAY_IN_SECONDS,
    BUFFER_STATUS_REPORT_DELAY_IN_SECONDS
    );

// Destroy the CdvdBurnerGrabber
StarBurn_Destroy( &l__PVOID__CdvdBurnerGrabber );

// Just check for pointer (paranoid?)
if ( l__PVOID__CdvdBurnerGrabber != NULL )
{
// Handle error here...
}