[content] Fix description in DownloadManager
[platform/framework/native/content.git] / inc / FCntAudioMetadata.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file                        FCntAudioMetadata.h
19  * @brief               This is the header file for the %AudioMetadata class.
20  *
21  * This header file contains the declarations of the %AudioMetadata class.
22  */
23
24 #ifndef _FCNT_AUDIO_METADATA_H_
25 #define _FCNT_AUDIO_METADATA_H_
26
27 #include <FBaseObject.h>
28
29 namespace Tizen { namespace Graphics
30 {
31 class Bitmap;
32 }}
33
34 namespace Tizen { namespace Content
35 {
36
37 class _AudioMetadataImpl;
38
39 /**
40  * @class       AudioMetadata
41  * @brief       This class provides methods to access the audio metadata.
42  *
43  * @since       2.0
44  *
45  * The %AudioMetadata class provides methods to access the audio metadata that contains audio content-specific attributes.
46  *
47  * The following example demonstrates how to use the %AudioMetadata class.
48  *
49  * @code
50  * result
51  * MyClass::TestAudioMetadata(void)
52  * {
53  *              result r = E_SUCCESS;
54  *
55  *              Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Sounds/hot.mp3";
56  *              AudioMetadata* pAudioMeta = ContentManagerUtil::GetAudioMetaN(contentPath);
57  *              TryReturn(pAudioMeta != null, GetLastResult(), "ContentManagerUtil::GetAudioMetaN failed.");
58  *
59  *              // Title
60  *              pAudioMeta->GetTitle();
61  *
62  *              // Frequency
63  *              pAudioMeta->GetFrequency();
64  *
65  *              // Artist
66  *              pAudioMeta->GetArtist();
67  *
68  *              // Album name
69  *              pAudioMeta->GetAlbumName();
70  *
71  *              // Duration
72  *              pAudioMeta->GetDuration();
73  *
74  *              // Year
75  *              pAudioMeta->GetYear();
76  *
77  *              // Thumbnail
78  *              Tizen::Media::Image image;
79  *              r = image.Construct();
80  *              if (IsFailed(r))
81  *              {
82  *                      delete pAudioMeta;
83  *                      return r;
84  *              }
85  *
86  *              Tizen::Graphics::Bitmap* pBitmap = pAudioMeta->GetThumbnailN();
87  *              if (pBitmap == null)
88  *              {
89  *                      delete pAudioMeta;
90  *                      return GetLastResult();
91  *              }
92  *
93  *              Tizen::Base::String thumbnailPath = Tizen::System::Environment::GetMediaPath() + L"Images/audio.bmp";
94  *              r = image.EncodeToFile(*pBitmap, Tizen::Media::IMG_FORMAT_BMP, thumbnailPath, false);
95  *              if (IsFailed(r))
96  *              {
97  *                      delete pAudioMeta;
98  *                      delete pBitmap;
99  *                      return r;
100  *              }
101  *
102  *              delete pAudioMeta;
103  *              delete pBitmap;
104  *
105  *              return r;
106  * }
107  * @endcode
108  */
109 class _OSP_EXPORT_ AudioMetadata
110         : virtual public Tizen::Base::Object
111 {
112 public:
113         /**
114          * This is the default constructor for this class.
115          *
116          * @since               2.0
117          */
118         AudioMetadata(void);
119
120         /**
121          * Copying of objects using this copy constructor is allowed.
122          *
123          * @since               2.0
124          *
125          * @param[in]   rhs     An instance of %AudioMetadata
126          */
127         AudioMetadata(const AudioMetadata& rhs);
128
129         /**
130          * This destructor overrides Tizen::Base::Object::~Object().
131          *
132          * @since               2.0
133          */
134         virtual ~AudioMetadata(void);
135
136         /**
137          * Gets the title of the audio file.
138          *
139          * @since               2.0
140          *
141          * @return              The title of the audio file
142          */
143         Tizen::Base::String GetTitle(void) const;
144
145         /**
146          * Gets the bit rate of the audio file.
147          *
148          * @since               2.0
149          *
150          * @return              The audio bit rate in bits per second (bps)
151          */
152         int GetBitrate(void) const;
153
154         /**
155          * Gets the frequency of the audio file.
156          *
157          * @since               2.0
158          *
159          * @return              The frequency in hertz (hz)
160          */
161         int GetFrequency(void) const;
162
163         /**
164          * Gets the artist information of the audio file.
165          *
166          * @since               2.0
167          *
168          * @return              The artist information of the audio file
169          */
170         Tizen::Base::String GetArtist(void) const;
171
172         /**
173          * Gets the album name of the audio file.
174          *
175          * @since               2.0
176          *
177          * @return              The album name of the audio file
178          */
179         Tizen::Base::String GetAlbumName(void) const;
180
181         /**
182          * Gets the comment of the audio file.
183          *
184          * @since               2.0
185          *
186          * @return              The comment of the audio file
187          */
188         Tizen::Base::String GetComment(void) const;
189
190         /**
191          * Gets the description of the audio file.
192          *
193          * @since               2.1
194          *
195          * @return              The description of the audio file
196          */
197         Tizen::Base::String GetDescription(void) const;
198
199         /**
200          * Gets the track number of the audio file.
201          *
202          * @since               2.0
203          *
204          * @return              The track number of the audio file
205          */
206         int GetTrack(void) const;
207
208         /**
209          * Gets the genre information of the audio file.
210          *
211          * @since               2.0
212          *
213          * @return              The genre information of the audio file
214          */
215         Tizen::Base::String GetGenre(void) const;
216
217         /**
218          * Gets the composer information of the audio file.
219          *
220          * @since               2.0
221          *
222          * @return              The composer information of the audio file
223          */
224         Tizen::Base::String GetComposer(void) const;
225
226         /**
227          * Gets the copyright information of the audio file.
228          *
229          * @since               2.0
230          *
231          * @return              The copyright information of the audio file
232          */
233         Tizen::Base::String GetCopyright(void) const;
234
235         /**
236          * Gets the duration of the audio file.
237          *
238          * @since               2.0
239          *
240          * @return              The duration in milliseconds
241          */
242         long GetDuration(void) const;
243
244         /**
245          * Gets the year information of the audio file.
246          *
247          * @since               2.0
248          *
249          * @return              The year information of the audio file
250          */
251         int GetYear(void) const;
252
253         /**
254          * Gets the track information of the audio file.
255          *
256          * @since               2.0
257          *
258          * @return              The track number/position in set
259          * @remarks     This method returns track information that is embedded in the content metadata. @n
260          *                                      The format returned can be like "4/9" or "4" (in case the position is not available).
261          */
262         Tizen::Base::String GetTrackInfo(void) const;
263
264         /**
265          * Gets the recording date of the audio file.
266          *
267          * @since               2.0
268          *
269          * @return              The recording date of the audio file
270          */
271         Tizen::Base::String GetRecordingDate(void) const;
272
273         /**
274          * Gets the number of channels of the audio file.
275          *
276          * @since               2.0
277          *
278          * @return              The number of channels of the audio file
279          * @remarks     A monophonic stream has one channel and a stereophonic stream has two channels. @n
280          *                                      Valid values are either @c 1 or @c 2.
281          */
282         int GetChannelCount(void) const;
283
284         /**
285          * Gets the thumbnail of the audio file.
286          *
287          * @since                       2.0
288          *
289          * @return                      A pointer to the thumbnail image
290          * @exception   E_SUCCESS                                       The method is successful.
291          * @exception   E_DATA_NOT_FOUND                The thumbnail image does not exist.
292          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
293          * @remarks             This method returns the thumbnail image that is resized to 80x60 pixels. @n
294          *                  The specific error code can be accessed using the GetLastResult() method.
295          */
296         Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
297
298         /**
299          * Gets the album art of the audio file.
300          *
301          * @since                       2.0
302          *
303          * @return                      A pointer to the album art
304          * @exception   E_SUCCESS                                       The method is successful.
305          * @exception   E_DATA_NOT_FOUND                The album art does not exist.
306          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
307          * @remarks             GetThumbnailN() returns the thumbnail image that is resized to 80x60 pixels. @n
308          *                                              GetAlbumArtN() returns the original album art that is embedded in the content metadata. @n
309          *                                              The specific error code can be accessed using the GetLastResult() method.
310          */
311         Tizen::Graphics::Bitmap* GetAlbumArtN(void) const;
312
313         /**
314          * Compares the equality of values between two %AudioMetadata objects by overriding the Tizen::Base::Object::Equals() method.
315          *
316          * @since          2.0
317          *
318          * @return         @c true if all the fields in the objects are equal, @n
319          *                     else @c false
320          * @param[in]    rhs     The Tizen::Base::Object with which the comparison is done
321          * @remarks             An instance of Tizen::Graphics::Bitmap is not taken into account in the comparisons.
322          */
323         virtual bool Equals(const Tizen::Base::Object& rhs) const;
324
325         /**
326          * Gets the hash value of the current instance by overriding the Tizen::Base::Object::GetHashCode() method.
327          *
328          * @since         2.0
329          *
330          * @return        The hash value of the current instance
331          */
332         virtual int GetHashCode(void) const;
333
334         /**
335          * Copying of objects using this copy assignment operator is allowed.
336          *
337          * @since          2.0
338          *
339          * @return         A reference to this instance
340          * @param[in]    rhs An instance of %AudioMetadata
341          */
342         AudioMetadata& operator =(const AudioMetadata& rhs);
343
344 private:
345         friend class _AudioMetadataImpl;
346         _AudioMetadataImpl* __pImpl;
347
348 };  // class AudioMetadata
349
350 }}  // Tizen::Content
351
352 #endif  // _FCNT_AUDIO_METADATA_H_