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
53 , pRecordingDate(null)
65 Tizen::Base::String contentPath;
66 Tizen::Base::String* pAlbumName;
67 Tizen::Base::String* pArtist;
68 Tizen::Base::String* pComment;
69 Tizen::Base::String* pDescription;
70 Tizen::Base::String* pComposer;
71 Tizen::Base::String* pCopyright;
72 Tizen::Base::String* pGenre;
73 Tizen::Base::String* pRecordingDate;
74 Tizen::Base::String* pTitle;
75 Tizen::Base::String* pTrackInfo;
76 Tizen::Graphics::Bitmap* pThumbnail;
77 Tizen::Graphics::Bitmap* pAlbumArt;
80 struct AudioMetaDeleter
82 void operator()(AudioMeta* pAudioMeta)
84 if (pAudioMeta != null)
86 if (pAudioMeta->pAlbumName)
88 delete pAudioMeta->pAlbumName;
89 pAudioMeta->pAlbumName = null;
91 if (pAudioMeta->pArtist)
93 delete pAudioMeta->pArtist;
94 pAudioMeta->pArtist = null;
96 if (pAudioMeta->pComment)
98 delete pAudioMeta->pComment;
99 pAudioMeta->pComment = null;
101 if (pAudioMeta->pDescription)
103 delete pAudioMeta->pDescription;
104 pAudioMeta->pDescription = null;
106 if (pAudioMeta->pComposer)
108 delete pAudioMeta->pComposer;
109 pAudioMeta->pComposer = null;
111 if (pAudioMeta->pCopyright)
113 delete pAudioMeta->pCopyright;
114 pAudioMeta->pCopyright = null;
116 if (pAudioMeta->pGenre)
118 delete pAudioMeta->pGenre;
119 pAudioMeta->pGenre = null;
121 if (pAudioMeta->pRecordingDate)
123 delete pAudioMeta->pRecordingDate;
124 pAudioMeta->pRecordingDate = null;
126 if (pAudioMeta->pTitle)
128 delete pAudioMeta->pTitle;
129 pAudioMeta->pTitle = null;
131 if (pAudioMeta->pTrackInfo)
133 delete pAudioMeta->pTrackInfo;
134 pAudioMeta->pTrackInfo = null;
136 if (pAudioMeta->pThumbnail)
138 delete pAudioMeta->pThumbnail;
139 pAudioMeta->pThumbnail = null;
141 if (pAudioMeta->pAlbumArt)
143 delete pAudioMeta->pAlbumArt;
144 pAudioMeta->pAlbumArt = null;
153 class _AudioMetadataImpl
154 : public Tizen::Base::Object
158 * This is the default constructor for this class.
162 _AudioMetadataImpl(void);
165 * This is the copy constructor for this class.
169 _AudioMetadataImpl(const _AudioMetadataImpl& rhs);
172 * This is the destructor for this class.
176 virtual ~_AudioMetadataImpl(void);
179 * @see @ref Tizen::Content::AudioMetadata::GetTitle()
181 Tizen::Base::String GetTitle(void) const;
184 * @see @ref Tizen::Content::AudioMetadata::GetBitrate()
186 int GetBitrate(void) const;
189 * @see @ref Tizen::Content::AudioMetadata::GetFrequency()
191 int GetFrequency(void) const;
194 * @see @ref Tizen::Content::AudioMetadata::GetArtist()
196 Tizen::Base::String GetArtist(void) const;
199 * @see @ref Tizen::Content::AudioMetadata::GetAlbumName()
201 Tizen::Base::String GetAlbumName(void) const;
204 * @see @ref Tizen::Content::AudioMetadata::GetComment()
206 Tizen::Base::String GetComment(void) const;
209 * @see @ref Tizen::Content::AudioMetadata::GetDescription()
211 Tizen::Base::String GetDescription(void) const;
214 * @see @ref Tizen::Content::AudioMetadata::GetTrack()
216 int GetTrack(void) const;
219 * @see @ref Tizen::Content::AudioMetadata::GetGenre()
221 Tizen::Base::String GetGenre(void) const;
224 * @see @ref Tizen::Content::AudioMetadata::GetComposer()
226 Tizen::Base::String GetComposer(void) const;
229 * @see @ref Tizen::Content::AudioMetadata::GetCopyright()
231 Tizen::Base::String GetCopyright(void) const;
234 * @see @ref Tizen::Content::AudioMetadata::GetDuration()
236 long GetDuration(void) const;
239 * @see @ref Tizen::Content::AudioMetadata::GetYear()
241 int GetYear(void) const;
244 * @see @ref Tizen::Content::AudioMetadata::GetTrackInfo()
246 Tizen::Base::String GetTrackInfo(void) const;
249 * @see @ref Tizen::Content::AudioMetadata::GetRecordingDate()
251 Tizen::Base::String GetRecordingDate(void) const;
254 * @see @ref Tizen::Content::AudioMetadata::GetChannelCount()
256 int GetChannelCount(void) const;
259 * @see @ref Tizen::Content::AudioMetadata::GetThumbnailN()
261 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
264 * @see @ref Tizen::Content::AudioMetadata::GetAlbumArtN()
266 Tizen::Graphics::Bitmap* GetAlbumArtN(void) const;
269 * Gets the Impl instance.
272 * @return The pointer to _AudioMetadataImpl
273 * @param[in] audioMetadata An instance of AudioMetadata
275 static _AudioMetadataImpl* GetInstance(AudioMetadata& audioMetadata);
278 * Gets the Impl instance.
281 * @return The pointer to _AudioMetadataImpl
282 * @param[in] audioMetadata An instance of AudioMetadata
284 static const _AudioMetadataImpl* GetInstance(const AudioMetadata& audioMetadata);
287 * @see @ref Tizen::Content::AudioMetadata::Equals()
289 virtual bool Equals(const Tizen::Base::Object& rhs) const;
292 * @see @ref Tizen::Content::AudioMetadata::GetHashCode()
294 virtual int GetHashCode(void) const;
297 * @see @ref Tizen::Content::AudioMetadata::operator =()
299 _AudioMetadataImpl& operator =(const _AudioMetadataImpl& rhs);
302 result SetAudioMetadata(const AudioMeta* pAudioMeta);
303 AudioMeta* GetAudioMetadata(void) const;
306 std::unique_ptr<AudioMeta, AudioMetaDeleter> __pAudioMeta;
308 friend class _ContentManagerUtilImpl;
310 }; // class _AudioMetadataImpl
314 #endif // _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_