## Media player ID

Media player ID — Media player device information library

## Synopsis

    struct              RBMediaPlayerSource;
    struct              RBMediaPlayerSourceClass;
    void                rb_media_player_source_show_properties
                                                            (RBMediaPlayerSource *source);
                        MPIDDevice;
    enum                MPIDError;
    enum                MPIDSource;
    MPIDDevice *        mpid_device_new                     (const char *path);
    void                mpid_enable_debug                   (gboolean debug);

## Description

MPID provides access to device information, such as device and vendor names, supported formats, and audio folder locations, for USB mass storage media player devices. It queries the operating system (udev or HAL) and reads override files from the device filesystem and provides a simple set of properties.

## Details

### struct RBMediaPlayerSource

    struct RBMediaPlayerSource;

### struct RBMediaPlayerSourceClass

    struct RBMediaPlayerSourceClass {
    	RBBrowserSourceClass parent_class;

    	/* class members */
    	void		(*impl_get_entries) (RBMediaPlayerSource *source, const char *category, GHashTable *map);
    	guint64		(*impl_get_capacity) (RBMediaPlayerSource *source);
    	guint64		(*impl_get_free_space) (RBMediaPlayerSource *source);
    	void		(*impl_delete_entries) (RBMediaPlayerSource *source,
    						 GList *entries,
    						 RBMediaPlayerSourceDeleteCallback callback,
    						 gpointer data,
    						 GDestroyNotify destroy_data);
    	void		(*impl_add_playlist) (RBMediaPlayerSource *source, gchar *name, GList *entries);
    	void		(*impl_remove_playlists) (RBMediaPlayerSource *source);
    	void		(*impl_show_properties) (RBMediaPlayerSource *source, GtkWidget *info_box, GtkWidget *notebook);
    };

### rb_media_player_source_show_properties ()

    void                rb_media_player_source_show_properties
                                                            (RBMediaPlayerSource *source);

### MPIDDevice

    typedef struct _MPIDDevice MPIDDevice;

An MPIDDevice stores a set of information for a particular attached device, identified by either a mount point (e.g. /media/device) or a device node (e.g. /dev/sdb).

### enum MPIDError

    typedef enum {
    	MPID_ERROR_NONE,
    	MPID_ERROR_NO_DEVICE_PATH,			/* unable to find the device path */
    	MPID_ERROR_MECHANISM_FAILED,			/* mechanism (udev, hal) not available */
    	MPID_ERROR_NOT_MEDIA_PLAYER,			/* device is not a media player */
    	MPID_ERROR_DEVICE_INFO_MISSING			/* the device info file is missing */
    } MPIDError;

`MPID_ERROR_NONE` | Indicates no error has occurred
`MPID_ERROR_NO_DEVICE_PATH` | Unable to find the device path
`MPID_ERROR_MECHANISM_FAILED` | The device detection mechanism (e.g. udev or HAL) failed
`MPID_ERROR_NOT_MEDIA_PLAYER` | The device is not a media player
`MPID_ERROR_DEVICE_INFO_MISSING` | The device detection mechanism identified the device but was unable to locate its device information

### enum MPIDSource

    typedef enum {
    	MPID_SOURCE_NONE,
    	MPID_SOURCE_SYSTEM,
    	MPID_SOURCE_OVERRIDE
    } MPIDSource;

`MPID_SOURCE_NONE` | No device information is available
`MPID_SOURCE_SYSTEM` | Device information provided by the operating system (e.g. udev or HAL)
`MPID_SOURCE_OVERRIDE` | Device information provided by an override file on the device itself.

### mpid_device_new ()

    MPIDDevice *        mpid_device_new                     (const char *path);

Creates a new MPIDDevice and reads device information for the specified device node path or mount point path.

`path` : | the input path (either device node path or mount point)
Returns : | new MPIDDevice instance

### mpid_enable_debug ()

    void                mpid_enable_debug                   (gboolean debug);

Enables or disables debug output from the MPID library

`debug` : | whether to enable debug output