RygelMediaContainer 3 LIBRYGEL-SERVER Library
RygelMediaContainer This is a container (folder) for media items and child containers.

## Synopsis

    #define             RYGEL_TYPE_MEDIA_CONTAINER
    void                rygel_media_container_get_children  (RygelMediaContainer *self,
                                                             guint offset,
                                                             guint max_count,
                                                             const gchar *sort_criteria,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
    RygelMediaObjects * rygel_media_container_get_children_finish
                                                            (RygelMediaContainer *self,
                                                             GAsyncResult *_res_,
                                                             GError **error);
    void                rygel_media_container_find_object   (RygelMediaContainer *self,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);
    RygelMediaObject *  rygel_media_container_find_object_finish
                                                            (RygelMediaContainer *self,
                                                             GAsyncResult *_res_,
                                                             GError **error);
    void                rygel_media_container_updated       (RygelMediaContainer *self);
    #define             RYGEL_MEDIA_CONTAINER_UPNP_CLASS
    #define             RYGEL_MEDIA_CONTAINER_STORAGE_FOLDER
    #define             RYGEL_MEDIA_CONTAINER_MUSIC_ALBUM
    #define             RYGEL_MEDIA_CONTAINER_MUSIC_ARTIST
    #define             RYGEL_MEDIA_CONTAINER_MUSIC_GENRE
    #define             RYGEL_MEDIA_CONTAINER_ALBUM_SORT_CRITERIA
    const gchar *       rygel_media_container_get_sort_criteria
                                                            (RygelMediaContainer *self);
    void                rygel_media_container_set_sort_criteria
                                                            (RygelMediaContainer *self,
                                                             const gchar *value);
    struct              RygelMediaContainer;

## Object Hierarchy

      GObject
       +----RygelMediaObject
             +----RygelMediaContainer
                   +----RygelSimpleContainer

## Known Derived Interfaces

RygelMediaContainer is required by RygelSearchableContainer and RygelWritableContainer.

## Properties

      "ocm-flags"                GUPnPOCMFlags         : Read
      "sort-criteria"            gchar*                : Read / Write

## Signals

      "container-updated"                              : Run Last

## Description

It provides a basic serialization implementation (to DIDLLiteWriter).

A derived class should provide a working implementation of get_children and should emit the container_updated signal.

## Details

### RYGEL_TYPE_MEDIA_CONTAINER

    #define RYGEL_TYPE_MEDIA_CONTAINER (rygel_media_container_get_type ())

The type for RygelMediaContainer.

RYGEL_TYPE_MEDIA_CONTAINER

### rygel_media_container_get_children ()

    void                rygel_media_container_get_children  (RygelMediaContainer *self,
                                                             guint offset,
                                                             guint max_count,
                                                             const gchar *sort_criteria,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);

Fetches the list of media objects directly under this container.

See also: ``rygel_media_container_get_children_finish()``

self :

  the RygelMediaContainer instance

offset :

  zero-based index of the first item to return. [in]

max_count :

  maximum number of objects to return. [in]

sort_criteria :

  sorting order of objects to return. [in]

cancellable :

  optional cancellable for this operation. [in][allow-none]

_callback_ :

  callback to call when the request is satisfied. [scope async]

_user_data_ :

  the data to pass to _callback_ function. [closure]

rygel_media_container_get_children

### rygel_media_container_get_children_finish ()

    RygelMediaObjects * rygel_media_container_get_children_finish
                                                            (RygelMediaContainer *self,
                                                             GAsyncResult *_res_,
                                                             GError **error);

Fetches the list of media objects directly under this container.

See also: ``rygel_media_container_get_children()``

self :

  the RygelMediaContainer instance

_res_ :

  a GAsyncResult

error :

  location to store the error occuring, or `NULL` to ignore

Returns :

  A list of media objects.

rygel_media_container_get_children_finish

### rygel_media_container_find_object ()

    void                rygel_media_container_find_object   (RygelMediaContainer *self,
                                                             const gchar *id,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_);

Recursively searches this container for a media object with the given ID.

See also: ``rygel_media_container_find_object_finish()``

self :

  the RygelMediaContainer instance

id :

  ID of the media object to search for. [in]

cancellable :

  optional cancellable for this operation. [in][allow-none]

_callback_ :

  callback to call when the request is satisfied. [scope async]

_user_data_ :

  the data to pass to _callback_ function. [closure]

rygel_media_container_find_object

### rygel_media_container_find_object_finish ()

    RygelMediaObject *  rygel_media_container_find_object_finish
                                                            (RygelMediaContainer *self,
                                                             GAsyncResult *_res_,
                                                             GError **error);

Recursively searches this container for a media object with the given ID.

See also: ``rygel_media_container_find_object()``

self :

  the RygelMediaContainer instance

_res_ :

  a GAsyncResult

error :

  location to store the error occuring, or `NULL` to ignore

Returns :

  the found media object.

rygel_media_container_find_object_finish

### rygel_media_container_updated ()

    void                rygel_media_container_updated       (RygelMediaContainer *self);

This method should be called each time this container is updated.

For instance, this should be called if there are metadata changes for this container, if items under it are removed or added, if there are metadata changes to items under it, etc.

self :

  the RygelMediaContainer instance

rygel_media_container_updated

### RYGEL_MEDIA_CONTAINER_UPNP_CLASS

    #define RYGEL_MEDIA_CONTAINER_UPNP_CLASS "object.container"

RYGEL_MEDIA_CONTAINER_UPNP_CLASS

### RYGEL_MEDIA_CONTAINER_STORAGE_FOLDER

    #define RYGEL_MEDIA_CONTAINER_STORAGE_FOLDER RYGEL_MEDIA_CONTAINER_UPNP_CLASS ".storageFolder"

RYGEL_MEDIA_CONTAINER_STORAGE_FOLDER

### RYGEL_MEDIA_CONTAINER_MUSIC_ALBUM

    #define RYGEL_MEDIA_CONTAINER_MUSIC_ALBUM RYGEL_MEDIA_CONTAINER_UPNP_CLASS ".album.musicAlbum"

RYGEL_MEDIA_CONTAINER_MUSIC_ALBUM

### RYGEL_MEDIA_CONTAINER_MUSIC_ARTIST

    #define RYGEL_MEDIA_CONTAINER_MUSIC_ARTIST RYGEL_MEDIA_CONTAINER_UPNP_CLASS ".person.musicArtist"

RYGEL_MEDIA_CONTAINER_MUSIC_ARTIST

### RYGEL_MEDIA_CONTAINER_MUSIC_GENRE

    #define RYGEL_MEDIA_CONTAINER_MUSIC_GENRE RYGEL_MEDIA_CONTAINER_UPNP_CLASS ".genre.musicGenre"

RYGEL_MEDIA_CONTAINER_MUSIC_GENRE

### RYGEL_MEDIA_CONTAINER_ALBUM_SORT_CRITERIA

    #define RYGEL_MEDIA_CONTAINER_ALBUM_SORT_CRITERIA "+upnp:class," "+rygel:originalVolumeNumber," "+upnp:originalTrackNumber," "+dc:title"

RYGEL_MEDIA_CONTAINER_ALBUM_SORT_CRITERIA

### rygel_media_container_get_sort_criteria ()

    const gchar *       rygel_media_container_get_sort_criteria
                                                            (RygelMediaContainer *self);

self :

  the RygelMediaContainer instance to query

Returns :

  the value of the "sort-criteria" property

rygel_media_container_get_sort_criteria

### rygel_media_container_set_sort_criteria ()

    void                rygel_media_container_set_sort_criteria
                                                            (RygelMediaContainer *self,
                                                             const gchar *value);

self :

  the RygelMediaContainer instance to modify

value :

  the new value of the "sort-criteria" property

rygel_media_container_set_sort_criteria

### struct RygelMediaContainer

    struct RygelMediaContainer;

This is a container (folder) for media items and child containers.

It provides a basic serialization implementation (to DIDLLiteWriter).

A derived class should provide a working implementation of get_children and should emit the container_updated signal.

RygelMediaContainer

## Property Details

### The `"ocm-flags"` property

      "ocm-flags"                GUPnPOCMFlags         : Read

ocm-flags.

RygelMediaContainer:ocm-flags

### The `"sort-criteria"` property

      "sort-criteria"            gchar*                : Read / Write

sort-criteria.

Default value: NULL

RygelMediaContainer:sort-criteria

## Signal Details

### The `"container-updated"` signal

    void                user_function                      (RygelMediaContainer *media_container,
                                                            RygelMediaContainer *container,
                                                            gpointer             user_data)            : Run Last

The container_updated signal is emitted if a child container under the tree of this container has been updated.

media_container :

  the RygelMediaContainer instance that received the signal

container :

  The child container that has been updated.

user_data :

  user data set when the signal handler was connected.

RygelMediaContainer::container-updated