summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzesimir Nowak <krnowak@openismus.com>2012-11-23 17:56:43 +0100
committerKrzesimir Nowak <krnowak@openismus.com>2012-11-27 17:02:19 +0100
commit44dc8913746bfabef633d92dd1138a9b8ef776a4 (patch)
tree64aefa118d67ebfa76d69c8e49ae150c53ae918f
parente15cd9c9a26b7f7cf8c4db6b62408e817b256689 (diff)
downloadrygel-44dc8913746bfabef633d92dd1138a9b8ef776a4.tar.gz
server: Add playlist item.
-rw-r--r--src/librygel-server/filelist.am3
-rw-r--r--src/librygel-server/rygel-item-creator.vala2
-rw-r--r--src/librygel-server/rygel-playlist-item.vala41
-rw-r--r--tests/rygel-item-creator-test.vala9
4 files changed, 54 insertions, 1 deletions
diff --git a/src/librygel-server/filelist.am b/src/librygel-server/filelist.am
index ce9158fc..bca9cace 100644
--- a/src/librygel-server/filelist.am
+++ b/src/librygel-server/filelist.am
@@ -28,7 +28,8 @@ LIBRYGEL_SERVER_VAPI_SOURCE_FILES = \
rygel-media-engine.vala \
rygel-http-seek.vala \
rygel-data-source.vala \
- rygel-updatable-object.vala
+ rygel-updatable-object.vala \
+ rygel-playlist-item.vala
LIBRYGEL_SERVER_NONVAPI_SOURCE_FILES = \
rygel-browse.vala \
diff --git a/src/librygel-server/rygel-item-creator.vala b/src/librygel-server/rygel-item-creator.vala
index 45f2952a..5b6750d1 100644
--- a/src/librygel-server/rygel-item-creator.vala
+++ b/src/librygel-server/rygel-item-creator.vala
@@ -447,6 +447,8 @@ internal class Rygel.ItemCreator: GLib.Object, Rygel.StateMachine {
return new AudioItem (id, parent, title);
case MusicItem.UPNP_CLASS:
return new MusicItem (id, parent, title);
+ case PlaylistItem.UPNP_CLASS:
+ return new PlaylistItem (id, parent, title);
default:
throw new ContentDirectoryError.BAD_METADATA
("Creation of item of class '%s' " +
diff --git a/src/librygel-server/rygel-playlist-item.vala b/src/librygel-server/rygel-playlist-item.vala
new file mode 100644
index 00000000..ff4ad8c4
--- /dev/null
+++ b/src/librygel-server/rygel-playlist-item.vala
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * Author: Krzesimir Nowak <krnowak@openismus.com>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * Represents a playlist item.
+ *
+ * These objects correspond to DLNA's DIDL_S items.
+ */
+public class Rygel.PlaylistItem : MediaItem {
+ public new const string UPNP_CLASS = "object.item.playlistItem";
+
+ public PlaylistItem (string id,
+ MediaContainer parent,
+ string title,
+ string upnp_class = PlaylistItem.UPNP_CLASS) {
+ base (id, parent, title, upnp_class);
+ }
+
+ public override bool streamable () {
+ return false;
+ }
+}
diff --git a/tests/rygel-item-creator-test.vala b/tests/rygel-item-creator-test.vala
index 237dc204..f93aa1a3 100644
--- a/tests/rygel-item-creator-test.vala
+++ b/tests/rygel-item-creator-test.vala
@@ -183,6 +183,15 @@ public class Rygel.PhotoItem : Rygel.MediaItem {
base (id, parent, title);
}
}
+
+public class Rygel.PlaylistItem : Rygel.MediaItem {
+ public const string UPNP_CLASS = "object.item.playlistItem";
+
+ public PlaylistItem (string id, MediaContainer parent, string title) {
+ base (id, parent, title);
+ }
+}
+
public class Rygel.ContentDirectory : GLib.Object {
public Cancellable cancellable;
public MediaContainer root_container;