From: Krzesimir Nowak Date: Fri, 23 Nov 2012 16:56:43 +0000 (+0100) Subject: server: Add playlist item. X-Git-Tag: RYGEL_0_17_2_W48~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44dc8913746bfabef633d92dd1138a9b8ef776a4;p=profile%2Fivi%2Frygel.git server: Add playlist item. --- diff --git a/src/librygel-server/filelist.am b/src/librygel-server/filelist.am index ce9158f..bca9cac 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 45f2952..5b6750d 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 0000000..ff4ad8c --- /dev/null +++ b/src/librygel-server/rygel-playlist-item.vala @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2012 Intel Corporation. + * + * Author: Krzesimir Nowak + * + * 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 237dc20..f93aa1a 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;