• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
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
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 #ifndef METADATAATOM_H_INCLUDED
19 #define METADATAATOM_H_INCLUDED
20 
21 #ifndef ATOMUTILS_H_INCLUDED
22 #include "atomutils.h"
23 #endif
24 
25 #include "handleratom.h"
26 #include "atom.h"
27 #include "itunesilstatom.h"
28 #include"atomdefs.h"
29 
30 class MetaDataAtom: public Atom
31 {
32     public:
33         MetaDataAtom(MP4_FF_FILE *fp, uint32 size, uint32 type);
34         ~MetaDataAtom();
35 
36 
37 
getITunesTitle()38         OSCL_wHeapString<OsclMemAllocator> getITunesTitle() const
39         {
40             OSCL_wHeapString<OsclMemAllocator> temp;
41             if (_pITunesILSTAtom)
42                 return _pITunesILSTAtom->getTitle();
43             else
44                 return temp;
45         }
46 
getITunesTrackSubTitle()47         OSCL_wHeapString<OsclMemAllocator> getITunesTrackSubTitle() const
48         {
49             OSCL_wHeapString<OsclMemAllocator> temp;
50             if (_pITunesILSTAtom)
51                 return _pITunesILSTAtom->getTrackSubTitle();
52             else
53                 return temp;
54         }
55 
56 
getITunesArtist()57         OSCL_wHeapString<OsclMemAllocator> getITunesArtist() const
58         {
59             OSCL_wHeapString<OsclMemAllocator> temp;
60             if (_pITunesILSTAtom)
61                 return _pITunesILSTAtom->getArtist();
62             else
63                 return temp;
64         }
65 
getITunesAlbumArtist()66         OSCL_wHeapString<OsclMemAllocator> getITunesAlbumArtist() const
67         {
68             OSCL_wHeapString<OsclMemAllocator> temp;
69             if (_pITunesILSTAtom)
70                 return _pITunesILSTAtom->getAlbumArtist();
71             else
72                 return temp;
73         }
74 
getITunesAlbum()75         OSCL_wHeapString<OsclMemAllocator> getITunesAlbum() const
76         {
77             OSCL_wHeapString<OsclMemAllocator> temp;
78             if (_pITunesILSTAtom)
79                 return _pITunesILSTAtom->getAlbum();
80             else
81                 return temp;
82         }
83 
84         // Gnre ** Starts **
getITunesGnreID()85         uint16 getITunesGnreID() const
86         {
87             if (_pITunesILSTAtom)
88             {
89                 if (_pITunesILSTAtom->getGnreVersion() == INTEGER_GENRE)
90                 {
91                     return _pITunesILSTAtom->getGnreID();
92                 }
93                 else
94                     return 0;
95             }
96             else
97                 return 0;
98         }
99 
100 
getITunesGnreString()101         OSCL_wHeapString<OsclMemAllocator> getITunesGnreString() const
102         {
103             OSCL_wHeapString<OsclMemAllocator> temp;
104             if (_pITunesILSTAtom)
105             {
106                 if (_pITunesILSTAtom->getGnreVersion() == STRING_GENRE)
107                 {
108                     return _pITunesILSTAtom->getGnreString();
109                 }
110                 else
111                     return temp;
112             }
113             else
114                 return temp;
115         }
116 
117         //This function will tell the type of Genre--
getITunesGnreVersion()118         GnreVersion getITunesGnreVersion() const
119         {
120             if (_pITunesILSTAtom)
121             {
122                 return _pITunesILSTAtom->getGnreVersion();
123             }
124             else
125                 // By-default return INTEGER_GENRE
126                 return INTEGER_GENRE;
127         }
128         // Gnre ** Ends **
129 
130 
131         // Returns the 4-byte YEAR when the song was recorded
getITunesYear()132         OSCL_wHeapString<OsclMemAllocator> getITunesYear() const
133         {
134             OSCL_wHeapString<OsclMemAllocator> temp;
135             if (_pITunesILSTAtom)
136                 return _pITunesILSTAtom->getYear();
137             else
138                 return temp;
139         }
140 
141 
getITunesTool()142         OSCL_wHeapString<OsclMemAllocator> getITunesTool() const
143         {
144             OSCL_wHeapString<OsclMemAllocator> temp;
145             if (_pITunesILSTAtom)
146             {
147                 return _pITunesILSTAtom->getTool();
148             }
149             else
150                 return temp;
151         }
152 
getITunesEncodedBy()153         OSCL_wHeapString<OsclMemAllocator> getITunesEncodedBy() const
154         {
155             OSCL_wHeapString<OsclMemAllocator> temp;
156             if (_pITunesILSTAtom)
157             {
158                 return _pITunesILSTAtom->getEncodedBy();
159             }
160             else
161                 return temp;
162         }
163 
getITunesWriter()164         OSCL_wHeapString<OsclMemAllocator> getITunesWriter() const
165         {
166             OSCL_wHeapString<OsclMemAllocator> temp;
167             if (_pITunesILSTAtom)
168                 return _pITunesILSTAtom->getWriter();
169             else
170                 return temp;
171         }
172 
getITunesGroup()173         OSCL_wHeapString<OsclMemAllocator> getITunesGroup() const
174         {
175             OSCL_wHeapString<OsclMemAllocator> temp;
176             if (_pITunesILSTAtom)
177                 return _pITunesILSTAtom->getGroup();
178             else
179                 return temp;
180         }
181 
getITunesComment()182         OSCL_wHeapString<OsclMemAllocator> getITunesComment() const
183         {
184             OSCL_wHeapString<OsclMemAllocator> temp;
185             if (_pITunesILSTAtom)
186                 return _pITunesILSTAtom->getComment();
187             else
188                 return temp;
189         }
190 
getITunesCopyright()191         OSCL_wHeapString<OsclMemAllocator> getITunesCopyright() const
192         {
193             OSCL_wHeapString<OsclMemAllocator> temp;
194             if (_pITunesILSTAtom)
195                 return _pITunesILSTAtom->getITunesCopyright();
196             else
197                 return temp;
198         }
199 
getITunesDescription()200         OSCL_wHeapString<OsclMemAllocator> getITunesDescription() const
201         {
202             OSCL_wHeapString<OsclMemAllocator> temp;
203             if (_pITunesILSTAtom)
204                 return _pITunesILSTAtom->getITunesDescription();
205             else
206                 return temp;
207         }
208 
209 
getITunesThisTrackNo()210         uint16 getITunesThisTrackNo() const
211         {
212             if (_pITunesILSTAtom)
213                 return _pITunesILSTAtom->getThisTrackNo();
214             else
215                 return 0;
216         }
217 
getITunesTotalTracks()218         uint16 getITunesTotalTracks() const
219         {
220             if (_pITunesILSTAtom)
221                 return _pITunesILSTAtom->getTotalTracks();
222             else
223                 return 0;
224         }
225 
IsITunesCompilationPart()226         bool IsITunesCompilationPart() const
227         {
228             if (_pITunesILSTAtom)
229                 return _pITunesILSTAtom->IsCompilationPart();
230             else
231                 return false;
232         }
233 
IsITunesContentRating()234         bool IsITunesContentRating() const
235         {
236             if (_pITunesILSTAtom)
237                 return _pITunesILSTAtom->IsContentRating();
238             else
239                 return false;
240         }
241 
getITunesBeatsPerMinute()242         uint16 getITunesBeatsPerMinute() const
243         {
244             if (_pITunesILSTAtom)
245                 return _pITunesILSTAtom->getBeatsPerMinute();
246             else
247                 return 0;
248         }
249 
250 
getITunesImageData()251         PvmfApicStruct* getITunesImageData() const
252         {
253             if (_pITunesILSTAtom)
254                 return _pITunesILSTAtom->getImageData();
255             else
256                 return NULL;
257         }
258 
getITunesThisDiskNo()259         uint16 getITunesThisDiskNo() const
260         {
261             if (_pITunesILSTAtom)
262                 return _pITunesILSTAtom->getThisDiskNo();
263             else
264                 return 0;
265         }
266 
getITunesTotalDisks()267         uint16 getITunesTotalDisks() const
268         {
269             if (_pITunesILSTAtom)
270                 return _pITunesILSTAtom->getTotalDisks();
271             else
272                 return 0;
273         }
274 
getITunesNormalizationData()275         OSCL_wHeapString<OsclMemAllocator> getITunesNormalizationData() const
276         {
277             OSCL_wHeapString<OsclMemAllocator> temp;
278             if (_pITunesILSTAtom)
279                 return _pITunesILSTAtom->getNormalizationData();
280             else
281                 return temp;
282         }
283 
getITunesCDIdentifierData(uint8 index)284         OSCL_wHeapString<OsclMemAllocator> getITunesCDIdentifierData(uint8 index) const
285         {
286             OSCL_wHeapString<OsclMemAllocator> temp;
287             if (_pITunesILSTAtom)
288                 return _pITunesILSTAtom->getCDIdentifierData(index);
289             else
290                 return temp;
291         }
292 
293 
getITunesTotalCDIdentifierData()294         uint8 getITunesTotalCDIdentifierData() const
295         {
296 
297             if (_pITunesILSTAtom)
298                 return _pITunesILSTAtom->getTotalCDIdentifierData();
299             else
300                 return 0;
301         }
302 
303 
getITunesCDTrackNumberData()304         OSCL_wHeapString<OsclMemAllocator> getITunesCDTrackNumberData() const
305         {
306             OSCL_wHeapString<OsclMemAllocator> temp;
307             if (_pITunesILSTAtom)
308                 return _pITunesILSTAtom->getCDTrackNumberData();
309             else
310                 return temp;
311         }
312 
getITunesCDDB1Data()313         OSCL_wHeapString<OsclMemAllocator> getITunesCDDB1Data() const
314         {
315             OSCL_wHeapString<OsclMemAllocator> temp;
316             if (_pITunesILSTAtom)
317                 return _pITunesILSTAtom->getCDDB1Data();
318             else
319                 return temp;
320         }
321 
getITunesLyrics()322         OSCL_wHeapString<OsclMemAllocator> getITunesLyrics() const
323         {
324             OSCL_wHeapString<OsclMemAllocator> temp;
325             if (_pITunesILSTAtom)
326                 return _pITunesILSTAtom->getLyrics();
327             else
328                 return temp;
329         }
330 
331 
332     private:
333 
334         HandlerAtom *_pHdlrAtom;
335         // User ilst Data
336         ITunesILSTAtom* _pITunesILSTAtom;
337         PVLogger *iLogger;
338 };
339 
340 
341 #endif // METADATAATOM_H_INCLUDED
342 
343 
344 
345 
346 
347 
348 
349 
350 
351 
352 
353 
354 
355 
356 
357 
358 
359 
360 
361 
362 
363 
364 
365 
366 
367 
368 
369 
370 
371 
372 
373 
374 
375 
376 
377 
378 
379 
380 
381 
382 
383 
384 
385 
386