BraseroDrive
3
BRASERO Library

# BraseroDrive

## Synopsis

    enum                BraseroDriveCaps;
                        BraseroDrive;
    void                brasero_drive_reprobe               (BraseroDrive *drive);
    BraseroMedium *     brasero_drive_get_medium            (BraseroDrive *drive);
    GDrive *            brasero_drive_get_gdrive            (BraseroDrive *drive);
    const gchar *       brasero_drive_get_udi               (BraseroDrive *drive);
    gboolean            brasero_drive_is_fake               (BraseroDrive *drive);
    gchar *             brasero_drive_get_display_name      (BraseroDrive *drive);
    const gchar *       brasero_drive_get_device            (BraseroDrive *drive);
    const gchar *       brasero_drive_get_block_device      (BraseroDrive *drive);
    gchar *             brasero_drive_get_bus_target_lun_string
                                                            (BraseroDrive *drive);
    BraseroDriveCaps    brasero_drive_get_caps              (BraseroDrive *drive);
    gboolean            brasero_drive_can_write             (BraseroDrive *drive);
    gboolean            brasero_drive_can_eject             (BraseroDrive *drive);
    gboolean            brasero_drive_eject                 (BraseroDrive *drive,
                                                             gboolean wait,
                                                             GError **error);
    void                brasero_drive_cancel_current_operation
                                                            (BraseroDrive *drive);
    gboolean            brasero_drive_is_door_open          (BraseroDrive *drive);
    gboolean            brasero_drive_can_use_exclusively   (BraseroDrive *drive);
    gboolean            brasero_drive_lock                  (BraseroDrive *drive,
                                                             const gchar *reason,
                                                             gchar **reason_for_failure);
    gboolean            brasero_drive_unlock                (BraseroDrive *drive);

## Object Hierarchy

      GObject
       +----BraseroDrive

## Properties

      "gdrive"                   GDrive*               : Read / Write / Construct Only
      "udi"                      gchar*                : Read / Write / Construct Only

## Signals

      "medium-added"                                   : Run Last / No Recursion
      "medium-removed"                                 : Run Last / No Recursion

## Description

## Details

### enum BraseroDriveCaps

    typedef enum {
    	BRASERO_DRIVE_CAPS_NONE			= 0,
    	BRASERO_DRIVE_CAPS_CDR			= 1,
    	BRASERO_DRIVE_CAPS_CDRW			= 1 << 1,
    	BRASERO_DRIVE_CAPS_DVDR			= 1 << 2,
    	BRASERO_DRIVE_CAPS_DVDRW		= 1 << 3,
    	BRASERO_DRIVE_CAPS_DVDR_PLUS		= 1 << 4,
    	BRASERO_DRIVE_CAPS_DVDRW_PLUS		= 1 << 5,
    	BRASERO_DRIVE_CAPS_DVDR_PLUS_DL		= 1 << 6,
    	BRASERO_DRIVE_CAPS_DVDRW_PLUS_DL	= 1 << 7,
    	BRASERO_DRIVE_CAPS_DVDRAM		= 1 << 10,
    	BRASERO_DRIVE_CAPS_BDR			= 1 << 8,
    	BRASERO_DRIVE_CAPS_BDRW			= 1 << 9
    } BraseroDriveCaps;

### BraseroDrive

    typedef struct _BraseroDrive BraseroDrive;

### brasero_drive_reprobe ()

    void                brasero_drive_reprobe               (BraseroDrive *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.

`drive` :

  a BraseroDrive

### brasero_drive_get_medium ()

    BraseroMedium *     brasero_drive_get_medium            (BraseroDrive *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.

`drive` :

  a BraseroDrive

Returns :

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

### brasero_drive_get_gdrive ()

    GDrive *            brasero_drive_get_gdrive            (BraseroDrive *drive);

Returns the GDrive corresponding to this BraseroDrive

`drive` :

  a BraseroDrive

Returns :

  a GDrive or NULL. Unref after use.

### brasero_drive_get_udi ()

    const gchar *       brasero_drive_get_udi               (BraseroDrive *drive);

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

`drive` :

  a BraseroDrive

Returns :

  a string holding the HAL udi. Not to be freed Deprecated since 2.27.3

### brasero_drive_is_fake ()

    gboolean            brasero_drive_is_fake               (BraseroDrive *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.

`drive` :

  a BraseroDrive

Returns :

  `TRUE` or `FALSE`.

### brasero_drive_get_display_name ()

    gchar *             brasero_drive_get_display_name      (BraseroDrive *drive);

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

`drive` :

  a BraseroDrive

Returns :

  a string holding the name

### brasero_drive_get_device ()

    const gchar *       brasero_drive_get_device            (BraseroDrive *drive);

Gets a string holding the device path for the drive.

`drive` :

  a BraseroDrive

Returns :

  a string holding the device path

### brasero_drive_get_block_device ()

    const gchar *       brasero_drive_get_block_device      (BraseroDrive *drive);

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

`drive` :

  a BraseroDrive

Returns :

  a string holding the block device path

### brasero_drive_get_bus_target_lun_string ()

    gchar *             brasero_drive_get_bus_target_lun_string
                                                            (BraseroDrive *drive);

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

`drive` :

  a BraseroDrive

Returns :

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

  Deprecated since 2.27.3

### brasero_drive_get_caps ()

    BraseroDriveCaps    brasero_drive_get_caps              (BraseroDrive *drive);

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

`drive` :

  a BraseroDrive

Returns :

  a BraseroDriveCaps.

### brasero_drive_can_write ()

    gboolean            brasero_drive_can_write             (BraseroDrive *drive);

Returns whether the disc can burn any disc at all.

`drive` :

  a BraseroDrive

Returns :

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

### brasero_drive_can_eject ()

    gboolean            brasero_drive_can_eject             (BraseroDrive *drive);

Returns whether the drive can eject media.

`drive` :

  BraseroDrive

Returns :

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

### brasero_drive_eject ()

    gboolean            brasero_drive_eject                 (BraseroDrive *drive,
                                                             gboolean wait,
                                                             GError **error);

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

`drive` :

  BraseroDrive

`wait` :

  gboolean whether to wait for the completion of the operation (with a GMainLoop)

`error` :

  GError

Returns :

  a gboolean. TRUE on success, FALSE otherwise.

### brasero_drive_cancel_current_operation ()

    void                brasero_drive_cancel_current_operation
                                                            (BraseroDrive *drive);

Cancels all operations currently running for `drive`

`drive` :

  BraseroDrive *

### brasero_drive_is_door_open ()

    gboolean            brasero_drive_is_door_open          (BraseroDrive *drive);

Returns whether or not the drive door is open.

`drive` :

  a BraseroDrive

Returns :

  `TRUE` or `FALSE`.

### brasero_drive_can_use_exclusively ()

    gboolean            brasero_drive_can_use_exclusively   (BraseroDrive *drive);

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

`drive` :

  a BraseroDrive

Returns :

  `TRUE` or `FALSE`.

### brasero_drive_lock ()

    gboolean            brasero_drive_lock                  (BraseroDrive *drive,
                                                             const gchar *reason,
                                                             gchar **reason_for_failure);

Locks a BraseroDrive. Ejection shouldn't be possible any more.

`drive` :

  a BraseroDrive

`reason` :

  a string to indicate what the drive was locked for

`reason_for_failure` :

  a string to hold the reason why the locking failed

Returns :

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

### brasero_drive_unlock ()

    gboolean            brasero_drive_unlock                (BraseroDrive *drive);

Unlocks a BraseroDrive.

`drive` :

  a BraseroDrive

Returns :

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

## Property Details

### The `"gdrive"` property

      "gdrive"                   GDrive*               : Read / Write / Construct Only

A GDrive object for the drive.

### The `"udi"` property

      "udi"                      gchar*                : Read / Write / Construct Only

HAL udi as a string (Deprecated).

Default value: NULL

## Signal Details

### The `"medium-added"` signal

    void                user_function                      (BraseroDrive  *drive,
                                                            BraseroMedium *medium,
                                                            gpointer       user_data)      : Run Last / No Recursion

This signal gets emitted when a new medium was detected

`drive` :

  the object which received the signal

`medium` :

  the new medium which was added

`user_data` :

  user data set when the signal handler was connected.

### The `"medium-removed"` signal

    void                user_function                      (BraseroDrive  *drive,
                                                            BraseroMedium *medium,
                                                            gpointer       user_data)      : Run Last / No Recursion

This signal gets emitted when a medium is not longer available

`drive` :

  the object which received the signal

`medium` :

  the medium which was removed

`user_data` :

  user data set when the signal handler was connected.