2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 namespace Tizen.Content.MediaContent
22 /// Represents a playlist that is a group of media(usually songs).
26 internal Playlist(IntPtr handle)
28 Name = InteropHelper.GetString(handle, Interop.Playlist.GetName);
29 ThumbnailPath = InteropHelper.GetString(handle, Interop.Playlist.GetThumbnailPath);
31 Id = InteropHelper.GetValue<IntPtr, int>(handle, Interop.Playlist.GetId);
34 internal static Playlist FromHandle(IntPtr handle) => new Playlist(handle);
37 /// Gets the ID of the playlist.
39 /// <value>The unique id of the playlist.</value>
40 public int Id { get; }
43 /// Gets the name of the playlist.
45 /// <value>The name of the playlist.</value>
46 public string Name { get; }
49 /// Gets the path to the thumbnail.
51 /// <value>The path to the thumbnail.</value>
52 public string ThumbnailPath { get; }
55 /// Returns a string representation of the playlist.
57 /// <returns>A string representation of the current playlist.</returns>
58 public override string ToString() =>
59 $"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}";
63 /// Provides means to set values used for the update command.
66 /// The values only set in the object will be affected to the update command.
68 /// <seealso cref="PlaylistCommand.Update(int, PlaylistUpdateValues)"/>
69 public class PlaylistUpdateValues
72 /// Gets or sets the name of playlist for update.
74 /// <remarks>If the value is null, the update operation will have no effect on the field.</remarks>
75 /// <value>A string for name; the field will not be updated if null.</value>
76 public string Name { get; set; }
79 /// Gets or sets the thumbnail path of playlist for update.
81 /// <remarks>If the value is null, the update operation will have no effect on the field.</remarks>
82 /// <value>A string for thumbnail path; the field will not be updated if null.</value>
83 public string ThumbnailPath { get; set; }
87 /// Represents an order of a member of a playlist.
89 public class PlayOrder
92 /// Initializes a new instance of the <see cref="Playlist"/> class with the specified member id and order value.
94 /// <param name="memberId">The id of member.</param>
95 /// <param name="orderValue">The order value.</param>
96 /// <exception cref="ArgumentOutOfRangeException">
97 /// <paramref name="memberId"/> is less than or equal to zero.\n
99 /// <paramref name="orderValue"/> is less than zero.
101 public PlayOrder(int memberId, int orderValue)
107 private int _memberId;
110 /// Gets or sets the member id.
112 /// <value>The member id.</value>
113 /// <exception cref="ArgumentOutOfRangeException">
114 /// <paramref name="value"/> is less than or equal to zero.
123 throw new ArgumentOutOfRangeException(nameof(value), value,
124 "Member id can't be less than or equal to zero.");
133 /// Gets or sets the value indicating the order of the member in a playlist.
135 /// <value>A integer value indicating the order of the member in a playlist.</value>
136 /// <exception cref="ArgumentOutOfRangeException">
137 /// <paramref name="value"/> is less than zero.
146 throw new ArgumentOutOfRangeException(nameof(value), value,
147 "Order can't be less than zero.");