PrimoBurner(tm) for C++  4.6
CD, DVD and Blu-ray Software Development Kit
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
BlockDevice Class Referenceabstract

BlockDevice provides methods for reading and writing data CD, DVD and BD in packet mode. More...

#include <PrimoBurnerAPI.h>

Inherits Reference.

Public Member Functions

virtual bool_t close ()=0
 The close methods closes the device. More...
 
virtual Devicedevice () const =0
 Gets the device previously set with setDevice. More...
 
virtual const ErrorInfoerror () const =0
 Gets error information about the last operation. More...
 
virtual bool_t finalizeDisc (DataFile *fileSystemLayout, const char_t *volumeLabel, bool_t closeTrack, bool_t closeSession, bool_t closeDisc, bool_t dismount=1)=0
 Writes UDF file system structures at the beginning of the disc which makes it read compatible with all operating systems that support UDF. More...
 
virtual bool_t isFinalized () const =0
 Indicates whether the disc has been finalized. More...
 
virtual bool_t open (int32_t openFlags=BlockDeviceOpenFlags::Write|BlockDeviceOpenFlags::Format, int32_t startAddress=-1)=0
 The open method initializes a block device. More...
 
virtual void setDevice (Device *device)=0
 Sets the Device that will be used for burning. More...
 
virtual void setSimulateBurn (bool_t simulate)=0
 Sets the simulation flag. More...
 
virtual void setTempDiscID (const char_t *tempID)=0
 Sets the temporary disc ID. More...
 
virtual bool_t simulateBurn () const =0
 Gets the current simulation setting. More...
 
virtual const char_t * tempDiscID () const =0
 Gets the temporary disc ID. More...
 
virtual bool_t write (void *data, uint32_t dataLength)=0
 The write method writes a specified number of bytes to the device starting at the current write address. More...
 
virtual int32_t writeAddress () const =0
 Gets the current write address. More...
 
- Public Member Functions inherited from Reference
virtual int32_t release () const =0
 Releases the instance. More...
 
virtual int32_t retain () const =0
 Retains the instance. More...
 
virtual int32_t retainCount () const =0
 Returns the current reference count. More...
 

Protected Member Functions

 ~BlockDevice ()
 This object can be destroyed only by the PrimoBurner library.
 

Detailed Description

BlockDevice provides methods for reading and writing data CD, DVD and BD in packet mode.

Member Function Documentation

virtual bool_t close ( )
pure virtual

The close methods closes the device.

Returns
1 Success.
0 Failure.
virtual Device* device ( ) const
pure virtual

Gets the device previously set with setDevice.

Returns
A pointer to Device object or NULL if no device is set.
virtual const ErrorInfo* error ( ) const
pure virtual

Gets error information about the last operation.

Returns
A pointer to an ErrorInfo object.
virtual bool_t finalizeDisc ( DataFile fileSystemLayout,
const char_t *  volumeLabel,
bool_t  closeTrack,
bool_t  closeSession,
bool_t  closeDisc,
bool_t  dismount = 1 
)
pure virtual

Writes UDF file system structures at the beginning of the disc which makes it read compatible with all operating systems that support UDF.

Parameters
fileSystemLayoutThe logical file structure of the image, a tree of files and directories that should be used as a file system layout. The first DataFile item in the directory tree is the root of the file system.
volumeLabelVolume label. The max length allowed for the volume label is 32 characters. Only capital letters from A to Z, digits from 0 to 9, and the special characters _ (underscore) are allowed.
closeTrackIndicates that the track should be closed. This parameter is ignored if closeSession is set to true.
closeSessionIndicates that the session should be closed. This parameter is ignored if closeDisc is set to true.
closeDiscIndicates that the disc should be closed.
dismountIndicates whether the OS should dismount the disc after it is finalized.
Returns
1 Success.
0 Failure.
virtual bool_t isFinalized ( ) const
pure virtual

Indicates whether the disc has been finalized.

This property should be used only after the device has been successfully opened with the open method. In order to read the disc finalized state BlockDevice must be opened for reading. If BlockDevice is successfully opened for writing (which is the default mode) the disc finalized state is immediately changed and the disc becomes non-finalized.

Returns
1 if the disc was not created using BlockDevice.
1 if the disc was created using BlockDevice and is finalized.
0 if the disc was created using BlockDevice and has not been finalized.
virtual bool_t open ( int32_t  openFlags = BlockDeviceOpenFlags::Write|BlockDeviceOpenFlags::Format,
int32_t  startAddress = -1 
)
pure virtual

The open method initializes a block device.

A Device object must be set with the setDevice method before calling this method.

Parameters
openFlags[in] Type of access to the object. An application can obtain read-only access, write-only access, or read/write access. For the possible values for openFlags see the BlockDeviceOpenFlags enum.
startAddress- used only in Random writable media: DVD+RW, DVD-RW (RO), DVD-RAM, BD-RE; otherwise the startAddress is ignored.
Returns
1 Success.
0 Failure.
virtual void setDevice ( Device device)
pure virtual

Sets the Device that will be used for burning.

Parameters
deviceA pointer to Device object.
virtual void setSimulateBurn ( bool_t  simulate)
pure virtual

Sets the simulation flag.

This property must be set before calling the open method, or otherwise it will be ignored.

Parameters
simulateIndicates whether a simulated burn should be performed. If this parameter is TRUE, a simulated burn is performed. If this parameter is FALSE, a real burn is performed.
virtual void setTempDiscID ( const char_t *  tempID)
pure virtual

Sets the temporary disc ID.

The temporary disc ID is written to the disc when the open method is called for the first time for a blank disc.

Parameters
tempIDA null-terminated string.

When writing: This property must be set before opening the block device for writing. Setting this property to NULL or empty string will cause BlockDevice to read the ID from the disc when the open method is called.

The max length allowed for the disc ID is 32 characters. It is a good practice to use the volume label of a disc as a temporary disc id. The temporary disc id is written in the beginning of a blank disc. Setting the temporary disc id for a partially written disc has not effect.

When reading: To read the temporary disc ID call the BlockDevice::open method and specify the open flags as BlockDeviceOpenFlags::Read. Then use the tempDiscID property to get the ID value. Dot not set the temporary disc ID if you are opening the block device for reading.

IMPORTANT NOTE: The temporary disc ID can be used to identify the media until it is finalized. The value of the Temporary Disc ID will be lost after the first finalization.

virtual bool_t simulateBurn ( ) const
pure virtual

Gets the current simulation setting.

Returns
TRUE if simulation is enabled, FALSE otherwise.
virtual const char_t* tempDiscID ( ) const
pure virtual

Gets the temporary disc ID.

This property should be used only after the device has been successfully opened with the Open method.

To read the temporary disc ID call the BlockDevice::open method and specify the open flags as BlockDeviceOpenFlags::Read. Then use the tempDiscID property to get the ID value.

The value of the Temporary Disc ID is undefined after the first finalization.

IMPORTANT NOTE: The temporary disc ID can be used to identify the media until it has been finalized. The value of the Temporary Disc ID will be lost after the first finalization.

Returns
A null-terminated string.
virtual bool_t write ( void *  data,
uint32_t  dataLength 
)
pure virtual

The write method writes a specified number of bytes to the device starting at the current write address.

This method should be called only if the device has been opened for writing.

Parameters
data[in] Pointer to the data that should be written.
dataLength[in] Number of bytes of data to write to the disc. The value of dataLength should be a multiple of 2048 bytes (BlockSize::CDRom, BlockSize::DVD, BlocksSize::BD).
Returns
1 Success.
0 Failure.
virtual int32_t writeAddress ( ) const
pure virtual

Gets the current write address.

This property should be used only after the device has been successfully opened with the Open method.

Returns
Current write address.
-1 when there is an error.