Rygel.MediaContainer – librygel-server Reference Manual

# MediaContainer

## Object Hierarchy:

## Description:

public abstract class MediaContainer : MediaObject

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.

When used as a root container, you may wish to use the variables, such as REALNAME, in in the title. See the title property of the #RygelMediaObject.

If the container should support UPnP search operations then you also implement the #RygelSearchableContainer interface.

If the container should be writable, meaning that it allows adding (via upload), removal and editing of items then you should also implement the #RygelWritableContainer interface.

If the container should support the change tracking profile of the UPnP ContentDirectory:3 specification then you should also implement the #RygelTrackableContainer interface.

The #RygelSimpleContainer class contains a simple memory-based container implementation, but most real-world uses will require custom container implementations.

All known sub-classes:

- SimpleContainer

Required by:

- SearchableContainer

- TrackableContainer

- WritableContainer

Namespace: Rygel
Package: librygel-server

## Content:

### Constants:

- public const string ALBUM_SORT_CRITERIA
- public const string ANY
- public const string MUSIC_ALBUM
- public const string MUSIC_ARTIST
- public const string MUSIC_GENRE
- public const string PLAYLIST
- public const string STORAGE_FOLDER
- public const string UPNP_CLASS

### Properties:

- public int all_child_count { get; }
- public int child_count { get; set construct; }
- public bool create_mode_enabled { get; set; }
- protected int empty_child_count { public get; public set; }
- public override OCMFlags ocm_flags { get; }
- public string sort_criteria { get; set; }

### Static methods:

- public static bool equal_func (MediaContainer a, MediaContainer b)

### Creation methods:

- protected MediaContainer (string id, MediaContainer? parent, string title, int child_count)
  Create a media container with the specified details.
- protected MediaContainer.root (string title, int child_count)
  Create a root media container with the specified details, with no parent container, and with an appropriate ID.

### Methods:

- public override void constructed ()
- public override DataSource? create_stream_source_for_resource (HTTPRequest request, MediaResource resource) throws Error
- public abstract async MediaObject? find_object (string id, Cancellable? cancellable) throws Error
  Recursively searches this container for a media object with the given ID.
- public abstract async MediaObjects? get_children (uint offset, uint max_count, string sort_criteria, Cancellable? cancellable) throws Error
  Fetches the list of media objects directly under this container.
- public override DIDLLiteObject? serialize (Serializer serializer, HTTPServer http_server) throws Error
- public void updated (MediaObject? object = null, ObjectEventType event_type = MODIFIED, bool sub_tree_update = false)
  This method should be called each time this container is updated.

### Signals:

- public signal void container_updated (MediaContainer container, MediaObject object, ObjectEventType event_type, bool sub_tree_update)
  The container_updated signal is emitted if the subtree unter this container has been modified. The object parameter is set to the MediaObject that is the source of the container update. Note that it may even be set to the container itself.
- public signal void sub_tree_updates_finished (MediaObject sub_tree_root)
  The sub_tree_updates_finished signal is emitted when all of the sub- tree operations are finished. See the #RygelMediaContainer::container_updated signal.

### Fields:

- public int64 storage_used
- public int64 total_deleted_child_count
- public uint32 update_id

### Inherited Members:

All known members inherited from class Rygel.MediaObject

- add_uri
- apply_replacements
- artist
- compare_int_props
- compare_string_props
- constructed
- create_stream_source_for_resource
- creator
- date
- genre

- get_primary_uri
- get_resource_by_name
- get_resource_list
- get_uris
- get_writable
- get_writables
- id
- modified
- object_update_id

- ocm_flags
- parent
- parent_ptr
- parent_ref
- ref_id
- serialize
- serialize_resource_list
- title
- upnp_class

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref