## BurnerDrive

BurnerDrive

## Functions

void | burner_drive_reprobe ()
BurnerMedium * | burner_drive_get_medium ()
GDrive * | burner_drive_get_gdrive ()
const gchar * | burner_drive_get_udi ()
gboolean | burner_drive_is_fake ()
gchar * | burner_drive_get_display_name ()
const gchar * | burner_drive_get_device ()
const gchar * | burner_drive_get_block_device ()
gchar * | burner_drive_get_bus_target_lun_string ()
BurnerDriveCaps | burner_drive_get_caps ()
gboolean | burner_drive_can_write ()
gboolean | burner_drive_can_eject ()
gboolean | burner_drive_eject ()
void | burner_drive_cancel_current_operation ()
gboolean | burner_drive_is_door_open ()
gboolean | burner_drive_can_use_exclusively ()
gboolean | burner_drive_lock ()
gboolean | burner_drive_unlock ()

## Types and Values

enum | BurnerDriveCaps
| BurnerDrive

## Description

## Functions

### burner_drive_reprobe ()

    void
    burner_drive_reprobe (BurnerDrive *drive);

Reprobes the drive contents. Useful when an operation has just been performed (blanking, burning, ...) and medium status should be updated.

NOTE: This operation does not block.

#### Parameters

drive | a BurnerDrive |

### burner_drive_get_medium ()

    BurnerMedium *
    burner_drive_get_medium (BurnerDrive *drive);

Gets the medium currently inserted in the drive. If there is no medium or if the medium is not probed yet then it returns NULL.

#### Parameters

drive | a BurnerDrive |

#### Returns

a BurnerMedium object or NULL. No need to unref after use.

[transfer none]

### burner_drive_get_gdrive ()

    GDrive *
    burner_drive_get_gdrive (BurnerDrive *drive);

Returns the GDrive corresponding to this BurnerDrive

#### Parameters

drive | a BurnerDrive |

#### Returns

a GDrive or NULL. Unref after use.

### burner_drive_get_udi ()

    const gchar *
    burner_drive_get_udi (BurnerDrive *drive);

Gets a string holding the HAL udi corresponding to this device. It can be used to uniquely identify the drive.

#### Parameters

drive | a BurnerDrive |

#### Returns

a string holding the HAL udi or NULL. Not to be freed

### burner_drive_is_fake ()

    gboolean
    burner_drive_is_fake (BurnerDrive *drive);

Returns whether or not the drive is a fake one. There is only one and corresponds to a file which is used when the user wants to burn to a file.

#### Parameters

drive | a BurnerDrive |

#### Returns

`TRUE` or `FALSE`.

### burner_drive_get_display_name ()

    gchar *
    burner_drive_get_display_name (BurnerDrive *drive);

Gets a string holding the name for the drive. That string can be then displayed in a user interface.

#### Parameters

drive | a BurnerDrive |

#### Returns

a string holding the name

### burner_drive_get_device ()

    const gchar *
    burner_drive_get_device (BurnerDrive *drive);

Gets a string holding the device path for the drive.

#### Parameters

drive | a BurnerDrive |

#### Returns

a string holding the device path. On Solaris returns raw device.

### burner_drive_get_block_device ()

    const gchar *
    burner_drive_get_block_device (BurnerDrive *drive);

Gets a string holding the block device path for the drive. This can be used on some other OSes, like Solaris, for GIO operations instead of the device path.

Solaris uses block device for GIO operations and uses raw device for system calls and backends like cdrtool.

If such a path is not available, it returns the device path.

#### Parameters

drive | a BurnerDrive |

#### Returns

a string holding the block device path

### burner_drive_get_bus_target_lun_string ()

    gchar *
    burner_drive_get_bus_target_lun_string
                                   (BurnerDrive *drive);

Returns the bus, target, lun ("{bus},{target},{lun}") as a string which is sometimes needed by some backends like cdrecord.

NOTE: that function returns either bus/target/lun or the device path according to OSes. Basically it returns bus/target/lun only for FreeBSD which is the only OS in need for that. For all others it returns the device path.

#### Parameters

drive | a BurnerDrive |

#### Returns

a string or NULL. The string must be freed when not needed

### burner_drive_get_caps ()

    BurnerDriveCaps
    burner_drive_get_caps (BurnerDrive *drive);

Returns what type(s) of disc the drive can write to.

#### Parameters

drive | a BurnerDrive |

#### Returns

a BurnerDriveCaps.

### burner_drive_can_write ()

    gboolean
    burner_drive_can_write (BurnerDrive *drive);

Returns whether the disc can burn any disc at all.

#### Parameters

drive | a BurnerDrive |

#### Returns

a gboolean. TRUE if the drive can write a disc and FALSE otherwise

### burner_drive_can_eject ()

    gboolean
    burner_drive_can_eject (BurnerDrive *drive);

Returns whether the drive can eject media.

#### Parameters

drive | BurnerDrive |

#### Returns

a gboolean. TRUE if the media can be ejected, FALSE otherwise.

### burner_drive_eject ()

    gboolean
    burner_drive_eject (BurnerDrive *drive,
                        gboolean wait,
                        GError **error);

Open the drive tray or ejects the media if there is any inside.

#### Parameters

drive | BurnerDrive |
wait | gboolean whether to wait for the completion of the operation (with a GMainLoop) |
error | GError |

#### Returns

a gboolean. TRUE on success, FALSE otherwise.

### burner_drive_cancel_current_operation ()

    void
    burner_drive_cancel_current_operation (BurnerDrive *drive);

Cancels all operations currently running for `drive`

#### Parameters

drive | BurnerDrive * |

### burner_drive_is_door_open ()

    gboolean
    burner_drive_is_door_open (BurnerDrive *drive);

Returns whether or not the drive door is open.

#### Parameters

drive | a BurnerDrive |

#### Returns

`TRUE` or `FALSE`.

### burner_drive_can_use_exclusively ()

    gboolean
    burner_drive_can_use_exclusively (BurnerDrive *drive);

Returns whether or not the drive can be used exclusively, that is whether or not it is currently used by another application.

#### Parameters

drive | a BurnerDrive |

#### Returns

`TRUE` or `FALSE`.

### burner_drive_lock ()

    gboolean
    burner_drive_lock (BurnerDrive *drive,
                       const gchar *reason,
                       gchar **reason_for_failure);

Locks a BurnerDrive. Manual ejection shouldn't be possible any more.

#### Parameters

drive | a BurnerDrive |
reason | a string to indicate what the drive was locked for |
reason_for_failure | a string (or NULL) to hold the reason why the locking failed |

#### Returns

`TRUE` if the drive was successfully locked or `FALSE`.

### burner_drive_unlock ()

    gboolean
    burner_drive_unlock (BurnerDrive *drive);

Unlocks a BurnerDrive.

#### Parameters

drive | a BurnerDrive |

#### Returns

`TRUE` if the drive was successfully unlocked or `FALSE`.

## Types and Values

### enum BurnerDriveCaps

#### Members

BURNER_DRIVE_CAPS_NONE |  |
BURNER_DRIVE_CAPS_CDR |  |
BURNER_DRIVE_CAPS_CDRW |  |
BURNER_DRIVE_CAPS_DVDR |  |
BURNER_DRIVE_CAPS_DVDRW |  |
BURNER_DRIVE_CAPS_DVDR_PLUS |  |
BURNER_DRIVE_CAPS_DVDRW_PLUS |  |
BURNER_DRIVE_CAPS_DVDR_PLUS_DL |  |
BURNER_DRIVE_CAPS_DVDRW_PLUS_DL |  |
BURNER_DRIVE_CAPS_DVDRAM |  |
BURNER_DRIVE_CAPS_BDR |  |
BURNER_DRIVE_CAPS_BDRW |  |

### BurnerDrive

    typedef struct {
    	GObject parent_instance;
    } BurnerDrive;

Represents a physical drive currently connected.