2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FCnt_AudioMetadataImpl.cpp
19 * @brief This is the implementation file for the %_AudioMetadataImpl class.
21 * This file contains implementation of the %_AudioMetadataImpl class.
24 #include <FBaseSysLog.h>
25 #include <FCntAudioMetadata.h>
26 #include <FCnt_AudioMetadataImpl.h>
27 #include <FGrp_BitmapImpl.h>
30 using namespace Tizen::Base;
31 using namespace Tizen::Graphics;
33 namespace Tizen { namespace Content
36 _AudioMetadataImpl::_AudioMetadataImpl(void)
39 unique_ptr<AudioMeta, AudioMetaDeleter> pNewAudioMeta(new (nothrow) AudioMeta());
40 if (pNewAudioMeta != null)
42 __pAudioMeta = move(pNewAudioMeta);
47 SysLog(NID_CNT, "The memory is insufficient.");
51 _AudioMetadataImpl::~_AudioMetadataImpl(void)
57 _AudioMetadataImpl::GetInstance(AudioMetadata& audioMetadata)
59 return audioMetadata.__pImpl;
62 const _AudioMetadataImpl*
63 _AudioMetadataImpl::GetInstance(const AudioMetadata& audioMetadata)
65 return audioMetadata.__pImpl;
69 _AudioMetadataImpl::SetAudioMetadata(const AudioMeta* pAudioMeta)
73 SysTryReturnResult(NID_CNT, pAudioMeta != null, E_INVALID_ARG, "pAudioMeta is null.");
75 __pAudioMeta->bitrate = pAudioMeta->bitrate;
76 __pAudioMeta->channelCount = pAudioMeta->channelCount;
77 __pAudioMeta->duration = pAudioMeta->duration;
78 __pAudioMeta->frequency = pAudioMeta->frequency;
79 __pAudioMeta->trackNum = pAudioMeta->trackNum;
80 __pAudioMeta->year = pAudioMeta->year;
81 __pAudioMeta->contentPath = pAudioMeta->contentPath;
83 if (pAudioMeta->pAlbumName != null)
85 __pAudioMeta->pAlbumName = new (nothrow) String(*(pAudioMeta->pAlbumName));
86 SysTryReturnResult(NID_CNT, __pAudioMeta->pAlbumName != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
88 if (pAudioMeta->pArtist != null)
90 __pAudioMeta->pArtist = new (nothrow) String(*(pAudioMeta->pArtist));
91 SysTryReturnResult(NID_CNT, __pAudioMeta->pArtist != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
93 if (pAudioMeta->pComment != null)
95 __pAudioMeta->pComment = new (nothrow) String(*(pAudioMeta->pComment));
96 SysTryReturnResult(NID_CNT, __pAudioMeta->pComment != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
98 if (pAudioMeta->pDescription != null)
100 __pAudioMeta->pDescription = new (nothrow) String(*(pAudioMeta->pDescription));
101 SysTryReturnResult(NID_CNT, __pAudioMeta->pDescription != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
103 if (pAudioMeta->pComposer != null)
105 __pAudioMeta->pComposer = new (nothrow) String(*(pAudioMeta->pComposer));
106 SysTryReturnResult(NID_CNT, __pAudioMeta->pComposer != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
108 if (pAudioMeta->pCopyright != null)
110 __pAudioMeta->pCopyright = new (nothrow) String(*(pAudioMeta->pCopyright));
111 SysTryReturnResult(NID_CNT, __pAudioMeta->pCopyright != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
113 if (pAudioMeta->pGenre != null)
115 __pAudioMeta->pGenre = new (nothrow) String(*(pAudioMeta->pGenre));
116 SysTryReturnResult(NID_CNT, __pAudioMeta->pGenre != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
118 if (pAudioMeta->pRecordingDate != null)
120 __pAudioMeta->pRecordingDate = new (nothrow) String(*(pAudioMeta->pRecordingDate));
121 SysTryReturnResult(NID_CNT, __pAudioMeta->pRecordingDate != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
123 if (pAudioMeta->pTitle != null)
125 __pAudioMeta->pTitle = new (nothrow) String(*(pAudioMeta->pTitle));
126 SysTryReturnResult(NID_CNT, __pAudioMeta->pTitle != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
128 if (pAudioMeta->pTrackInfo != null)
130 __pAudioMeta->pTrackInfo = new (nothrow) String(*(pAudioMeta->pTrackInfo));
131 SysTryReturnResult(NID_CNT, __pAudioMeta->pTrackInfo != null, E_OUT_OF_MEMORY, "The memory is insufficient.");
133 if (pAudioMeta->pThumbnail != null)
135 __pAudioMeta->pThumbnail = _BitmapImpl::CloneN(*(pAudioMeta->pThumbnail));
136 if (__pAudioMeta->pThumbnail == null)
138 SysLog(NID_CNT, "_BitmapImpl::CloneN failed.");
139 // Because thumbnail is one of the metadata, it is not exception in this function but is exception in _AudioMetadataImpl::GetThumbnailN().
142 if (pAudioMeta->pAlbumArt != null)
144 __pAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*(pAudioMeta->pAlbumArt));
145 if (__pAudioMeta->pAlbumArt == null)
147 SysLog(NID_CNT, "_BitmapImpl::CloneN failed.");
148 // Because album art is one of the metadata, it is not exception in this function but is exception in _AudioMetadataImpl::GetAlbumArtN().
156 _AudioMetadataImpl::GetAudioMetadata(void) const
158 return __pAudioMeta.get();
161 _AudioMetadataImpl::_AudioMetadataImpl(const _AudioMetadataImpl& rhs)
164 unique_ptr<AudioMeta, AudioMetaDeleter> pNewAudioMeta(new (nothrow) AudioMeta());
165 if (pNewAudioMeta != null)
167 pNewAudioMeta->bitrate = (rhs.__pAudioMeta)->bitrate;
168 pNewAudioMeta->channelCount = (rhs.__pAudioMeta)->channelCount;
169 pNewAudioMeta->duration = (rhs.__pAudioMeta)->duration;
170 pNewAudioMeta->frequency = (rhs.__pAudioMeta)->frequency;
171 pNewAudioMeta->trackNum = (rhs.__pAudioMeta)->trackNum;
172 pNewAudioMeta->year = (rhs.__pAudioMeta)->year;
173 pNewAudioMeta->contentPath = (rhs.__pAudioMeta)->contentPath;
176 if ((rhs.__pAudioMeta)->pAlbumName != null)
178 pNewAudioMeta->pAlbumName = new (nothrow) String(*((rhs.__pAudioMeta)->pAlbumName));
179 if (pNewAudioMeta->pAlbumName == null)
181 SysLog(NID_CNT, "The memory is insufficient.");
186 if ((rhs.__pAudioMeta)->pArtist != null)
188 pNewAudioMeta->pArtist = new (nothrow) String(*((rhs.__pAudioMeta)->pArtist));
189 if (pNewAudioMeta->pArtist == null)
191 SysLog(NID_CNT, "The memory is insufficient.");
196 if ((rhs.__pAudioMeta)->pComment != null)
198 pNewAudioMeta->pComment = new (nothrow) String(*((rhs.__pAudioMeta)->pComment));
199 if (pNewAudioMeta->pComment == null)
201 SysLog(NID_CNT, "The memory is insufficient.");
206 if ((rhs.__pAudioMeta)->pDescription != null)
208 pNewAudioMeta->pDescription = new (nothrow) String(*((rhs.__pAudioMeta)->pDescription));
209 if (pNewAudioMeta->pDescription == null)
211 SysLog(NID_CNT, "The memory is insufficient.");
216 if ((rhs.__pAudioMeta)->pComposer != null)
218 pNewAudioMeta->pComposer = new (nothrow) String(*((rhs.__pAudioMeta)->pComposer));
219 if (pNewAudioMeta->pComposer == null)
221 SysLog(NID_CNT, "The memory is insufficient.");
226 if ((rhs.__pAudioMeta)->pCopyright != null)
228 pNewAudioMeta->pCopyright = new (nothrow) String(*((rhs.__pAudioMeta)->pCopyright));
229 if (pNewAudioMeta->pCopyright == null)
231 SysLog(NID_CNT, "The memory is insufficient.");
236 if ((rhs.__pAudioMeta)->pGenre != null)
238 pNewAudioMeta->pGenre = new (nothrow) String(*((rhs.__pAudioMeta)->pGenre));
239 if (pNewAudioMeta->pGenre == null)
241 SysLog(NID_CNT, "The memory is insufficient.");
246 if ((rhs.__pAudioMeta)->pRecordingDate != null)
248 pNewAudioMeta->pRecordingDate = new (nothrow) String(*((rhs.__pAudioMeta)->pRecordingDate));
249 if (pNewAudioMeta->pRecordingDate == null)
251 SysLog(NID_CNT, "The memory is insufficient.");
256 if ((rhs.__pAudioMeta)->pTitle != null)
258 pNewAudioMeta->pTitle = new (nothrow) String(*((rhs.__pAudioMeta)->pTitle));
259 if (pNewAudioMeta->pTitle == null)
261 SysLog(NID_CNT, "The memory is insufficient.");
266 if ((rhs.__pAudioMeta)->pTrackInfo != null)
268 pNewAudioMeta->pTrackInfo = new (nothrow) String(*((rhs.__pAudioMeta)->pTrackInfo));
269 if (pNewAudioMeta->pTrackInfo == null)
271 SysLog(NID_CNT, "The memory is insufficient.");
276 if ((rhs.__pAudioMeta)->pThumbnail != null)
278 pNewAudioMeta->pThumbnail = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pThumbnail));
279 if (pNewAudioMeta->pThumbnail == null)
281 SysLog(NID_CNT, "The memory is insufficient.");
286 if ((rhs.__pAudioMeta)->pAlbumArt != null)
288 pNewAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pAlbumArt));
289 if (pNewAudioMeta->pAlbumArt == null)
291 SysLog(NID_CNT, "The memory is insufficient.");
296 __pAudioMeta = move(pNewAudioMeta);
301 SysLog(NID_CNT, "The memory is insufficient.");
306 _AudioMetadataImpl::operator =(const _AudioMetadataImpl& rhs)
308 // check for self-assignment
315 if (__pAudioMeta != null && (rhs.__pAudioMeta) != null)
317 // DeleteMetadata(__pAudioMeta);
318 // __pAudioMeta = new (nothrow) AudioMeta;
320 __pAudioMeta.reset(new (nothrow) AudioMeta);
322 else if (__pAudioMeta != null)
324 //DeleteMetadata(__pAudioMeta);
326 __pAudioMeta.reset(null);
329 else if ((rhs.__pAudioMeta) != null)
331 //__pAudioMeta = new (nothrow) AudioMeta;
333 __pAudioMeta.reset(new (nothrow) AudioMeta);
337 // __pAudioMeta and rhs.__pAudioMeta are null.
341 __pAudioMeta->bitrate = (rhs.__pAudioMeta)->bitrate;
342 __pAudioMeta->channelCount = (rhs.__pAudioMeta)->channelCount;
343 __pAudioMeta->duration = (rhs.__pAudioMeta)->duration;
344 __pAudioMeta->frequency = (rhs.__pAudioMeta)->frequency;
345 __pAudioMeta->trackNum = (rhs.__pAudioMeta)->trackNum;
346 __pAudioMeta->year = (rhs.__pAudioMeta)->year;
347 __pAudioMeta->contentPath = (rhs.__pAudioMeta)->contentPath;
350 if (__pAudioMeta->pAlbumName != null && (rhs.__pAudioMeta)->pAlbumName != null)
352 // delete previous data
353 delete __pAudioMeta->pAlbumName;
354 __pAudioMeta->pAlbumName = null;
356 __pAudioMeta->pAlbumName = new (nothrow) String(*((rhs.__pAudioMeta)->pAlbumName));
358 else if (__pAudioMeta->pAlbumName != null)
360 delete __pAudioMeta->pAlbumName;
361 __pAudioMeta->pAlbumName = null;
363 else if ((rhs.__pAudioMeta)->pAlbumName != null)
365 __pAudioMeta->pAlbumName = new (nothrow) String(*((rhs.__pAudioMeta)->pAlbumName));
369 if (__pAudioMeta->pArtist != null && (rhs.__pAudioMeta)->pArtist != null)
371 // delete previous data
372 delete __pAudioMeta->pArtist;
373 __pAudioMeta->pArtist = null;
375 __pAudioMeta->pArtist = new (nothrow) String(*((rhs.__pAudioMeta)->pArtist));
377 else if (__pAudioMeta->pArtist != null)
379 delete __pAudioMeta->pArtist;
380 __pAudioMeta->pArtist = null;
382 else if ((rhs.__pAudioMeta)->pArtist != null)
384 __pAudioMeta->pArtist = new (nothrow) String(*((rhs.__pAudioMeta)->pArtist));
388 if (__pAudioMeta->pComment != null && (rhs.__pAudioMeta)->pComment != null)
390 // delete previous data
391 delete __pAudioMeta->pComment;
392 __pAudioMeta->pComment = null;
394 __pAudioMeta->pComment = new (nothrow) String(*((rhs.__pAudioMeta)->pComment));
396 else if (__pAudioMeta->pComment != null)
398 delete __pAudioMeta->pComment;
399 __pAudioMeta->pComment = null;
401 else if ((rhs.__pAudioMeta)->pComment != null)
403 __pAudioMeta->pComment = new (nothrow) String(*((rhs.__pAudioMeta)->pComment));
407 if (__pAudioMeta->pDescription != null && (rhs.__pAudioMeta)->pDescription != null)
409 // delete previous data
410 delete __pAudioMeta->pDescription;
411 __pAudioMeta->pDescription = null;
413 __pAudioMeta->pDescription = new (nothrow) String(*((rhs.__pAudioMeta)->pDescription));
415 else if (__pAudioMeta->pDescription != null)
417 delete __pAudioMeta->pDescription;
418 __pAudioMeta->pDescription = null;
420 else if ((rhs.__pAudioMeta)->pDescription != null)
422 __pAudioMeta->pDescription = new (nothrow) String(*((rhs.__pAudioMeta)->pDescription));
426 if (__pAudioMeta->pComposer != null && (rhs.__pAudioMeta)->pComposer != null)
428 // delete previous data
429 delete __pAudioMeta->pComposer;
430 __pAudioMeta->pComposer = null;
432 __pAudioMeta->pComposer = new (nothrow) String(*((rhs.__pAudioMeta)->pComposer));
434 else if (__pAudioMeta->pComposer != null)
436 delete __pAudioMeta->pComposer;
437 __pAudioMeta->pComposer = null;
439 else if ((rhs.__pAudioMeta)->pComposer != null)
441 __pAudioMeta->pComposer = new (nothrow) String(*((rhs.__pAudioMeta)->pComposer));
445 if (__pAudioMeta->pCopyright != null && (rhs.__pAudioMeta)->pCopyright != null)
447 // delete previous data
448 delete __pAudioMeta->pCopyright;
449 __pAudioMeta->pCopyright = null;
451 __pAudioMeta->pCopyright = new (nothrow) String(*((rhs.__pAudioMeta)->pCopyright));
453 else if (__pAudioMeta->pCopyright != null)
455 delete __pAudioMeta->pCopyright;
456 __pAudioMeta->pCopyright = null;
458 else if ((rhs.__pAudioMeta)->pCopyright != null)
460 __pAudioMeta->pCopyright = new (nothrow) String(*((rhs.__pAudioMeta)->pCopyright));
464 if (__pAudioMeta->pGenre != null && (rhs.__pAudioMeta)->pGenre != null)
466 // delete previous data
467 delete __pAudioMeta->pGenre;
468 __pAudioMeta->pGenre = null;
470 __pAudioMeta->pGenre = new (nothrow) String(*((rhs.__pAudioMeta)->pGenre));
472 else if (__pAudioMeta->pGenre != null)
474 delete __pAudioMeta->pGenre;
475 __pAudioMeta->pGenre = null;
477 else if ((rhs.__pAudioMeta)->pGenre != null)
479 __pAudioMeta->pGenre = new (nothrow) String(*((rhs.__pAudioMeta)->pGenre));
483 if (__pAudioMeta->pRecordingDate != null && (rhs.__pAudioMeta)->pRecordingDate != null)
485 // delete previous data
486 delete __pAudioMeta->pRecordingDate;
487 __pAudioMeta->pRecordingDate = null;
489 __pAudioMeta->pRecordingDate = new (nothrow) String(*((rhs.__pAudioMeta)->pRecordingDate));
491 else if (__pAudioMeta->pRecordingDate != null)
493 delete __pAudioMeta->pRecordingDate;
494 __pAudioMeta->pRecordingDate = null;
496 else if ((rhs.__pAudioMeta)->pRecordingDate != null)
498 __pAudioMeta->pRecordingDate = new (nothrow) String(*((rhs.__pAudioMeta)->pRecordingDate));
502 if (__pAudioMeta->pTitle != null && (rhs.__pAudioMeta)->pTitle != null)
504 // delete previous data
505 delete __pAudioMeta->pTitle;
506 __pAudioMeta->pTitle = null;
508 __pAudioMeta->pTitle = new (nothrow) String(*((rhs.__pAudioMeta)->pTitle));
510 else if (__pAudioMeta->pTitle != null)
512 delete __pAudioMeta->pTitle;
513 __pAudioMeta->pTitle = null;
515 else if ((rhs.__pAudioMeta)->pTitle != null)
517 __pAudioMeta->pTitle = new (nothrow) String(*((rhs.__pAudioMeta)->pTitle));
521 if (__pAudioMeta->pTrackInfo != null && (rhs.__pAudioMeta)->pTrackInfo != null)
523 // delete previous data
524 delete __pAudioMeta->pTrackInfo;
525 __pAudioMeta->pTrackInfo = null;
527 __pAudioMeta->pTrackInfo = new (nothrow) String(*((rhs.__pAudioMeta)->pTrackInfo));
529 else if (__pAudioMeta->pTrackInfo != null)
531 delete __pAudioMeta->pTrackInfo;
532 __pAudioMeta->pTrackInfo = null;
534 else if ((rhs.__pAudioMeta)->pTrackInfo != null)
536 __pAudioMeta->pTrackInfo = new (nothrow) String(*((rhs.__pAudioMeta)->pTrackInfo));
540 if (__pAudioMeta->pThumbnail != null && (rhs.__pAudioMeta)->pThumbnail != null)
542 // delete previous data
543 delete __pAudioMeta->pThumbnail;
544 __pAudioMeta->pThumbnail = null;
546 __pAudioMeta->pThumbnail = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pThumbnail));
548 else if (__pAudioMeta->pThumbnail != null)
550 delete __pAudioMeta->pThumbnail;
551 __pAudioMeta->pThumbnail = null;
553 else if ((rhs.__pAudioMeta)->pThumbnail != null)
555 __pAudioMeta->pThumbnail = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pThumbnail));
559 if (__pAudioMeta->pAlbumArt != null && (rhs.__pAudioMeta)->pAlbumArt != null)
561 // delete previous data
562 delete __pAudioMeta->pAlbumArt;
563 __pAudioMeta->pAlbumArt = null;
565 __pAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pAlbumArt));
567 else if (__pAudioMeta->pAlbumArt != null)
569 delete __pAudioMeta->pAlbumArt;
570 __pAudioMeta->pAlbumArt = null;
572 else if ((rhs.__pAudioMeta)->pAlbumArt != null)
574 __pAudioMeta->pAlbumArt = _BitmapImpl::CloneN(*((rhs.__pAudioMeta)->pAlbumArt));
577 SysLog(NID_CNT, "_AudioMetadataImpl::operator =(const _AudioMetadataImpl& rhs) is called.");
582 _AudioMetadataImpl::Equals(const Tizen::Base::Object& rhs) const
584 const _AudioMetadataImpl* pRhs = dynamic_cast <const _AudioMetadataImpl*>(&rhs);
590 if (!((this->GetAlbumName()).Equals(pRhs->GetAlbumName())))
594 if (!((this->GetArtist()).Equals(pRhs->GetArtist())))
598 if (this->GetBitrate() != pRhs->GetBitrate())
602 if (this->GetChannelCount() != pRhs->GetChannelCount())
606 if (!((this->GetComment()).Equals(pRhs->GetComment())))
610 if (!((this->GetDescription()).Equals(pRhs->GetDescription())))
614 if (!((this->GetComposer()).Equals(pRhs->GetComposer())))
618 if (!((this->GetCopyright()).Equals(pRhs->GetCopyright())))
622 if (this->GetDuration() != pRhs->GetDuration())
626 if (this->GetFrequency() != pRhs->GetFrequency())
630 if (!((this->GetGenre()).Equals(pRhs->GetGenre())))
634 if (!((this->GetRecordingDate()).Equals(pRhs->GetRecordingDate())))
638 if (!((this->GetTitle()).Equals(pRhs->GetTitle())))
642 if (this->GetTrack() != pRhs->GetTrack())
646 if (!((this->GetTrackInfo()).Equals(pRhs->GetTrackInfo())))
650 if (this->GetYear() != pRhs->GetYear())
659 _AudioMetadataImpl::GetHashCode(void) const
661 return (this->GetAlbumName()).GetHashCode()
662 ^ (this->GetArtist()).GetHashCode()
663 ^ Integer::GetHashCode(this->GetBitrate())
664 ^ Integer::GetHashCode(this->GetChannelCount())
665 ^ (this->GetComment()).GetHashCode()
666 ^ (this->GetDescription()).GetHashCode()
667 ^ (this->GetComposer()).GetHashCode()
668 ^ (this->GetCopyright()).GetHashCode()
669 ^ Long::GetHashCode(this->GetDuration())
670 ^ Integer::GetHashCode(this->GetFrequency())
671 ^ (this->GetGenre()).GetHashCode()
672 ^ (this->GetRecordingDate()).GetHashCode()
673 ^ (this->GetTitle()).GetHashCode()
674 ^ Integer::GetHashCode(this->GetTrack())
675 ^ (this->GetTrackInfo()).GetHashCode()
676 ^ Integer::GetHashCode(this->GetYear());
680 _AudioMetadataImpl::GetTitle(void) const
682 if (__pAudioMeta == null || __pAudioMeta->pTitle == null)
684 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pTitle is null.");
687 return *(__pAudioMeta->pTitle);
691 _AudioMetadataImpl::GetBitrate(void) const
693 if (__pAudioMeta == null)
695 SysLog(NID_CNT, "__pAudioMeta is null.");
698 return __pAudioMeta->bitrate;
702 _AudioMetadataImpl::GetFrequency(void) const
704 if (__pAudioMeta == null)
706 SysLog(NID_CNT, "__pAudioMeta is null.");
709 return __pAudioMeta->frequency;
713 _AudioMetadataImpl::GetArtist(void) const
715 if (__pAudioMeta == null || __pAudioMeta->pArtist == null)
717 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pArtist is null.");
720 return *(__pAudioMeta->pArtist);
724 _AudioMetadataImpl::GetAlbumName(void) const
726 if (__pAudioMeta == null || __pAudioMeta->pAlbumName == null)
728 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pAlbumName is null.");
731 return *(__pAudioMeta->pAlbumName);
735 _AudioMetadataImpl::GetComment(void) const
737 if (__pAudioMeta == null || __pAudioMeta->pComment == null)
739 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pComment is null.");
742 return *(__pAudioMeta->pComment);
746 _AudioMetadataImpl::GetDescription(void) const
748 if (__pAudioMeta == null || __pAudioMeta->pDescription == null)
750 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pDescription is null.");
753 return *(__pAudioMeta->pDescription);
757 _AudioMetadataImpl::GetTrack(void) const
759 if (__pAudioMeta == null)
761 SysLog(NID_CNT, "__pAudioMeta is null.");
764 return __pAudioMeta->trackNum;
768 _AudioMetadataImpl::GetGenre(void) const
770 if (__pAudioMeta == null || __pAudioMeta->pGenre == null)
772 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pGenre is null.");
775 return *(__pAudioMeta->pGenre);
779 _AudioMetadataImpl::GetComposer(void) const
781 if (__pAudioMeta == null || __pAudioMeta->pComposer == null)
783 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pComposer is null.");
786 return *(__pAudioMeta->pComposer);
790 _AudioMetadataImpl::GetCopyright(void) const
792 if (__pAudioMeta == null || __pAudioMeta->pCopyright == null)
794 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pCopyright is null.");
797 return *(__pAudioMeta->pCopyright);
801 _AudioMetadataImpl::GetDuration(void) const
803 if (__pAudioMeta == null)
805 SysLog(NID_CNT, "__pAudioMeta is null.");
808 return __pAudioMeta->duration;
812 _AudioMetadataImpl::GetYear(void) const
814 if (__pAudioMeta == null)
816 SysLog(NID_CNT, "__pAudioMeta is null.");
819 return __pAudioMeta->year;
823 _AudioMetadataImpl::GetTrackInfo(void) const
825 if (__pAudioMeta == null || __pAudioMeta->pTrackInfo == null)
827 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pTrackInfo is null.");
830 return *(__pAudioMeta->pTrackInfo);
834 _AudioMetadataImpl::GetRecordingDate(void) const
836 if (__pAudioMeta == null || __pAudioMeta->pRecordingDate == null)
838 SysLog(NID_CNT, "__pAudioMeta or __pAudioMeta->pRecordingDate is null.");
841 return *(__pAudioMeta->pRecordingDate);
845 _AudioMetadataImpl::GetChannelCount(void) const
847 if (__pAudioMeta == null)
849 SysLog(NID_CNT, "__pAudioMeta is null.");
852 return __pAudioMeta->channelCount;
861 _AudioMetadataImpl::GetThumbnailN(void) const
865 if (__pAudioMeta == null || __pAudioMeta->pThumbnail == null)
867 SysLogException(NID_CNT, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] __pAudioMeta or __pAudioMeta->pThumbnail is null.");
871 Bitmap* pBitmap = _BitmapImpl::CloneN(*(__pAudioMeta->pThumbnail));
872 SysTryReturn(NID_CNT, pBitmap != null, null, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] _BitmapImpl::CloneN failed.");
883 _AudioMetadataImpl::GetAlbumArtN(void) const
887 if (__pAudioMeta == null || __pAudioMeta->pAlbumArt == null)
889 SysLogException(NID_CNT, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] __pAudioMeta or __pAudioMeta->pAlbumArt is null.");
893 Bitmap* pBitmap = _BitmapImpl::CloneN(*(__pAudioMeta->pAlbumArt));
894 SysTryReturn(NID_CNT, pBitmap != null, null, E_DATA_NOT_FOUND, "[E_DATA_NOT_FOUND] _BitmapImpl::CloneN failed.");