RBDeviceSource: Rhythmbox Development Reference Manual

## RBDeviceSource RBDeviceSource — interface for sources based on physical devices |

## Functions

gboolean | rb_device_source_can_eject ()
void | rb_device_source_eject ()
guint | rb_device_source_want_uri ()
gboolean | rb_device_source_uri_is_source ()
void | rb_device_source_set_display_details ()

## Types and Values

struct | RBDeviceSourceInterface

## Includes

    #include <rb-device-source.h>

## Description

Sources that represent physical devices should implement this interface. It exposes the ability to eject the device, and also can be used to implement some RBSource methods by using details from a GVolume or GMount accessed via 'volume' and 'mount' properties on the source object. Devices that are not based on a GVolume or GMount can still use the interface, but they must provide implementations of the `can_eject` and `eject` methods.

## Functions

### rb_device_source_can_eject ()

    gboolean
    rb_device_source_can_eject (RBDeviceSource *source);

### rb_device_source_eject ()

    void
    rb_device_source_eject (RBDeviceSource *source);

Ejects the device that the source represents.

#### Parameters

source | a RBDeviceSource |

### rb_device_source_want_uri ()

    guint
    rb_device_source_want_uri (RBSource *source,
                               const char *uri);

Checks whether `uri` identifies a path underneath the device's mount point. Should be used to implement the RBSource want_uri method.

#### Parameters

source | a RBDeviceSource |
uri | a URI to consider |

#### Returns

URI match strength

### rb_device_source_uri_is_source ()

    gboolean
    rb_device_source_uri_is_source (RBSource *source,
                                    const char *uri);

Returns `TRUE` if `uri` matches `source` . This should be used to implement the uri_is_source RBSource method.

#### Parameters

source | a RBDeviceSource |
uri | a URI to check |

#### Returns

`TRUE` if `uri` matches `source`

### rb_device_source_set_display_details ()

    void
    rb_device_source_set_display_details (RBDeviceSource *source);

Sets the icon and display name for a device-based source. The details come from the mount and/or volume. This should be called in the source's constructed method.

#### Parameters

source | a RBDeviceSource |

## Types and Values

### struct RBDeviceSourceInterface

    struct RBDeviceSourceInterface {
    	GTypeInterface g_iface;

    	gboolean (*can_eject)		(RBDeviceSource *source);
    	void		(*eject)		(RBDeviceSource *source);
    };