BlockDevice provides methods for reading and writing data CD, DVD and BD in packet mode.
More...
#include <PrimoBurnerAPI.h>
Inherits Reference.
|
| ~BlockDevice () |
| This object can be destroyed only by the PrimoBurner library.
|
|
BlockDevice provides methods for reading and writing data CD, DVD and BD in packet mode.
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.
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
-
fileSystemLayout | The 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. |
volumeLabel | Volume 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. |
closeTrack | Indicates that the track should be closed. This parameter is ignored if closeSession is set to true. |
closeSession | Indicates that the session should be closed. This parameter is ignored if closeDisc is set to true. |
closeDisc | Indicates that the disc should be closed. |
dismount | Indicates 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.
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
-
device | A 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
-
simulate | Indicates 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
-
tempID | A 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.