2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file FCnt_AudioMetadataImpl.h
18 * @brief This is the header file for the %_AudioMetadataImpl class.
20 * This header file contains the declarations of the %_AudioMetadataImpl class.
23 #ifndef _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_
24 #define _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_
26 #include <unique_ptr.h>
27 #include <FBaseString.h>
28 #include <FGrpBitmap.h>
30 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* pDescription;
69 Tizen::Base::String* pComposer;
70 Tizen::Base::String* pCopyright;
71 Tizen::Base::String* pGenre;
72 Tizen::Base::String* pRecordingDate;
73 Tizen::Base::String* pTitle;
74 Tizen::Base::String* pTrackInfo;
75 Tizen::Graphics::Bitmap* pThumbnail;
76 Tizen::Graphics::Bitmap* pAlbumArt;
79 struct AudioMetaDeleter
81 void operator()(AudioMeta* pAudioMeta)
83 if (pAudioMeta != null)
85 if (pAudioMeta->pAlbumName)
87 delete pAudioMeta->pAlbumName;
88 pAudioMeta->pAlbumName = null;
90 if (pAudioMeta->pArtist)
92 delete pAudioMeta->pArtist;
93 pAudioMeta->pArtist = null;
95 if (pAudioMeta->pComment)
97 delete pAudioMeta->pComment;
98 pAudioMeta->pComment = null;
100 if (pAudioMeta->pDescription)
102 delete pAudioMeta->pDescription;
103 pAudioMeta->pDescription = null;
105 if (pAudioMeta->pComposer)
107 delete pAudioMeta->pComposer;
108 pAudioMeta->pComposer = null;
110 if (pAudioMeta->pCopyright)
112 delete pAudioMeta->pCopyright;
113 pAudioMeta->pCopyright = null;
115 if (pAudioMeta->pGenre)
117 delete pAudioMeta->pGenre;
118 pAudioMeta->pGenre = null;
120 if (pAudioMeta->pRecordingDate)
122 delete pAudioMeta->pRecordingDate;
123 pAudioMeta->pRecordingDate = null;
125 if (pAudioMeta->pTitle)
127 delete pAudioMeta->pTitle;
128 pAudioMeta->pTitle = null;
130 if (pAudioMeta->pTrackInfo)
132 delete pAudioMeta->pTrackInfo;
133 pAudioMeta->pTrackInfo = null;
135 if (pAudioMeta->pThumbnail)
137 delete pAudioMeta->pThumbnail;
138 pAudioMeta->pThumbnail = null;
140 if (pAudioMeta->pAlbumArt)
142 delete pAudioMeta->pAlbumArt;
143 pAudioMeta->pAlbumArt = null;
152 class _AudioMetadataImpl
153 : public Tizen::Base::Object
157 * This is the default constructor for this class.
161 _AudioMetadataImpl(void);
164 * This is the copy constructor for this class.
168 _AudioMetadataImpl(const _AudioMetadataImpl& rhs);
171 * This is the destructor for this class.
175 virtual ~_AudioMetadataImpl(void);
178 * @see @ref Tizen::Content::AudioMetadata::GetTitle()
180 Tizen::Base::String GetTitle(void) const;
183 * @see @ref Tizen::Content::AudioMetadata::GetBitrate()
185 int GetBitrate(void) const;
188 * @see @ref Tizen::Content::AudioMetadata::GetFrequency()
190 int GetFrequency(void) const;
193 * @see @ref Tizen::Content::AudioMetadata::GetArtist()
195 Tizen::Base::String GetArtist(void) const;
198 * @see @ref Tizen::Content::AudioMetadata::GetAlbumName()
200 Tizen::Base::String GetAlbumName(void) const;
203 * @see @ref Tizen::Content::AudioMetadata::GetComment()
205 Tizen::Base::String GetComment(void) const;
208 * @see @ref Tizen::Content::AudioMetadata::GetDescription()
210 Tizen::Base::String GetDescription(void) const;
213 * @see @ref Tizen::Content::AudioMetadata::GetTrack()
215 int GetTrack(void) const;
218 * @see @ref Tizen::Content::AudioMetadata::GetGenre()
220 Tizen::Base::String GetGenre(void) const;
223 * @see @ref Tizen::Content::AudioMetadata::GetComposer()
225 Tizen::Base::String GetComposer(void) const;
228 * @see @ref Tizen::Content::AudioMetadata::GetCopyright()
230 Tizen::Base::String GetCopyright(void) const;
233 * @see @ref Tizen::Content::AudioMetadata::GetDuration()
235 long GetDuration(void) const;
238 * @see @ref Tizen::Content::AudioMetadata::GetYear()
240 int GetYear(void) const;
243 * @see @ref Tizen::Content::AudioMetadata::GetTrackInfo()
245 Tizen::Base::String GetTrackInfo(void) const;
248 * @see @ref Tizen::Content::AudioMetadata::GetRecordingDate()
250 Tizen::Base::String GetRecordingDate(void) const;
253 * @see @ref Tizen::Content::AudioMetadata::GetChannelCount()
255 int GetChannelCount(void) const;
258 * @see @ref Tizen::Content::AudioMetadata::GetThumbnailN()
260 Tizen::Graphics::Bitmap* GetThumbnailN(void) const;
263 * @see @ref Tizen::Content::AudioMetadata::GetAlbumArtN()
265 Tizen::Graphics::Bitmap* GetAlbumArtN(void) const;
268 * Gets the Impl instance.
271 * @return The pointer to _AudioMetadataImpl
272 * @param[in] audioMetadata An instance of AudioMetadata
274 static _AudioMetadataImpl* GetInstance(AudioMetadata& audioMetadata);
277 * Gets the Impl instance.
280 * @return The pointer to _AudioMetadataImpl
281 * @param[in] audioMetadata An instance of AudioMetadata
283 static const _AudioMetadataImpl* GetInstance(const AudioMetadata& audioMetadata);
286 * @see @ref Tizen::Content::AudioMetadata::Equals()
288 virtual bool Equals(const Tizen::Base::Object& rhs) const;
291 * @see @ref Tizen::Content::AudioMetadata::GetHashCode()
293 virtual int GetHashCode(void) const;
296 * @see @ref Tizen::Content::AudioMetadata::operator =()
298 _AudioMetadataImpl& operator =(const _AudioMetadataImpl& rhs);
301 result SetAudioMetadata(const AudioMeta* pAudioMeta);
302 AudioMeta* GetAudioMetadata(void) const;
305 std::unique_ptr<AudioMeta, AudioMetaDeleter> __pAudioMeta;
307 friend class _ContentManagerUtilImpl;
309 }; // class _AudioMetadataImpl
313 #endif // _FCNT_INTERNAL_AUDIO_METADATA_IMPL_H_