Release 4.0.0-preview1-00172
[platform/core/csapi/tizenfx.git] / src / Tizen.Content.MediaContent / Tizen.Content.MediaContent / Album.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18
19 namespace Tizen.Content.MediaContent
20 {
21     /// <summary>
22     /// Represents a logical collection grouping of related media information.
23     /// </summary>
24     /// <seealso cref="AlbumCommand"/>
25     public class Album
26     {
27         internal Album(IntPtr handle)
28         {
29             Id = InteropHelper.GetValue<int>(handle, Interop.Album.GetId);
30
31             Artist = InteropHelper.GetString(handle, Interop.Album.GetArtist);
32             AlbumArtPath = InteropHelper.GetString(handle, Interop.Album.GetAlbumArt);
33             Name = InteropHelper.GetString(handle, Interop.Album.GetName);
34         }
35
36         internal static Album FromHandle(IntPtr handle) => new Album(handle);
37
38         /// <summary>
39         /// Gets the ID of the album.
40         /// </summary>
41         /// <value>The unique ID of the album.</value>
42         public int Id { get; }
43
44         /// <summary>
45         /// Gets the artist name of the album.
46         /// </summary>
47         /// <value>The artist name.</value>
48         public string Artist { get; }
49
50         /// <summary>
51         /// Gets the path to the album art.
52         /// </summary>
53         /// <value>The path to the album art.</value>
54         public string AlbumArtPath { get; }
55
56         /// <summary>
57         /// Gets the name of the album.
58         /// </summary>
59         /// <value>The album name.</value>
60         public string Name { get; }
61
62         /// <summary>
63         /// Returns a string representation of the album.
64         /// </summary>
65         /// <returns>A string representation of the current album.</returns>
66         public override string ToString() =>
67             $"Id={Id}, Name={Name}, Artist={Artist}, AlbumArtPath={AlbumArtPath}";
68     }
69 }