Fix an issue not to call download_destroy()
[platform/framework/native/content.git] / src / FCnt_AudioMetadataImpl.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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  * @file                FCnt_AudioMetadataImpl.cpp
18  * @brief               This is the implementation file for the %_AudioMetadataImpl class.
19  *
20  * This file contains implementation of the %_AudioMetadataImpl class.
21  */
22
23 #include <FBaseSysLog.h>
24 #include <FCntAudioMetadata.h>
25 #include <FCnt_AudioMetadataImpl.h>
26 #include <FGrp_BitmapImpl.h>
27
28 using namespace std;
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
31
32 namespace Tizen { namespace Content
33 {
34
35 _AudioMetadataImpl::_AudioMetadataImpl(void)
36         : Object()
37 {
38         unique_ptr<AudioMeta, AudioMetaDeleter> pNewAudioMeta(new (nothrow) AudioMeta());
39         if (pNewAudioMeta != null)
40         {
41                 __pAudioMeta = move(pNewAudioMeta);
42         }
43         else
44         {
45                 __pAudioMeta = null;
46                 SysLog(NID_CNT, "The memory is insufficient.");
47         }
48 }
49
50 _AudioMetadataImpl::~_AudioMetadataImpl(void)
51 {
52
53 }
54
55 _AudioMetadataImpl*
56 _AudioMetadataImpl::GetInstance(AudioMetadata& audioMetadata)
57 {
58         return audioMetadata.__pImpl;
59 }
60
61 const _AudioMetadataImpl*
62 _AudioMetadataImpl::GetInstance(const AudioMetadata& audioMetadata)
63 {
64         return audioMetadata.__pImpl;
65 }
66
67 result
68 _AudioMetadataImpl::SetAudioMetadata(const AudioMeta* pAudioMeta)
69 {
70         ClearLastResult();
71
72         SysTryReturnResult(NID_CNT, pAudioMeta != null, E_INVALID_ARG, "pAudioMeta is null.");
73
74         __pAudioMeta->bitrate = pAudioMeta->bitrate;
75         __pAudioMeta->channelCount = pAudioMeta->channelCount;
76         __pAudioMeta->duration = pAudioMeta->duration;
77         __pAudioMeta->frequency = pAudioMeta->frequency;
78         __pAudioMeta->trackNum = pAudioMeta->trackNum;
79         __pAudioMeta->year = pAudioMeta->year;
80         __pAudioMeta->contentPath = pAudioMeta->contentPath;
81
82         if (pAudioMeta->pAlbumName != null)
83         {
84                 __pAudioMeta->pAlbumName = new (nothrow) String(*(pAudioMeta->pAlbumName));
85                 SysTryReturnResult(NID_CNT, __pAudioMeta->pAlbumName != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
86         }
87         if (pAudioMeta->pArtist != null)
88         {
89                 __pAudioMeta->pArtist = new (nothrow) String(*(pAudioMeta->pArtist));
90                 SysTryReturnResult(NID_CNT, __pAudioMeta->pArtist != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
91         }
92         if (pAudioMeta->pComment != null)
93         {
94                 __pAudioMeta->pComment = new (nothrow) String(*(pAudioMeta->pComment));
95                 SysTryReturnResult(NID_CNT, __pAudioMeta->pComment != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
96         }
97         if (pAudioMeta->pDescription != null)
98         {
99                 __pAudioMeta->pDescription = new (nothrow) String(*(pAudioMeta->pDescription));
100                 SysTryReturnResult(NID_CNT, __pAudioMeta->pDescription != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
101         }
102         if (pAudioMeta->pComposer != null)
103         {
104                 __pAudioMeta->pComposer = new (nothrow) String(*(pAudioMeta->pComposer));
105                 SysTryReturnResult(NID_CNT, __pAudioMeta->pComposer != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
106         }
107         if (pAudioMeta->pCopyright != null)
108         {
109                 __pAudioMeta->pCopyright = new (nothrow) String(*(pAudioMeta->pCopyright));
110                 SysTryReturnResult(NID_CNT, __pAudioMeta->pCopyright != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
111         }
112         if (pAudioMeta->pGenre != null)
113         {
114                 __pAudioMeta->pGenre = new (nothrow) String(*(pAudioMeta->pGenre));
115                 SysTryReturnResult(NID_CNT, __pAudioMeta->pGenre != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
116         }
117         if (pAudioMeta->pRecordingDate != null)
118         {
119                 __pAudioMeta->pRecordingDate = new (nothrow) String(*(pAudioMeta->pRecordingDate));
120                 SysTryReturnResult(NID_CNT, __pAudioMeta->pRecordingDate != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
121         }
122         if (pAudioMeta->pTitle != null)
123         {
124                 __pAudioMeta->pTitle = new (nothrow) String(*(pAudioMeta->pTitle));
125                 SysTryReturnResult(NID_CNT, __pAudioMeta->pTitle != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
126         }
127         if (pAudioMeta->pTrackInfo != null)
128         {
129                 __pAudioMeta->pTrackInfo = new (nothrow) String(*(pAudioMeta->pTrackInfo));
130                 SysTryReturnResult(NID_CNT, __pAudioMeta->pTrackInfo != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
131         }
132         if (pAudioMeta->pThumbnail != null)
133         {
134                 __pAudioMeta->pThumbnail = _BitmapImpl::CloneN(*(pAudioMeta->pThumbnail));
135                 if (__pAudioMeta->pThumbnail == null)
136                 {
137                         SysLog(NID_CNT, "_BitmapImpl::CloneN failed.");
138                         // Because thumbnail is one of the metadata, it is not exception in this function but is exception in _AudioMetadataImpl::GetThumbnailN().
139                 }
140         }
141         if (pAudioMeta->pAlbumArt != null)
142         {
143                 __pAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*(pAudioMeta->pAlbumArt));
144                 if (__pAudioMeta->pAlbumArt == null)
145                 {
146                         SysLog(NID_CNT, "_BitmapImpl::CloneN failed.");
147                         // Because album art is one of the metadata, it is not exception in this function but is exception in _AudioMetadataImpl::GetAlbumArtN().
148                 }
149         }
150
151         return E_SUCCESS;
152 }
153
154 AudioMeta*
155 _AudioMetadataImpl::GetAudioMetadata(void) const
156 {
157         return __pAudioMeta.get();
158 }
159
160 _AudioMetadataImpl::_AudioMetadataImpl(const _AudioMetadataImpl& rhs)
161         : Object()
162 {
163         unique_ptr<AudioMeta, AudioMetaDeleter> pNewAudioMeta(new (nothrow) AudioMeta());
164         if (pNewAudioMeta != null)
165         {
166                 pNewAudioMeta->bitrate = (rhs.__pAudioMeta)->bitrate;
167                 pNewAudioMeta->channelCount = (rhs.__pAudioMeta)->channelCount;
168                 pNewAudioMeta->duration = (rhs.__pAudioMeta)->duration;
169                 pNewAudioMeta->frequency = (rhs.__pAudioMeta)->frequency;
170                 pNewAudioMeta->trackNum = (rhs.__pAudioMeta)->trackNum;
171                 pNewAudioMeta->year = (rhs.__pAudioMeta)->year;
172                 pNewAudioMeta->contentPath = (rhs.__pAudioMeta)->contentPath;
173
174                 // pAlbumName
175                 if ((rhs.__pAudioMeta)->pAlbumName != null)
176                 {
177                         pNewAudioMeta->pAlbumName = new (nothrow) String(*((rhs.__pAudioMeta)->pAlbumName));
178                         if (pNewAudioMeta->pAlbumName == null)
179                         {
180                                 SysLog(NID_CNT, "The memory is insufficient.");
181                                 return;
182                         }
183                 }
184                 // pArtist
185                 if ((rhs.__pAudioMeta)->pArtist != null)
186                 {
187                         pNewAudioMeta->pArtist = new (nothrow) String(*((rhs.__pAudioMeta)->pArtist));
188                         if (pNewAudioMeta->pArtist == null)
189                         {
190                                 SysLog(NID_CNT, "The memory is insufficient.");
191                                 return;
192                         }
193                 }
194                 // pComment
195                 if ((rhs.__pAudioMeta)->pComment != null)
196                 {
197                         pNewAudioMeta->pComment = new (nothrow) String(*((rhs.__pAudioMeta)->pComment));
198                         if (pNewAudioMeta->pComment == null)
199                         {
200                                 SysLog(NID_CNT, "The memory is insufficient.");
201                                 return;
202                         }
203                 }
204                 // pDescription
205                 if ((rhs.__pAudioMeta)->pDescription != null)
206                 {
207                         pNewAudioMeta->pDescription = new (nothrow) String(*((rhs.__pAudioMeta)->pDescription));
208                         if (pNewAudioMeta->pDescription == null)
209                         {
210                                 SysLog(NID_CNT, "The memory is insufficient.");
211                                 return;
212                         }
213                 }
214                 // pComposer
215                 if ((rhs.__pAudioMeta)->pComposer != null)
216                 {
217                         pNewAudioMeta->pComposer = new (nothrow) String(*((rhs.__pAudioMeta)->pComposer));
218                         if (pNewAudioMeta->pComposer == null)
219                         {
220                                 SysLog(NID_CNT, "The memory is insufficient.");
221                                 return;
222                         }
223                 }
224                 // pCopyright
225                 if ((rhs.__pAudioMeta)->pCopyright != null)
226                 {
227                         pNewAudioMeta->pCopyright = new (nothrow) String(*((rhs.__pAudioMeta)->pCopyright));
228                         if (pNewAudioMeta->pCopyright == null)
229                         {
230                                 SysLog(NID_CNT, "The memory is insufficient.");
231                                 return;
232                         }
233                 }
234                 // pGenre
235                 if ((rhs.__pAudioMeta)->pGenre != null)
236                 {
237                         pNewAudioMeta->pGenre = new (nothrow) String(*((rhs.__pAudioMeta)->pGenre));
238                         if (pNewAudioMeta->pGenre == null)
239                         {
240                                 SysLog(NID_CNT, "The memory is insufficient.");
241                                 return;
242                         }
243                 }
244                 // pRecordingDate
245                 if ((rhs.__pAudioMeta)->pRecordingDate != null)
246                 {
247                         pNewAudioMeta->pRecordingDate = new (nothrow) String(*((rhs.__pAudioMeta)->pRecordingDate));
248                         if (pNewAudioMeta->pRecordingDate == null)
249                         {
250                                 SysLog(NID_CNT, "The memory is insufficient.");
251                                 return;
252                         }
253                 }
254                 // pTitle
255                 if ((rhs.__pAudioMeta)->pTitle != null)
256                 {
257                         pNewAudioMeta->pTitle = new (nothrow) String(*((rhs.__pAudioMeta)->pTitle));
258                         if (pNewAudioMeta->pTitle == null)
259                         {
260                                 SysLog(NID_CNT, "The memory is insufficient.");
261                                 return;
262                         }
263                 }
264                 // pTrackInfo
265                 if ((rhs.__pAudioMeta)->pTrackInfo != null)
266                 {
267                         pNewAudioMeta->pTrackInfo = new (nothrow) String(*((rhs.__pAudioMeta)->pTrackInfo));
268                         if (pNewAudioMeta->pTrackInfo == null)
269                         {
270                                 SysLog(NID_CNT, "The memory is insufficient.");
271                                 return;
272                         }
273                 }
274                 // pThumbnail
275                 if ((rhs.__pAudioMeta)->pThumbnail != null)
276                 {
277                         pNewAudioMeta->pThumbnail = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pThumbnail));
278                         if (pNewAudioMeta->pThumbnail == null)
279                         {
280                                 SysLog(NID_CNT, "The memory is insufficient.");
281                                 return;
282                         }
283                 }
284                 // pAlbumArt
285                 if ((rhs.__pAudioMeta)->pAlbumArt != null)
286                 {
287                         pNewAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pAlbumArt));
288                         if (pNewAudioMeta->pAlbumArt == null)
289                         {
290                                 SysLog(NID_CNT, "The memory is insufficient.");
291                                 return;
292                         }
293                 }
294
295                 __pAudioMeta = move(pNewAudioMeta);
296         }
297         else
298         {
299                 __pAudioMeta = null;
300                 SysLog(NID_CNT, "The memory is insufficient.");
301         }
302 }
303
304 _AudioMetadataImpl&
305 _AudioMetadataImpl::operator =(const _AudioMetadataImpl& rhs)
306 {
307         // check for self-assignment
308         if (this == &rhs)
309         {
310                 return *this;
311         }
312
313         // __pAudioMeta
314         if (__pAudioMeta != null && (rhs.__pAudioMeta) != null)
315         {
316                 // DeleteMetadata(__pAudioMeta);
317                 // __pAudioMeta = new (nothrow) AudioMeta;
318
319                 __pAudioMeta.reset(new (nothrow) AudioMeta);
320         }
321         else if (__pAudioMeta != null)
322         {
323                 //DeleteMetadata(__pAudioMeta);
324
325                 __pAudioMeta.reset(null);
326                 return *this;
327         }
328         else if ((rhs.__pAudioMeta) != null)
329         {
330                 //__pAudioMeta = new (nothrow) AudioMeta;
331
332                 __pAudioMeta.reset(new (nothrow) AudioMeta);
333         }
334         else
335         {
336                 // __pAudioMeta and rhs.__pAudioMeta are null.
337                 return *this;
338         }
339
340         __pAudioMeta->bitrate = (rhs.__pAudioMeta)->bitrate;
341         __pAudioMeta->channelCount = (rhs.__pAudioMeta)->channelCount;
342         __pAudioMeta->duration = (rhs.__pAudioMeta)->duration;
343         __pAudioMeta->frequency = (rhs.__pAudioMeta)->frequency;
344         __pAudioMeta->trackNum = (rhs.__pAudioMeta)->trackNum;
345         __pAudioMeta->year = (rhs.__pAudioMeta)->year;
346         __pAudioMeta->contentPath = (rhs.__pAudioMeta)->contentPath;
347
348         // pAlbumName
349         if (__pAudioMeta->pAlbumName != null && (rhs.__pAudioMeta)->pAlbumName != null)
350         {
351                 // delete previous data
352                 delete __pAudioMeta->pAlbumName;
353                 __pAudioMeta->pAlbumName = null;
354
355                 __pAudioMeta->pAlbumName = new (nothrow) String(*((rhs.__pAudioMeta)->pAlbumName));
356         }
357         else if (__pAudioMeta->pAlbumName != null)
358         {
359                 delete __pAudioMeta->pAlbumName;
360                 __pAudioMeta->pAlbumName = null;
361         }
362         else if ((rhs.__pAudioMeta)->pAlbumName != null)
363         {
364                 __pAudioMeta->pAlbumName = new (nothrow) String(*((rhs.__pAudioMeta)->pAlbumName));
365         }
366
367         // pArtist
368         if (__pAudioMeta->pArtist != null && (rhs.__pAudioMeta)->pArtist != null)
369         {
370                 // delete previous data
371                 delete __pAudioMeta->pArtist;
372                 __pAudioMeta->pArtist = null;
373
374                 __pAudioMeta->pArtist = new (nothrow) String(*((rhs.__pAudioMeta)->pArtist));
375         }
376         else if (__pAudioMeta->pArtist != null)
377         {
378                 delete __pAudioMeta->pArtist;
379                 __pAudioMeta->pArtist = null;
380         }
381         else if ((rhs.__pAudioMeta)->pArtist != null)
382         {
383                 __pAudioMeta->pArtist = new (nothrow) String(*((rhs.__pAudioMeta)->pArtist));
384         }
385
386         // pComment
387         if (__pAudioMeta->pComment != null && (rhs.__pAudioMeta)->pComment != null)
388         {
389                 // delete previous data
390                 delete __pAudioMeta->pComment;
391                 __pAudioMeta->pComment = null;
392
393                 __pAudioMeta->pComment = new (nothrow) String(*((rhs.__pAudioMeta)->pComment));
394         }
395         else if (__pAudioMeta->pComment != null)
396         {
397                 delete __pAudioMeta->pComment;
398                 __pAudioMeta->pComment = null;
399         }
400         else if ((rhs.__pAudioMeta)->pComment != null)
401         {
402                 __pAudioMeta->pComment = new (nothrow) String(*((rhs.__pAudioMeta)->pComment));
403         }
404
405         // pDescription
406         if (__pAudioMeta->pDescription != null && (rhs.__pAudioMeta)->pDescription != null)
407         {
408                 // delete previous data
409                 delete __pAudioMeta->pDescription;
410                 __pAudioMeta->pDescription = null;
411
412                 __pAudioMeta->pDescription = new (nothrow) String(*((rhs.__pAudioMeta)->pDescription));
413         }
414         else if (__pAudioMeta->pDescription != null)
415         {
416                 delete __pAudioMeta->pDescription;
417                 __pAudioMeta->pDescription = null;
418         }
419         else if ((rhs.__pAudioMeta)->pDescription != null)
420         {
421                 __pAudioMeta->pDescription = new (nothrow) String(*((rhs.__pAudioMeta)->pDescription));
422         }
423
424         // pComposer
425         if (__pAudioMeta->pComposer != null && (rhs.__pAudioMeta)->pComposer != null)
426         {
427                 // delete previous data
428                 delete __pAudioMeta->pComposer;
429                 __pAudioMeta->pComposer = null;
430
431                 __pAudioMeta->pComposer = new (nothrow) String(*((rhs.__pAudioMeta)->pComposer));
432         }
433         else if (__pAudioMeta->pComposer != null)
434         {
435                 delete __pAudioMeta->pComposer;
436                 __pAudioMeta->pComposer = null;
437         }
438         else if ((rhs.__pAudioMeta)->pComposer != null)
439         {
440                 __pAudioMeta->pComposer = new (nothrow) String(*((rhs.__pAudioMeta)->pComposer));
441         }
442
443         // pCopyright
444         if (__pAudioMeta->pCopyright != null && (rhs.__pAudioMeta)->pCopyright != null)
445         {
446                 // delete previous data
447                 delete __pAudioMeta->pCopyright;
448                 __pAudioMeta->pCopyright = null;
449
450                 __pAudioMeta->pCopyright = new (nothrow) String(*((rhs.__pAudioMeta)->pCopyright));
451         }
452         else if (__pAudioMeta->pCopyright != null)
453         {
454                 delete __pAudioMeta->pCopyright;
455                 __pAudioMeta->pCopyright = null;
456         }
457         else if ((rhs.__pAudioMeta)->pCopyright != null)
458         {
459                 __pAudioMeta->pCopyright = new (nothrow) String(*((rhs.__pAudioMeta)->pCopyright));
460         }
461
462         // pGenre
463         if (__pAudioMeta->pGenre != null && (rhs.__pAudioMeta)->pGenre != null)
464         {
465                 // delete previous data
466                 delete __pAudioMeta->pGenre;
467                 __pAudioMeta->pGenre = null;
468
469                 __pAudioMeta->pGenre = new (nothrow) String(*((rhs.__pAudioMeta)->pGenre));
470         }
471         else if (__pAudioMeta->pGenre != null)
472         {
473                 delete __pAudioMeta->pGenre;
474                 __pAudioMeta->pGenre = null;
475         }
476         else if ((rhs.__pAudioMeta)->pGenre != null)
477         {
478                 __pAudioMeta->pGenre = new (nothrow) String(*((rhs.__pAudioMeta)->pGenre));
479         }
480
481         // pRecordingDate
482         if (__pAudioMeta->pRecordingDate != null && (rhs.__pAudioMeta)->pRecordingDate != null)
483         {
484                 // delete previous data
485                 delete __pAudioMeta->pRecordingDate;
486                 __pAudioMeta->pRecordingDate = null;
487
488                 __pAudioMeta->pRecordingDate = new (nothrow) String(*((rhs.__pAudioMeta)->pRecordingDate));
489         }
490         else if (__pAudioMeta->pRecordingDate != null)
491         {
492                 delete __pAudioMeta->pRecordingDate;
493                 __pAudioMeta->pRecordingDate = null;
494         }
495         else if ((rhs.__pAudioMeta)->pRecordingDate != null)
496         {
497                 __pAudioMeta->pRecordingDate = new (nothrow) String(*((rhs.__pAudioMeta)->pRecordingDate));
498         }
499
500         // pTitle
501         if (__pAudioMeta->pTitle != null && (rhs.__pAudioMeta)->pTitle != null)
502         {
503                 // delete previous data
504                 delete __pAudioMeta->pTitle;
505                 __pAudioMeta->pTitle = null;
506
507                 __pAudioMeta->pTitle = new (nothrow) String(*((rhs.__pAudioMeta)->pTitle));
508         }
509         else if (__pAudioMeta->pTitle != null)
510         {
511                 delete __pAudioMeta->pTitle;
512                 __pAudioMeta->pTitle = null;
513         }
514         else if ((rhs.__pAudioMeta)->pTitle != null)
515         {
516                 __pAudioMeta->pTitle = new (nothrow) String(*((rhs.__pAudioMeta)->pTitle));
517         }
518
519         // pTrackInfo
520         if (__pAudioMeta->pTrackInfo != null && (rhs.__pAudioMeta)->pTrackInfo != null)
521         {
522                 // delete previous data
523                 delete __pAudioMeta->pTrackInfo;
524                 __pAudioMeta->pTrackInfo = null;
525
526                 __pAudioMeta->pTrackInfo = new (nothrow) String(*((rhs.__pAudioMeta)->pTrackInfo));
527         }
528         else if (__pAudioMeta->pTrackInfo != null)
529         {
530                 delete __pAudioMeta->pTrackInfo;
531                 __pAudioMeta->pTrackInfo = null;
532         }
533         else if ((rhs.__pAudioMeta)->pTrackInfo != null)
534         {
535                 __pAudioMeta->pTrackInfo = new (nothrow) String(*((rhs.__pAudioMeta)->pTrackInfo));
536         }
537
538         // pThumbnail
539         if (__pAudioMeta->pThumbnail != null && (rhs.__pAudioMeta)->pThumbnail != null)
540         {
541                 // delete previous data
542                 delete __pAudioMeta->pThumbnail;
543                 __pAudioMeta->pThumbnail = null;
544
545                 __pAudioMeta->pThumbnail = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pThumbnail));
546         }
547         else if (__pAudioMeta->pThumbnail != null)
548         {
549                 delete __pAudioMeta->pThumbnail;
550                 __pAudioMeta->pThumbnail = null;
551         }
552         else if ((rhs.__pAudioMeta)->pThumbnail != null)
553         {
554                 __pAudioMeta->pThumbnail = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pThumbnail));
555         }
556
557         // pAlbumArt
558         if (__pAudioMeta->pAlbumArt != null && (rhs.__pAudioMeta)->pAlbumArt != null)
559         {
560                 // delete previous data
561                 delete __pAudioMeta->pAlbumArt;
562                 __pAudioMeta->pAlbumArt = null;
563
564                 __pAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pAlbumArt));
565         }
566         else if (__pAudioMeta->pAlbumArt != null)
567         {
568                 delete __pAudioMeta->pAlbumArt;
569                 __pAudioMeta->pAlbumArt = null;
570         }
571         else if ((rhs.__pAudioMeta)->pAlbumArt != null)
572         {
573                 __pAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pAlbumArt));
574         }
575
576         SysLog(NID_CNT, "_AudioMetadataImpl::operator =(const _AudioMetadataImpl& rhs) is called.");
577         return *this;
578 }
579
580 bool
581 _AudioMetadataImpl::Equals(const Tizen::Base::Object& rhs) const
582 {
583         const _AudioMetadataImpl* pRhs = dynamic_cast <const _AudioMetadataImpl*>(&rhs);
584         if (pRhs == null)
585         {
586                 return false;
587         }
588
589         if (!((this->GetAlbumName()).Equals(pRhs->GetAlbumName())))
590         {
591                 return false;
592         }
593         if (!((this->GetArtist()).Equals(pRhs->GetArtist())))
594         {
595                 return false;
596         }
597         if (this->GetBitrate() != pRhs->GetBitrate())
598         {
599                 return false;
600         }
601         if (this->GetChannelCount() != pRhs->GetChannelCount())
602         {
603                 return false;
604         }
605         if (!((this->GetComment()).Equals(pRhs->GetComment())))
606         {
607                 return false;
608         }
609         if (!((this->GetDescription()).Equals(pRhs->GetDescription())))
610         {
611                 return false;
612         }
613         if (!((this->GetComposer()).Equals(pRhs->GetComposer())))
614         {
615                 return false;
616         }
617         if (!((this->GetCopyright()).Equals(pRhs->GetCopyright())))
618         {
619                 return false;
620         }
621         if (this->GetDuration() != pRhs->GetDuration())
622         {
623                 return false;
624         }
625         if (this->GetFrequency() != pRhs->GetFrequency())
626         {
627                 return false;
628         }
629         if (!((this->GetGenre()).Equals(pRhs->GetGenre())))
630         {
631                 return false;
632         }
633         if (!((this->GetRecordingDate()).Equals(pRhs->GetRecordingDate())))
634         {
635                 return false;
636         }
637         if (!((this->GetTitle()).Equals(pRhs->GetTitle())))
638         {
639                 return false;
640         }
641         if (this->GetTrack() != pRhs->GetTrack())
642         {
643                 return false;
644         }
645         if (!((this->GetTrackInfo()).Equals(pRhs->GetTrackInfo())))
646         {
647                 return false;
648         }
649         if (this->GetYear() != pRhs->GetYear())
650         {
651                 return false;
652         }
653
654         return true;
655 }
656
657 int
658 _AudioMetadataImpl::GetHashCode(void) const
659 {
660         return (this->GetAlbumName()).GetHashCode()
661                         ^ (this->GetArtist()).GetHashCode()
662                         ^ Integer::GetHashCode(this->GetBitrate())
663                         ^ Integer::GetHashCode(this->GetChannelCount())
664                         ^ (this->GetComment()).GetHashCode()
665                         ^ (this->GetDescription()).GetHashCode()
666                         ^ (this->GetComposer()).GetHashCode()
667                         ^ (this->GetCopyright()).GetHashCode()
668                         ^ Long::GetHashCode(this->GetDuration())
669                         ^ Integer::GetHashCode(this->GetFrequency())
670                         ^ (this->GetGenre()).GetHashCode()
671                         ^ (this->GetRecordingDate()).GetHashCode()
672                         ^ (this->GetTitle()).GetHashCode()
673                         ^ Integer::GetHashCode(this->GetTrack())
674                         ^ (this->GetTrackInfo()).GetHashCode()
675                         ^ Integer::GetHashCode(this->GetYear());
676 }
677
678 String
679 _AudioMetadataImpl::GetTitle(void) const
680 {
681         if (__pAudioMeta == null || __pAudioMeta->pTitle == null)
682         {
683                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pTitle is null.");
684                 return String();
685         }
686         return *(__pAudioMeta->pTitle);
687 }
688
689 int
690 _AudioMetadataImpl::GetBitrate(void) const
691 {
692         if (__pAudioMeta == null)
693         {
694                 SysLog(NID_CNT, "__pAudioMeta is null.");
695                 return 0;
696         }
697         return __pAudioMeta->bitrate;
698 }
699
700 int
701 _AudioMetadataImpl::GetFrequency(void) const
702 {
703         if (__pAudioMeta == null)
704         {
705                 SysLog(NID_CNT, "__pAudioMeta is null.");
706                 return 0;
707         }
708         return __pAudioMeta->frequency;
709 }
710
711 String
712 _AudioMetadataImpl::GetArtist(void) const
713 {
714         if (__pAudioMeta == null || __pAudioMeta->pArtist == null)
715         {
716                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pArtist is null.");
717                 return String();
718         }
719         return *(__pAudioMeta->pArtist);
720 }
721
722 String
723 _AudioMetadataImpl::GetAlbumName(void) const
724 {
725         if (__pAudioMeta == null || __pAudioMeta->pAlbumName == null)
726         {
727                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pAlbumName is null.");
728                 return String();
729         }
730         return *(__pAudioMeta->pAlbumName);
731 }
732
733 String
734 _AudioMetadataImpl::GetComment(void) const
735 {
736         if (__pAudioMeta == null || __pAudioMeta->pComment == null)
737         {
738                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pComment is null.");
739                 return String();
740         }
741         return *(__pAudioMeta->pComment);
742 }
743
744 String
745 _AudioMetadataImpl::GetDescription(void) const
746 {
747         if (__pAudioMeta == null || __pAudioMeta->pDescription == null)
748         {
749                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pDescription is null.");
750                 return String();
751         }
752         return *(__pAudioMeta->pDescription);
753 }
754
755 int
756 _AudioMetadataImpl::GetTrack(void) const
757 {
758         if (__pAudioMeta == null)
759         {
760                 SysLog(NID_CNT, "__pAudioMeta is null.");
761                 return 0;
762         }
763         return __pAudioMeta->trackNum;
764 }
765
766 String
767 _AudioMetadataImpl::GetGenre(void) const
768 {
769         if (__pAudioMeta == null || __pAudioMeta->pGenre == null)
770         {
771                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pGenre is null.");
772                 return String();
773         }
774         return *(__pAudioMeta->pGenre);
775 }
776
777 String
778 _AudioMetadataImpl::GetComposer(void) const
779 {
780         if (__pAudioMeta == null || __pAudioMeta->pComposer == null)
781         {
782                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pComposer is null.");
783                 return String();
784         }
785         return *(__pAudioMeta->pComposer);
786 }
787
788 String
789 _AudioMetadataImpl::GetCopyright(void) const
790 {
791         if (__pAudioMeta == null || __pAudioMeta->pCopyright == null)
792         {
793                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pCopyright is null.");
794                 return String();
795         }
796         return *(__pAudioMeta->pCopyright);
797 }
798
799 long
800 _AudioMetadataImpl::GetDuration(void) const
801 {
802         if (__pAudioMeta == null)
803         {
804                 SysLog(NID_CNT, "__pAudioMeta is null.");
805                 return 0;
806         }
807         return __pAudioMeta->duration;
808 }
809
810 int
811 _AudioMetadataImpl::GetYear(void) const
812 {
813         if (__pAudioMeta == null)
814         {
815                 SysLog(NID_CNT, "__pAudioMeta is null.");
816                 return 0;
817         }
818         return __pAudioMeta->year;
819 }
820
821 String
822 _AudioMetadataImpl::GetTrackInfo(void) const
823 {
824         if (__pAudioMeta == null || __pAudioMeta->pTrackInfo == null)
825         {
826                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pTrackInfo is null.");
827                 return String();
828         }
829         return *(__pAudioMeta->pTrackInfo);
830 }
831
832 String
833 _AudioMetadataImpl::GetRecordingDate(void) const
834 {
835         if (__pAudioMeta == null || __pAudioMeta->pRecordingDate == null)
836         {
837                 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pRecordingDate is null.");
838                 return String();
839         }
840         return *(__pAudioMeta->pRecordingDate);
841 }
842
843 int
844 _AudioMetadataImpl::GetChannelCount(void) const
845 {
846         if (__pAudioMeta == null)
847         {
848                 SysLog(NID_CNT, "__pAudioMeta is null.");
849                 return 0;
850         }
851         return __pAudioMeta->channelCount;
852 }
853
854 //
855 // E_SUCCESS
856 // E_DATA_NOT_FOUND
857 // - E_OUT_OF_MEMORY
858 //
859 Bitmap*
860 _AudioMetadataImpl::GetThumbnailN(void) const
861 {
862         ClearLastResult();
863
864         if (__pAudioMeta == null || __pAudioMeta->pThumbnail == null)
865         {
866                 SysLogException(NID_CNT, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] __pAudioMeta or __pAudioMeta->pThumbnail is null.");
867                 return null;
868         }
869
870         Bitmap* pBitmap = _BitmapImpl::CloneN(*(__pAudioMeta->pThumbnail));
871         SysTryReturn(NID_CNT, pBitmap != null, null, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] _BitmapImpl::CloneN failed.");
872
873         return pBitmap;
874 }
875
876 //
877 // E_SUCCESS
878 // E_DATA_NOT_FOUND
879 // - E_OUT_OF_MEMORY
880 //
881 Bitmap*
882 _AudioMetadataImpl::GetAlbumArtN(void) const
883 {
884         ClearLastResult();
885
886         if (__pAudioMeta == null || __pAudioMeta->pAlbumArt == null)
887         {
888                 SysLogException(NID_CNT, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] __pAudioMeta or __pAudioMeta->pAlbumArt is null.");
889                 return null;
890         }
891
892         Bitmap* pBitmap = _BitmapImpl::CloneN(*(__pAudioMeta->pAlbumArt));
893         SysTryReturn(NID_CNT, pBitmap != null, null, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] _BitmapImpl::CloneN failed.");
894
895         return pBitmap;
896 }
897 }}