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.h
19 * @brief This is the header file for the %_AudioMetadataImpl class.
21 * This header file contains the declarations of the %_AudioMetadataImpl class.
24 #ifndef _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_
25 #define _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_
27 #include <unique_ptr.h>
28 #include <FBaseString.h>
29 #include <FGrpBitmap.h>
31 namespace Tizen { namespace Content
52 , pRecordingDate(null)
64 Tizen::Base::String contentPath;
65 Tizen::Base::String* pAlbumName;
66 Tizen::Base::String* pArtist;
67 Tizen::Base::String* pComment;
68 Tizen::Base::String* pComposer;
69 Tizen::Base::String* pCopyright;
70 Tizen::Base::String* pGenre;
71 Tizen::Base::String* pRecordingDate;
72 Tizen::Base::String* pTitle;
73 Tizen::Base::String* pTrackInfo;
74 Tizen::Graphics::Bitmap* pThumbnail;
75 Tizen::Graphics::Bitmap* pAlbumArt;
78 struct AudioMetaDeleter
80 void operator()(AudioMeta* pAudioMeta)
82 if (pAudioMeta != null)
84 if (pAudioMeta->pAlbumName)
86 delete pAudioMeta->pAlbumName;
87 pAudioMeta->pAlbumName = null;
89 if (pAudioMeta->pArtist)
91 delete pAudioMeta->pArtist;
92 pAudioMeta->pArtist = null;
94 if (pAudioMeta->pComment)
96 delete pAudioMeta->pComment;
97 pAudioMeta->pComment = null;
99 if (pAudioMeta->pComposer)
101 delete pAudioMeta->pComposer;
102 pAudioMeta->pComposer = null;
104 if (pAudioMeta->pCopyright)
106 delete pAudioMeta->pCopyright;
107 pAudioMeta->pCopyright = null;
109 if (pAudioMeta->pGenre)
111 delete pAudioMeta->pGenre;
112 pAudioMeta->pGenre = null;
114 if (pAudioMeta->pRecordingDate)
116 delete pAudioMeta->pRecordingDate;
117 pAudioMeta->pRecordingDate = null;
119 if (pAudioMeta->pTitle)
121 delete pAudioMeta->pTitle;
122 pAudioMeta->pTitle = null;
124 if (pAudioMeta->pTrackInfo)
126 delete pAudioMeta->pTrackInfo;
127 pAudioMeta->pTrackInfo = null;
129 if (pAudioMeta->pThumbnail)
131 delete pAudioMeta->pThumbnail;
132 pAudioMeta->pThumbnail = null;
134 if (pAudioMeta->pAlbumArt)
136 delete pAudioMeta->pAlbumArt;
137 pAudioMeta->pAlbumArt = null;
146 class _AudioMetadataImpl
147 : public Tizen::Base::Object
151 * This is the default constructor for this class.
155 _AudioMetadataImpl(void);
158 * This is the copy constructor for this class.
162 _AudioMetadataImpl(const _AudioMetadataImpl& rhs);
165 * This is the destructor for this class.
169 virtual ~_AudioMetadataImpl(void);
172 * @see @ref Tizen::Content::AudioMetadata::GetTitle()
174 Tizen::Base::String GetTitle(void) const;
177 * @see @ref Tizen::Content::AudioMetadata::GetBitrate()
179 int GetBitrate(void) const;
182 * @see @ref Tizen::Content::AudioMetadata::GetFrequency()
184 int GetFrequency(void) const;
187 * @see @ref Tizen::Content::AudioMetadata::GetArtist()
189 Tizen::Base::String GetArtist(void) const;
192 * @see @ref Tizen::Content::AudioMetadata::GetAlbumName()
194 Tizen::Base::String GetAlbumName(void) const;
197 * @see @ref Tizen::Content::AudioMetadata::GetComment()
199 Tizen::Base::String GetComment(void) const;
202 * @see @ref Tizen::Content::AudioMetadata::GetTrack()
204 int GetTrack(void) const;
207 * @see @ref Tizen::Content::AudioMetadata::GetGenre()
209 Tizen::Base::String GetGenre(void) const;
212 * @see @ref Tizen::Content::AudioMetadata::GetComposer()
214 Tizen::Base::String GetComposer(void) const;
217 * @see @ref Tizen::Content::AudioMetadata::GetCopyright()
219 Tizen::Base::String GetCopyright(void) const;
222 * @see @ref Tizen::Content::AudioMetadata::GetDuration()
224 long GetDuration(void) const;
227 * @see @ref Tizen::Content::AudioMetadata::GetYear()
229 int GetYear(void) const;
232 * @see @ref Tizen::Content::AudioMetadata::GetTrackInfo()
234 Tizen::Base::String GetTrackInfo(void) const;
237 * @see @ref Tizen::Content::AudioMetadata::GetRecordingDate()
239 Tizen::Base::String GetRecordingDate(void) const;
242 * @see @ref Tizen::Content::AudioMetadata::GetChannelCount()
244 int GetChannelCount(void) const;
247 * @see @ref Tizen::Content::AudioMetadata::GetThumbnailN()
249 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
252 * @see @ref Tizen::Content::AudioMetadata::GetAlbumArtN()
254 Tizen::Graphics::Bitmap* GetAlbumArtN(void) const;
257 * Gets the Impl instance.
260 * @return The pointer to _AudioMetadataImpl
261 * @param[in] audioMetadata An instance of AudioMetadata
263 static _AudioMetadataImpl* GetInstance(AudioMetadata& audioMetadata);
266 * Gets the Impl instance.
269 * @return The pointer to _AudioMetadataImpl
270 * @param[in] audioMetadata An instance of AudioMetadata
272 static const _AudioMetadataImpl* GetInstance(const AudioMetadata& audioMetadata);
275 * @see @ref Tizen::Content::AudioMetadata::Equals()
277 virtual bool Equals(const Tizen::Base::Object& rhs) const;
280 * @see @ref Tizen::Content::AudioMetadata::GetHashCode()
282 virtual int GetHashCode(void) const;
285 * @see @ref Tizen::Content::AudioMetadata::operator =()
287 _AudioMetadataImpl& operator =(const _AudioMetadataImpl& rhs);
290 result SetAudioMetadata(const AudioMeta* pAudioMeta);
291 AudioMeta* GetAudioMetadata(void) const;
294 std::unique_ptr<AudioMeta, AudioMetaDeleter> __pAudioMeta;
296 friend class _ContentManagerUtilImpl;
298 }; // class _AudioMetadataImpl
302 #endif // _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_