public DVBChannelGroup (uint gid,
string title,
- string parent_id,
+ MediaContainer parent,
dynamic DBus.Object channel_list) {
base (GID_PREFIX + gid.to_string (), // UPnP ID
- parent_id,
+ parent,
title,
0);
this.gid = gid;
// Create Channels
try {
var channel = new DVBChannel (channel_id,
- this.id,
+ this,
channel_list);
this.channels.add (channel);
} catch (GLib.Error error) {
private uint cid; /* The DVB Daemon Channel ID */
public DVBChannel (uint cid,
- string parent_id,
+ MediaContainer parent,
dynamic DBus.Object channel_list) throws GLib.Error {
- string id = parent_id + ":" + cid.to_string (); /* UPnP ID */
+ string id = parent.id + ":" + cid.to_string (); /* UPnP ID */
base (id,
- parent_id,
+ parent,
"Unknown", /* Title Unknown at this point */
"Unknown"); /* UPnP Class Unknown at this point */
// Create ChannelGroup for each registered device group
this.groups.add (new DVBChannelGroup (group_id,
group_name,
- this.id,
+ this,
channel_list));
}
public class Rygel.TestAudioItem : Rygel.TestItem {
const string TEST_MIMETYPE = "audio/x-wav";
- public TestAudioItem (string id,
- string parent_id,
- string title) {
+ public TestAudioItem (string id,
+ MediaContainer parent,
+ string title) {
base (id,
- parent_id,
+ parent,
title,
TEST_MIMETYPE,
MediaItem.AUDIO_CLASS);
public abstract class Rygel.TestItem : Rygel.MediaItem {
const string TEST_AUTHOR = "Zeeshan Ali (Khattak)";
- public TestItem (string id,
- string parent_id,
- string title,
- string mime,
- string upnp_class) {
- base (id, parent_id, title, upnp_class);
+ public TestItem (string id,
+ MediaContainer parent,
+ string title,
+ string mime,
+ string upnp_class) {
+ base (id, parent, title, upnp_class);
this.mime_type = mime;
this.author = TEST_AUTHOR;
this.items = new ArrayList<MediaItem> ();
this.items.add (new TestAudioItem ("sinewave",
- this.id,
+ this,
"Sine Wave"));
this.items.add (new TestVideoItem ("smtpe",
- this.id,
+ this,
"SMTPE"));
// Now we know how many top-level items we have
public class Rygel.TestVideoItem : Rygel.TestItem {
const string TEST_MIMETYPE = "video/mpeg";
- public TestVideoItem (string id,
- string parent_id,
- string title) {
+ public TestVideoItem (string id,
+ MediaContainer parent,
+ string title) {
base (id,
- parent_id,
+ parent,
title,
TEST_MIMETYPE,
MediaItem.VIDEO_CLASS);
Gee.List<AsyncResult> results;
- public TrackerCategory (string id,
- string parent_id,
- string title,
- string category,
- string child_class) {
- base (id, parent_id, title, 0);
+ public TrackerCategory (string id,
+ MediaContainer parent,
+ string title,
+ string category,
+ string child_class) {
+ base (id, parent, title, 0);
this.category = category;
this.child_class = child_class;
* Represents Tracker Image category.
*/
public class Rygel.TrackerImageCategory : Rygel.TrackerCategory {
- public TrackerImageCategory (string id,
- string parent_id,
- string title) {
- base (id, parent_id, title, "Images", MediaItem.IMAGE_CLASS);
+ public TrackerImageCategory (string id,
+ MediaContainer parent,
+ string title) {
+ base (id, parent, title, "Images", MediaItem.IMAGE_CLASS);
}
protected override string[] get_metadata_keys () {
string path,
TrackerCategory parent,
string[] metadata) {
- base (id, parent.id, "", parent.child_class);
+ base (id, parent, "", parent.child_class);
this.path = path;
* Represents Tracker Music category.
*/
public class Rygel.TrackerMusicCategory : Rygel.TrackerCategory {
- public TrackerMusicCategory (string id,
- string parent_id,
- string title) {
- base (id, parent_id, title, "Music", MediaItem.MUSIC_CLASS);
+ public TrackerMusicCategory (string id,
+ MediaContainer parent,
+ string title) {
+ base (id, parent, title, "Music", MediaItem.MUSIC_CLASS);
}
protected override string[] get_metadata_keys () {
this.categories = new ArrayList<TrackerCategory> ();
this.categories.add
(new TrackerImageCategory ("16",
- this.id,
+ this,
"All Images"));
this.categories.add
(new TrackerMusicCategory ("14",
- this.id,
+ this,
"All Music"));
this.categories.add
(new TrackerVideoCategory ("15",
- this.id,
+ this,
"All Videos"));
// Now we know how many top-level containers we have
* Represents Tracker Video category.
*/
public class Rygel.TrackerVideoCategory : Rygel.TrackerCategory {
- public TrackerVideoCategory (string id,
- string parent_id,
- string title) {
- base (id, parent_id, title, "Videos", MediaItem.VIDEO_CLASS);
+ public TrackerVideoCategory (string id,
+ MediaContainer parent,
+ string title) {
+ base (id, parent, title, "Videos", MediaItem.VIDEO_CLASS);
}
protected override string[] get_metadata_keys () {
private void serialize_item (MediaItem item) throws Error {
this.start_item (item.id,
- item.parent_id,
+ item.parent.id,
null,
false);
private void serialize_container (MediaContainer container) throws Error {
this.start_container (container.id,
- container.parent_id,
+ container.parent.id,
(int) container.child_count,
false,
false);
public uint child_count;
public uint32 update_id;
- public MediaContainer (string id,
- string parent_id,
- string title,
- uint child_count) {
+ public MediaContainer (string id,
+ MediaContainer? parent,
+ string title,
+ uint child_count) {
this.id = id;
- this.parent_id = parent_id;
+ this.parent = parent;
this.title = title;
this.child_count = child_count;
this.update_id = uint32.MAX; // undefined for non-root containers
public MediaContainer.root (string title,
uint child_count) {
- this ("0", "-1", title, child_count);
+ this ("0", null, title, child_count);
this.update_id = 0;
}
public int height = -1;
public int color_depth = -1;
- public MediaItem (string id,
- string parent_id,
- string title,
- string upnp_class) {
+ public MediaItem (string id,
+ MediaContainer parent,
+ string title,
+ string upnp_class) {
this.id = id;
- this.parent_id = parent_id;
+ this.parent = parent;
this.title = title;
this.upnp_class = upnp_class;
}
*/
public abstract class Rygel.MediaObject : GLib.Object {
public string id;
- public string parent_id;
public string title;
+
+ public unowned MediaContainer parent;
}