|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This class implements parsing of ID3v2.2 according to the |
|
15 * specification found in www.id3.org. Note that only a selected |
|
16 * frames are supported at this time. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CMETADATAPARSERID3V22_H |
|
23 #define CMETADATAPARSERID3V22_H |
|
24 |
|
25 // INCLUDES |
|
26 #include "MetaDataParserID3v2.h" |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * This class implements parsing of ID3v2.2. |
|
32 * |
|
33 * @lib MetaDataUtility.lib |
|
34 * @since 3.0 |
|
35 */ |
|
36 class CMetaDataParserID3v22 : public CMetaDataParserID3v2 |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @param aSource Reference to a metadata source |
|
43 * @return A pointer to a new instance of this class |
|
44 */ |
|
45 static CMetaDataParserID3v22* NewL( CMetaDataSource& aSource ); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CMetaDataParserID3v22(); |
|
51 |
|
52 public: // Functions from base classes |
|
53 |
|
54 /** |
|
55 * From CMetaDataParserID3v2 |
|
56 * This function is called from ParseL for header parsing and data initialization. |
|
57 * @return void |
|
58 */ |
|
59 void PrepareToParseL(); |
|
60 |
|
61 /** |
|
62 * From CMetaDataParserID3v2 |
|
63 * Gets the next field's properties. |
|
64 * @param aFieldId Field Id, on return. |
|
65 * @param aFrameHeaderSize Frame header size. |
|
66 * @param aFrameSize Frame size, on return. |
|
67 * @return void |
|
68 */ |
|
69 void GetNextFieldL( TMetaDataFieldId& aFieldId, TInt& aFrameHeaderSize, TInt& aFrameSize ); |
|
70 |
|
71 /** |
|
72 * From CMetaDataParserID3v2 |
|
73 * Reads the text information from the source and appends it to the container. |
|
74 * @param aFieldId Field Id. |
|
75 * @param aSize Size of the data. |
|
76 * @return void |
|
77 */ |
|
78 void GetTextInfoL( TMetaDataFieldId aFieldId, TInt aSize ); |
|
79 |
|
80 /** |
|
81 * From CMetaDataParserID3v2 |
|
82 * Reads the Genre from the source and appends it to the container. |
|
83 * @param aSize Size of the data. |
|
84 * @return void |
|
85 */ |
|
86 void GetGenreL( TInt aSize ); |
|
87 |
|
88 /** |
|
89 * From CMetaDataParserID3v2 |
|
90 * Reads the year from the source and appends it to the container. |
|
91 * @param aSize Size of the data. |
|
92 * @return void |
|
93 */ |
|
94 void GetTextYearL( TInt aSize ); |
|
95 |
|
96 /** |
|
97 * From CMetaDataParserID3v2 |
|
98 * Reads the comment from the source and appends it to the container. |
|
99 * @param aSize Size of the data. |
|
100 * @return void |
|
101 */ |
|
102 void GetCommentL( TInt aSize ); |
|
103 |
|
104 /** |
|
105 * From CMetaDataParserID3v2 |
|
106 * Reads the Url from the source and appends it to the container. |
|
107 * @param aSize Size of the data. |
|
108 * @return void |
|
109 */ |
|
110 void GetUrlL( TInt aSize ); |
|
111 |
|
112 /** |
|
113 * From CMetaDataParserID3v2 |
|
114 * Reads the Lyrics from the source and appends it to the container. |
|
115 * @param aSize Size of the data. |
|
116 * @return void |
|
117 */ |
|
118 void GetUnsyncLyricsL( TInt aSize ); |
|
119 |
|
120 /** |
|
121 * From CMetaDataParserID3v2 |
|
122 * Reads the user defined Url from the source and |
|
123 * appends it to the container. |
|
124 * @since 3.0 |
|
125 * @param aSize Size of the data. |
|
126 * @return void |
|
127 */ |
|
128 void GetUserUrlL( TInt aSize ); |
|
129 |
|
130 /** |
|
131 * From CMetaDataParserID3v2 |
|
132 * Reads the Jpeg from the source and appends it to the container. |
|
133 * @param aSize Size of the data. |
|
134 * @return void |
|
135 */ |
|
136 void GetJpegL( TInt aSize ); |
|
137 |
|
138 /** |
|
139 * From CMetaDataParserID3v2 |
|
140 * Reads the duration from the source and appends it to the container. |
|
141 * @since 3.0 |
|
142 * @param aSize Size of the data. |
|
143 * @return void |
|
144 */ |
|
145 void GetDurationL( TInt aSize ); |
|
146 |
|
147 /** |
|
148 * From CMetaDataParserID3v2 |
|
149 * Reads the date from the source and appends it to the container. |
|
150 * @since 3.0 |
|
151 * @param aSize Size of the data. |
|
152 * @return void |
|
153 */ |
|
154 void GetTextDateL( TInt aSize ); |
|
155 |
|
156 /** |
|
157 * From CMetaDataParserID3v2 |
|
158 * Reads the popularimeter appends it to the container. |
|
159 * @since 3.0 |
|
160 * @param aSize Size of the data. |
|
161 * @return void |
|
162 */ |
|
163 void GetRatingL (TInt aSize); |
|
164 |
|
165 /** |
|
166 * From CMetaDataParserID3v2 |
|
167 * Converts to unicode. |
|
168 * @param aEncoding Encoding of aDesc. |
|
169 * @param aDesc Source to be converted to unicode. |
|
170 * @param aUnicode Contains the converted unicode on return. |
|
171 * @return The number of unconverted characters left at the end of the input descriptor |
|
172 * (e.g. because the output descriptor is not long enough to hold all the text), |
|
173 * or one of the error values defined in TError. |
|
174 */ |
|
175 TInt ConvertToUnicodeL( TInt aEncoding, const TDesC8& aDesc, TDes16& aUnicode ); |
|
176 |
|
177 private: |
|
178 |
|
179 /** |
|
180 * C++ default constructor. |
|
181 */ |
|
182 CMetaDataParserID3v22( CMetaDataSource& aSource ); |
|
183 |
|
184 /** |
|
185 * By default Symbian 2nd phase constructor is private. |
|
186 */ |
|
187 void ConstructL(); |
|
188 |
|
189 private: // Data |
|
190 |
|
191 }; |
|
192 |
|
193 #endif // CMETADATAPARSERID3V22_H |
|
194 |
|
195 // End of File |