RygelDescriptionFile

RygelDescriptionFile — Represents a device description document and offers methods for easy manipulation of those.

Synopsis

#define             RYGEL_TYPE_DESCRIPTION_FILE
void                rygel_description_file_set_device_type
                                                        (RygelDescriptionFile *self,
                                                         const gchar *device_type);
void                rygel_description_file_set_model_name
                                                        (RygelDescriptionFile *self,
                                                         const gchar *model_name);
void                rygel_description_file_set_model_number
                                                        (RygelDescriptionFile *self,
                                                         const gchar *model_number);
void                rygel_description_file_set_friendly_name
                                                        (RygelDescriptionFile *self,
                                                         const gchar *friendly_name);
gchar *             rygel_description_file_get_friendly_name
                                                        (RygelDescriptionFile *self);
void                rygel_description_file_set_dlna_caps
                                                        (RygelDescriptionFile *self,
                                                         RygelPluginCapabilities capabilities);
void                rygel_description_file_modify_service_type
                                                        (RygelDescriptionFile *self,
                                                         const gchar *old_type,
                                                         const gchar *new_type);
void                rygel_description_file_save         (RygelDescriptionFile *self,
                                                         const gchar *path,
                                                         GError **error);
RygelDescriptionFile * rygel_description_file_new       (const gchar *template_file,
                                                         GError **error);
RygelDescriptionFile * rygel_description_file_new_from_xml_document
                                                        (GUPnPXMLDoc *doc);
struct              RygelDescriptionFile;
struct              RygelDescriptionFileClass;

Object Hierarchy

  GObject
   +----RygelDescriptionFile

Description

Details

RYGEL_TYPE_DESCRIPTION_FILE

#define RYGEL_TYPE_DESCRIPTION_FILE (rygel_description_file_get_type ())

The type for RygelDescriptionFile.


rygel_description_file_set_device_type ()

void                rygel_description_file_set_device_type
                                                        (RygelDescriptionFile *self,
                                                         const gchar *device_type);

Change the type of a service.

Usually used to modify the device version, e.g. default device type is "MediaServer:2" and device_type = "MediaServer:1".

self :

the RygelDescriptionFile instance

device_type :

 . is the current content of serviceType. [in]

rygel_description_file_set_model_name ()

void                rygel_description_file_set_model_name
                                                        (RygelDescriptionFile *self,
                                                         const gchar *model_name);

Modify the model name.

Usually the name of the software implementing this device.

self :

the RygelDescriptionFile instance

model_name :

 . is the new model name. [in]

rygel_description_file_set_model_number ()

void                rygel_description_file_set_model_number
                                                        (RygelDescriptionFile *self,
                                                         const gchar *model_number);

Modify the model number.

Usually the version of the software implementing this device.

self :

the RygelDescriptionFile instance

model_number :

 . is the new model number. [in]

rygel_description_file_set_friendly_name ()

void                rygel_description_file_set_friendly_name
                                                        (RygelDescriptionFile *self,
                                                         const gchar *friendly_name);

Set the friendly name of the device.

The friendly name is the one usually presented to the user in control points or DMPs

self :

the RygelDescriptionFile instance

friendly_name :

 . is the new friendly name of the device. [in]

rygel_description_file_get_friendly_name ()

gchar *             rygel_description_file_get_friendly_name
                                                        (RygelDescriptionFile *self);

Get the current friendly name of the device.

self :

the RygelDescriptionFile instance

Returns :

The currenly set friendly name.

rygel_description_file_set_dlna_caps ()

void                rygel_description_file_set_dlna_caps
                                                        (RygelDescriptionFile *self,
                                                         RygelPluginCapabilities capabilities);

Set the DLNA caps of this root device and while taking the capabilities of the plugin into account.

self :

the RygelDescriptionFile instance

capabilities :

 . RygelPluginCapabilities flags. [in]

rygel_description_file_modify_service_type ()

void                rygel_description_file_modify_service_type
                                                        (RygelDescriptionFile *self,
                                                         const gchar *old_type,
                                                         const gchar *new_type);

Change the type of a service.

Usually used to modify the service version, e.g. old_type = "ContentDirectory:2" and new_type = "ContentDirectory:1".

self :

the RygelDescriptionFile instance

old_type :

 . is the current content of serviceType. [in]

new_type :

 . is the content serviceType will be set to. [in]

rygel_description_file_save ()

void                rygel_description_file_save         (RygelDescriptionFile *self,
                                                         const gchar *path,
                                                         GError **error);

Writes the current document to a file.

It makes sure that the resulting file has the correct UTF-8 encoding and does not have any kind of newlines. This is necessary as some devices with broken XML parsers can't cope with UNIX newlines. If a file with the same name exists it will be overwritten.

GError will be returned in error if anything fails while creating the XML dump.

self :

the RygelDescriptionFile instance

path :

 . is a path to a file. [in]

error :

location to store the error occuring, or NULL to ignore

rygel_description_file_new ()

RygelDescriptionFile * rygel_description_file_new       (const gchar *template_file,
                                                         GError **error);

Constructor to load a description file from disk

GUPNP_XML_ERROR_PARSE will be returned in error if there was an error reading or parsing the file.

template_file :

 . the path to the description file. [in]

error :

location to store the error occuring, or NULL to ignore

rygel_description_file_new_from_xml_document ()

RygelDescriptionFile * rygel_description_file_new_from_xml_document
                                                        (GUPnPXMLDoc *doc);

Constructor which wraps an existing GUPnP.XMLDoc as a description file.

doc :

 . is the GUPnP.XMLDoc to wrap. [in]

struct RygelDescriptionFile

struct RygelDescriptionFile;

Represents a device description document and offers methods for easy manipulation of those.


struct RygelDescriptionFileClass

struct RygelDescriptionFileClass {
	GObjectClass parent_class;
};

The class structure for RYGEL_TYPE_DESCRIPTION_FILE. All the fields in this structure are private and should never be accessed directly.

GObjectClass parent_class;

the parent class structure