[MediaController] Code refactoring
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia / MediaController / MediaControllerMetadata.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 using System.Collections.Generic;
19
20 namespace Tizen.Multimedia.MediaController
21 {
22     /// <summary>
23     /// Metadata represents a metadata of media for server application to play
24     /// </summary>
25     public class MediaControllerMetadata
26     {
27         /// <summary>
28         /// The constructor of MediaControllerMetadata class.
29         /// </summary>
30         public MediaControllerMetadata()
31         {
32             // Do nothing
33         }
34
35         internal MediaControllerMetadata(IntPtr _handle) {
36             string _title;
37             string _artist;
38             string _album;
39             string _author;
40             string _genre;
41             string _duration;
42             string _date;
43             string _copyright;
44             string _description;
45             string _track_number;
46             string _picture;
47
48             MediaControllerValidator.ThrowIfError(
49                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Title, out _title),
50                     "Get Title failed");
51
52             MediaControllerValidator.ThrowIfError(
53                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Artist, out _artist),
54                     "Get Artist failed");
55
56             MediaControllerValidator.ThrowIfError(
57                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Album, out _album),
58                     "Get Album failed");
59
60             MediaControllerValidator.ThrowIfError(
61                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Author, out _author),
62                     "Get Author failed");
63
64             MediaControllerValidator.ThrowIfError(
65                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Genre, out _genre),
66                     "Get Genre failed");
67
68             MediaControllerValidator.ThrowIfError(
69                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Duration, out _duration),
70                     "Get Duration failed");
71
72             MediaControllerValidator.ThrowIfError(
73                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Date, out _date),
74                     "Get Date failed");
75
76             MediaControllerValidator.ThrowIfError(
77                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Copyright, out _copyright),
78                     "Get Copyright failed");
79
80             MediaControllerValidator.ThrowIfError(
81                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Description, out _description),
82                     "Get Description failed");
83
84             MediaControllerValidator.ThrowIfError(
85                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.TrackNumber, out _track_number),
86                     "Get TrackNumber failed");
87
88             MediaControllerValidator.ThrowIfError(
89                     Interop.MediaControllerClient.GetMetadata(_handle, MediaControllerAttributes.Picture, out _picture),
90                     "Get Picture failed");
91
92             Title = _title;
93             Artist = _artist;
94             Album = _album;
95             Author = _author;
96             Genre = _genre;
97             Duration = _duration;
98             Date = _date;
99             Copyright = _copyright;
100             Description = _description;
101             TrackNumber = _track_number;
102             Picture = _picture;
103         }
104
105         /// <summary>
106         /// Set/Get the Title of media
107         /// </summary>
108         public string Title { get; set; }
109
110         /// <summary>
111         /// Set/Get the Artist of media
112         /// </summary>
113         public string Artist { get; set; }
114
115         /// <summary>
116         /// Set/Get the Album of media
117         /// </summary>
118         public string Album { get; set; }
119
120         /// <summary>
121         /// Set/Get the Author of media
122         /// </summary>
123         public string Author { get; set; }
124  
125         /// <summary>
126         /// Set/Get the Genre of media
127         /// </summary>
128         public string Genre { get; set; }
129
130         /// <summary>
131         /// Set/Get the Duration of media
132         /// </summary>
133         public string Duration { get; set; }
134
135         /// <summary>
136         /// Set/Get the Date of media
137         /// </summary>
138         public string Date { get; set; }
139
140         /// <summary>
141         /// Set/Get the Copyright of media
142         /// </summary>
143         public string Copyright { get; set; }
144
145         /// <summary>
146         /// Set/Get the Description of media
147         /// </summary>
148         public string Description { get; set; }
149
150         /// <summary>
151         /// Set/Get the Track Number of media
152         /// </summary>
153         public string TrackNumber { get; set; }
154
155         /// <summary>
156         /// Set/Get the Picture of media
157         /// </summary>
158         public string Picture { get; set; }
159     }
160 }
161