|  |  |  | totem-pl-parser Reference Manual | |
|---|---|---|---|---|
#include <totem-disc.h> enum TotemDiscMediaType; TotemDiscMediaType totem_cd_detect_type (const char *device, GError **error); TotemDiscMediaType totem_cd_detect_type_with_url (const char *device, char **url, GError **error); TotemDiscMediaType totem_cd_detect_type_from_dir (const char *dir, char **url, GError **error); const char* totem_cd_get_human_readable_name (TotemDiscMediaType type); char* totem_cd_mrl_from_type (const char *scheme, const char *dir); gboolean totem_cd_has_medium (const char *device);
This file has various different disc utility functions for getting the media types and labels of discs.
typedef enum {
  MEDIA_TYPE_ERROR = -1,
  MEDIA_TYPE_DATA = 1,
  MEDIA_TYPE_CDDA,
  MEDIA_TYPE_VCD,
  MEDIA_TYPE_DVD,
  MEDIA_TYPE_DVB,
  MEDIA_TYPE_NUM_TYPES
} TotemDiscMediaType;
Gives the media type of a disc, or MEDIA_TYPE_ERROR if the media type
could not be determined.
TotemDiscMediaType totem_cd_detect_type (const char *device, GError **error);
Detects the disc's type, given its device node path.
| 
 | a device node path | 
| 
 | return location for a GError, or NULL | 
| Returns : | TotemDiscMediaType corresponding to the disc's type, or MEDIA_TYPE_ERROR on failure | 
TotemDiscMediaType totem_cd_detect_type_with_url (const char *device, char **url, GError **error);
Detects the disc's type, given its device node path. If
a string pointer is passed to url, it will return the disc's
MRL as from totem_cd_mrl_from_type().
| 
 | a device node path | 
| 
 | return location for the disc's MRL, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | TotemDiscMediaType corresponding to the disc's type, or MEDIA_TYPE_ERROR on failure | 
TotemDiscMediaType totem_cd_detect_type_from_dir (const char *dir, char **url, GError **error);
Detects the disc's type, given its mount directory URI. If
a string pointer is passed to url, it will return the disc's
MRL as from totem_cd_mrl_from_type().
| 
 | a directory URI | 
| 
 | return location for the disc's MRL, or NULL | 
| 
 | return location for a GError, or NULL | 
| Returns : | TotemDiscMediaType corresponding to the disc's type, or MEDIA_TYPE_ERROR on failure | 
const char* totem_cd_get_human_readable_name (TotemDiscMediaType type);
Returns the human-readable name for the given TotemDiscMediaType.
| 
 | a TotemDiscMediaType | 
| Returns : | the disc media type's readable name, which must not be freed, or NULLfor unhandled media types | 
char*               totem_cd_mrl_from_type              (const char *scheme,
                                                         const char *dir);
Builds an MRL using the scheme scheme and the given URI dir,
taking the filename from the URI if it's a file:// and just
using the whole URI otherwise.
| 
 | a scheme (e.g. "dvd") | 
| 
 | a directory URI | 
| Returns : | a newly-allocated string containing the MRL |