id3lib 3.8.3

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

helpers.cpp
Go to the documentation of this file.
1 // $Id: helpers.cpp,v 1.12 2002/09/21 17:23:32 t1mpy Exp $
2
3 // id3lib: a C++ library for creating and manipulating id3v1/v2 tags
4 // Copyright 1999, 2000 Scott Thomas Haug
5
6 // Lots of hacking added to this file by Scott Wheeler (scott@slackorama.net)
7 // 11/02/2001
8
9 // This library is free software; you can redistribute it and/or modify it
10 // under the terms of the GNU Library General Public License as published by
11 // the Free Software Foundation; either version 2 of the License, or (at your
12 // option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful, but WITHOUT
15 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
17 // License for more details.
18 //
19 // You should have received a copy of the GNU Library General Public License
20 // along with this library; if not, write to the Free Software Foundation,
21 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 // The id3lib authors encourage improvements and optimisations to be sent to
24 // the id3lib coordinator. Please see the README file for details on where to
25 // send such submissions. See the AUTHORS file for a list of people who have
26 // contributed to id3lib. See the ChangeLog file for a list of changes to
27 // id3lib. These files are distributed with id3lib at
28 // http://download.sourceforge.net/id3lib/
29
30 #if defined HAVE_CONFIG_H
31 #include <config.h>
32 #endif
33
34
35
36 #include <ctype.h>
37
38 #include "helpers.h"
39 #include "tag_impl.h" //has <stdio.h> "tag.h" "header_tag.h" "frame.h" "field.h" "spec.h" "id3lib_strings.h" "utils.h"
40
41 using namespace dami;
42
43 String id3::v2::getString(const ID3_Frame* frame, ID3_FieldID fldName)
44 {
45 if (!frame)
46 {
47 return "";
48 }
49 ID3_Field* fp = frame->GetField(fldName);
50 if (!fp)
51 {
52 return "";
53 }
54 ID3_TextEnc enc = fp->GetEncoding();
55 fp->SetEncoding(ID3TE_ASCII);
56
57 String text(fp->GetRawText(), fp->Size());
58
59 fp->SetEncoding(enc);
60 return text;
61 }
62
63 String id3::v2::getStringAtIndex(const ID3_Frame* frame, ID3_FieldID fldName,
64 size_t nIndex)
65 {
66 if (!frame)
67 {
68 return "";
69 }
70 String text;
71 ID3_Field* fp = frame->GetField(fldName);
72 if (fp && fp->GetNumTextItems() < nIndex)
73 {
74 ID3_TextEnc enc = fp->GetEncoding();
75 fp->SetEncoding(ID3TE_ASCII);
76
77 text = fp->GetRawTextItem(nIndex);
78
79 fp->SetEncoding(enc);
80 }
81 return text;
82 }
83
84 size_t id3::v2::removeFrames(ID3_TagImpl& tag, ID3_FrameID id)
85 {
86 size_t numRemoved = 0;
87 ID3_Frame* frame = NULL;
88
89 while ((frame = tag.Find(id)) != NULL)
90 {
91 frame = tag.RemoveFrame(frame);
92 delete frame;
93 numRemoved++;
94 }
95
96 return numRemoved;
97 }
98
99 String id3::v2::getFrameText(const ID3_TagImpl& tag, ID3_FrameID id)
100 {
101 ID3_Frame* frame = tag.Find(id);
102 return getString(frame, ID3FN_TEXT);
103 }
104
105 ID3_Frame* id3::v2::setFrameText(ID3_TagImpl& tag, ID3_FrameID id, String text)
106 {
107 ID3_Frame* frame = tag.Find(id);
108 if (!frame)
109 {
110 frame = new ID3_Frame(id);
111 if(!tag.AttachFrame(frame)) return NULL;
112 }
113 frame->GetField(ID3FN_TEXT)->Set(text.c_str());
114
115 return frame;
116 }
117
119
120 ID3_Frame* id3::v2::hasArtist(const ID3_TagImpl& tag)
121 {
122 ID3_Frame* fp = NULL;
123 (fp = tag.Find(ID3FID_LEADARTIST)) ||
124 (fp = tag.Find(ID3FID_BAND)) ||
125 (fp = tag.Find(ID3FID_CONDUCTOR)) ||
126 (fp = tag.Find(ID3FID_COMPOSER));
127 return fp;
128 }
129
130 String id3::v2::getArtist(const ID3_TagImpl& tag)
131 {
132 ID3_Frame* frame = hasArtist(tag);
133 return getString(frame, ID3FN_TEXT);
134 }
135
136 ID3_Frame* id3::v2::setArtist(ID3_TagImpl& tag, String text)
137 {
138 removeArtists(tag);
139 return setFrameText(tag, ID3FID_LEADARTIST, text);
140 }
141
142 size_t id3::v2::removeArtists(ID3_TagImpl& tag)
143 {
144 size_t numRemoved = 0;
145 ID3_Frame* frame = NULL;
146
147 while ((frame = hasArtist(tag)) != NULL)
148 {
149 frame = tag.RemoveFrame(frame);
150 delete frame;
151 numRemoved++;
152 }
153
154 return numRemoved;
155 }
156
158
159 ID3_Frame* id3::v2::hasAlbum(const ID3_TagImpl& tag)
160 {
161 ID3_Frame* frame = tag.Find(ID3FID_ALBUM);
162 return(frame);
163 }
164
165 String id3::v2::getAlbum(const ID3_TagImpl& tag)
166 {
167 return getFrameText(tag, ID3FID_ALBUM);
168 }
169
170 ID3_Frame* id3::v2::setAlbum(ID3_TagImpl& tag, String text)
171 {
172 return setFrameText(tag, ID3FID_ALBUM, text);
173 }
174
175 size_t id3::v2::removeAlbums(ID3_TagImpl& tag)
176 {
177 return removeFrames(tag, ID3FID_ALBUM);
178 }
179
181
182 ID3_Frame* id3::v2::hasTitle(const ID3_TagImpl& tag)
183 {
184 ID3_Frame* frame = tag.Find(ID3FID_TITLE);
185 return(frame);
186 }
187
188 String id3::v2::getTitle(const ID3_TagImpl& tag)
189 {
190 return getFrameText(tag, ID3FID_TITLE);
191 }
192
193 ID3_Frame* id3::v2::setTitle(ID3_TagImpl& tag, String text)
194 {
195 return setFrameText(tag, ID3FID_TITLE, text);
196 }
197
198 size_t id3::v2::removeTitles(ID3_TagImpl& tag)
199 {
200 return removeFrames(tag, ID3FID_TITLE);
201 }
202
204
205 ID3_Frame* id3::v2::hasYear(const ID3_TagImpl& tag)
206 {
207 ID3_Frame* frame = tag.Find(ID3FID_YEAR);
208 return(frame);
209 }
210
211 String id3::v2::getYear(const ID3_TagImpl& tag)
212 {
213 return getFrameText(tag, ID3FID_YEAR);
214 }
215
216 ID3_Frame* id3::v2::setYear(ID3_TagImpl& tag, String text)
217 {
218 return setFrameText(tag, ID3FID_YEAR, text);
219 }
220
221 size_t id3::v2::removeYears(ID3_TagImpl& tag)
222 {
223 return removeFrames(tag, ID3FID_YEAR);
224 }
225
227
228 ID3_Frame* id3::v2::hasV1Comment(const ID3_TagImpl& tag)
229 {
230 ID3_Frame* frame = NULL;
231 (frame = tag.Find(ID3FID_COMMENT, ID3FN_DESCRIPTION, STR_V1_COMMENT_DESC)) ||
232 (frame = tag.Find(ID3FID_COMMENT, ID3FN_DESCRIPTION, "" )) ||
233 (frame = tag.Find(ID3FID_COMMENT));
234 return(frame);
235 }
236
237 ID3_Frame* id3::v2::hasComment(const ID3_TagImpl& tag)
238 {
239 ID3_Frame* frame = tag.Find(ID3FID_COMMENT);
240 return(frame);
241 }
242
243 String id3::v2::getV1Comment(const ID3_TagImpl& tag)
244 {
245 ID3_Frame* frame;
246 (frame = tag.Find(ID3FID_COMMENT, ID3FN_DESCRIPTION, STR_V1_COMMENT_DESC)) ||
247 (frame = tag.Find(ID3FID_COMMENT, ID3FN_DESCRIPTION, "" )) ||
248 (frame = tag.Find(ID3FID_COMMENT));
249 return getString(frame, ID3FN_TEXT);
250 }
251
252 String id3::v2::getComment(const ID3_TagImpl& tag, String desc)
253 {
254 ID3_Frame* frame = tag.Find(ID3FID_COMMENT, ID3FN_DESCRIPTION, desc.c_str());
255 return getString(frame, ID3FN_TEXT);
256 }
257
258 ID3_Frame* id3::v2::setComment(ID3_TagImpl& tag, String text, String desc,
259 String lang)
260 {
261 ID3D_NOTICE( "id3::v2::setComment: trying to find frame with description = " << desc );
262 ID3_Frame* frame = NULL;
263 // See if there is already a comment with this description
264 for (ID3_TagImpl::iterator iter = tag.begin(); iter != tag.end(); ++iter)
265 {
266 frame = *iter;
267 if (frame == NULL)
268 {
269 continue;
270 }
271 if (frame->GetID() == ID3FID_COMMENT)
272 {
273 String tmpDesc = getString(frame, ID3FN_DESCRIPTION);
274 if (tmpDesc == desc)
275 {
276 ID3D_NOTICE( "id3::v2::setComment: found frame with description = " << desc );
277 break;
278 }
279 }
280 frame = NULL;
281 }
282 if (frame == NULL)
283 {
284 ID3D_NOTICE( "id3::v2::setComment: creating new comment frame" );
285 frame = new ID3_Frame(ID3FID_COMMENT);
286 if(!tag.AttachFrame(frame)) return NULL;
287 }
288 if (!frame)
289 {
290 ID3D_WARNING( "id3::v2::setComment: ack! no frame" );
291 }
292 else
293 {
294 frame->GetField(ID3FN_LANGUAGE)->Set(lang.c_str());
295 frame->GetField(ID3FN_DESCRIPTION)->Set(desc.c_str());
296 frame->GetField(ID3FN_TEXT)->Set(text.c_str());
297 }
298
299 return frame;
300 }
301
302 // Remove all comments from the tag
303 size_t id3::v2::removeAllComments(ID3_TagImpl& tag)
304 {
305 return removeFrames(tag, ID3FID_COMMENT);
306 }
307
308 // Remove all comments from the tag with the given description
309 size_t id3::v2::removeComments(ID3_TagImpl& tag, String desc)
310 {
311 size_t numRemoved = 0;
312
313 for (ID3_TagImpl::iterator iter = tag.begin(); iter != tag.end(); ++iter)
314 {
315 ID3_Frame* frame = *iter;
316 if (frame == NULL)
317 {
318 continue;
319 }
320 if (frame->GetID() == ID3FID_COMMENT)
321 {
322 // See if the description we have matches the description of the
323 // current comment. If so, remove the comment
324 String tmpDesc = getString(frame, ID3FN_DESCRIPTION);
325 if (tmpDesc == desc)
326 {
327 frame = tag.RemoveFrame(frame);
328 delete frame;
329 numRemoved++;
330 }
331 }
332 }
333
334 return numRemoved;
335 }
336
338
339 ID3_Frame* id3::v2::hasTrack(const ID3_TagImpl& tag)
340 {
341 ID3_Frame* frame = tag.Find(ID3FID_TRACKNUM);
342 return(frame);
343 }
344
345 String id3::v2::getTrack(const ID3_TagImpl& tag)
346 {
347 return getFrameText(tag, ID3FID_TRACKNUM);
348 }
349
350 size_t id3::v2::getTrackNum(const ID3_TagImpl& tag)
351 {
352 String sTrack = getTrack(tag);
353 return ::atoi(sTrack.c_str());
354 }
355
356 ID3_Frame* id3::v2::setTrack(ID3_TagImpl& tag, uchar trk, uchar ttl)
357 {
358 ID3_Frame* frame = NULL;
359 String track = toString((size_t)trk);
360 if (ttl > 0)
361 {
362 track += "/";
363 track += toString((size_t)ttl);
364 }
365 setFrameText(tag, ID3FID_TRACKNUM, track);
366
367 return frame;
368 }
369
370 size_t id3::v2::removeTracks(ID3_TagImpl& tag)
371 {
372 return removeFrames(tag, ID3FID_TRACKNUM);
373 }
374
376
377 ID3_Frame* id3::v2::hasGenre(const ID3_TagImpl& tag)
378 {
379 ID3_Frame* frame = tag.Find(ID3FID_CONTENTTYPE);
380 return(frame);
381 }
382
383 String id3::v2::getGenre(const ID3_TagImpl& tag)
384 {
385 return getFrameText(tag, ID3FID_CONTENTTYPE);
386 }
387
388 size_t id3::v2::getGenreNum(const ID3_TagImpl& tag)
389 {
390 String sGenre = getGenre(tag);
391 size_t ulGenre = 0xFF;
392 size_t size = sGenre.size();
393
394 // If the genre string begins with "(ddd)", where "ddd" is a number, then
395 // "ddd" is the genre number---get it
396 size_t i = 0;
397 if (i < size && size && sGenre[i] == '(')
398 {
399 ++i;
400 while (i < size && isdigit(sGenre[i]))
401 {
402 ++i;
403 }
404 if (i < size && sGenre[i] == ')')
405 {
406 // if the genre number is greater than 255, its invalid.
407 ulGenre = min(0xFF, atoi(&sGenre[1]));
408 }
409 }
410
411 return ulGenre;
412 }
413
414 ID3_Frame* id3::v2::setGenre(ID3_TagImpl& tag, size_t genre)
415 {
416 String sGenre = "(";
417 sGenre += toString(genre) + ")";
418 return setFrameText(tag, ID3FID_CONTENTTYPE, sGenre);
419 }
420
421 size_t id3::v2::removeGenres(ID3_TagImpl& tag)
422 {
423 return removeFrames(tag, ID3FID_CONTENTTYPE);
424 }
425
427
428 ID3_Frame* id3::v2::hasLyrics(const ID3_TagImpl& tag)
429 {
430 ID3_Frame* frame = tag.Find(ID3FID_UNSYNCEDLYRICS);
431 return(frame);
432 }
433
434 String id3::v2::getLyrics(const ID3_TagImpl& tag)
435 {
436 return getFrameText(tag, ID3FID_UNSYNCEDLYRICS);
437 }
438
439 ID3_Frame* id3::v2::setLyrics(ID3_TagImpl& tag, String text, String desc,
440 String lang)
441 {
442 ID3_Frame* frame = NULL;
443 // See if there is already a comment with this description
444 for (ID3_TagImpl::iterator iter = tag.begin(); iter != tag.end(); ++iter)
445 {
446 frame = *iter;
447 if (frame == NULL)
448 {
449 continue;
450 }
451 if (frame->GetID() == ID3FID_COMMENT)
452 {
453 String tmpDesc = getString(frame, ID3FN_DESCRIPTION);
454 if (tmpDesc == desc)
455 {
456 break;
457 }
458 }
459 frame = NULL;
460 }
461 if (frame == NULL)
462 {
463 frame = new ID3_Frame(ID3FID_UNSYNCEDLYRICS);
464 if(!tag.AttachFrame(frame)) return NULL;
465 }
466 frame->GetField(ID3FN_LANGUAGE)->Set(lang.c_str());
467 frame->GetField(ID3FN_DESCRIPTION)->Set(desc.c_str());
468 frame->GetField(ID3FN_TEXT)->Set(text.c_str());
469
470 return frame;
471 }
472
473 size_t id3::v2::removeLyrics(ID3_TagImpl& tag)
474 {
475 return removeFrames(tag, ID3FID_UNSYNCEDLYRICS);
476 }
477
478 String id3::v2::getLyricist(const ID3_TagImpl& tag)
479 {
480 return getFrameText(tag, ID3FID_LYRICIST);
481 }
482
483 ID3_Frame* id3::v2::setLyricist(ID3_TagImpl& tag, String text)
484 {
485 return setFrameText(tag, ID3FID_LYRICIST, text);
486 }
487
488 size_t id3::v2::removeLyricists(ID3_TagImpl& tag)
489 {
490 return removeFrames(tag, ID3FID_LYRICIST);
491 }
492
494
495 ID3_Frame* id3::v2::hasSyncLyrics(const ID3_TagImpl& tag, String lang, String desc)
496 {
497 ID3_Frame* frame=NULL;
498 (frame = tag.Find(ID3FID_SYNCEDLYRICS, ID3FN_LANGUAGE, lang)) ||
499 (frame = tag.Find(ID3FID_SYNCEDLYRICS, ID3FN_DESCRIPTION, desc));
500 return(frame);
501 }
502
503 ID3_Frame* id3::v2::setSyncLyrics(ID3_TagImpl& tag, BString data,
504 ID3_TimeStampFormat format, String desc,
505 String lang, ID3_ContentType type)
506 {
507 ID3_Frame* frame = NULL;
508
509 // check if a SYLT frame of this language or descriptor already exists
510 (frame = tag.Find(ID3FID_SYNCEDLYRICS, ID3FN_LANGUAGE, lang)) ||
511 (frame = tag.Find(ID3FID_SYNCEDLYRICS, ID3FN_DESCRIPTION, desc));
512
513 if (!frame)
514 {
515 frame = new ID3_Frame(ID3FID_SYNCEDLYRICS);
516 if(!tag.AttachFrame(frame)) return NULL;
517 }
518 frame->GetField(ID3FN_LANGUAGE)->Set(lang.c_str());
519 frame->GetField(ID3FN_DESCRIPTION)->Set(desc.c_str());
520 frame->GetField(ID3FN_TIMESTAMPFORMAT)->Set(format);
521 frame->GetField(ID3FN_CONTENTTYPE)->Set(type);
522 frame->GetField(ID3FN_DATA)->Set(data.data(), data.size());
523
524 return frame;
525 }
526
527 BString id3::v2::getSyncLyrics(const ID3_TagImpl& tag, String lang, String desc)
528 {
529 // check if a SYLT frame of this language or descriptor exists
530 ID3_Frame* frame = NULL;
531 (frame = tag.Find(ID3FID_SYNCEDLYRICS, ID3FN_LANGUAGE, lang)) ||
532 (frame = tag.Find(ID3FID_SYNCEDLYRICS, ID3FN_DESCRIPTION, desc)) ||
533 (frame = tag.Find(ID3FID_SYNCEDLYRICS));
534
535 // get the lyrics size
536 ID3_Field* fld = frame->GetField(ID3FN_DATA);
537 return BString(reinterpret_cast<const BString::value_type *>(fld->GetRawBinary()), fld->Size());
538 }
539
ID3_Field::GetRawBinary
virtual const uchar * GetRawBinary() const =0
dami::id3::v2::getArtist
ID3_C_EXPORT String getArtist(const ID3_TagImpl &)
Definition: helpers.cpp:130
dami::id3::v2::getTitle
ID3_C_EXPORT String getTitle(const ID3_TagImpl &)
Definition: helpers.cpp:188
dami::min
const T & min(const T &a, const T &b)
Definition: utils.h:51
ID3_TagImpl::end
iterator end()
Definition: tag_impl.h:133
ID3_TagImpl::begin
iterator begin()
Definition: tag_impl.h:132
dami::id3::v2::removeGenres
ID3_C_EXPORT size_t removeGenres(ID3_TagImpl &)
Definition: helpers.cpp:421
dami::id3::v2::hasTitle
ID3_C_EXPORT ID3_Frame * hasTitle(const ID3_TagImpl &)
Definition: helpers.cpp:182
ID3FID_CONDUCTOR
Conductor/performer refinement.
Definition: globals.h:294
dami::String
std::basic_string< char > String
Definition: id3lib_strings.h:198
dami::id3::v2::removeYears
ID3_C_EXPORT size_t removeYears(ID3_TagImpl &)
Definition: helpers.cpp:221
ID3_TagImpl
Definition: tag_impl.h:73
ID3FID_COMMENT
Comments.
Definition: globals.h:235
ID3FN_LANGUAGE
Language field.
Definition: globals.h:209
ID3_ContentType
ID3_ContentType
Definition: globals.h:381
ID3_Frame::GetField
ID3_Field * GetField(ID3_FieldID name) const
Definition: frame.cpp:147
ID3FID_TITLE
Title/songname/content description.
Definition: globals.h:278
dami::id3::v2::removeLyricists
ID3_C_EXPORT size_t removeLyricists(ID3_TagImpl &)
Definition: helpers.cpp:488
dami::id3::v2::getYear
ID3_C_EXPORT String getYear(const ID3_TagImpl &)
Definition: helpers.cpp:211
dami::id3::v2::getGenreNum
ID3_C_EXPORT size_t getGenreNum(const ID3_TagImpl &)
Definition: helpers.cpp:388
dami::id3::v2::hasAlbum
ID3_C_EXPORT ID3_Frame * hasAlbum(const ID3_TagImpl &)
Definition: helpers.cpp:159
ID3FN_TIMESTAMPFORMAT
SYLT Timestamp Format.
Definition: globals.h:221
dami::id3::v2::getAlbum
ID3_C_EXPORT String getAlbum(const ID3_TagImpl &)
Definition: helpers.cpp:165
dami::id3::v2::getFrameText
ID3_C_EXPORT String getFrameText(const ID3_TagImpl &, ID3_FrameID)
Definition: helpers.cpp:99
dami::id3::v2::hasTrack
ID3_C_EXPORT ID3_Frame * hasTrack(const ID3_TagImpl &)
Definition: helpers.cpp:339
ID3TE_ASCII
Definition: globals.h:145
dami::id3::v2::setSyncLyrics
ID3_C_EXPORT ID3_Frame * setSyncLyrics(ID3_TagImpl &, BString, ID3_TimeStampFormat, String, String, ID3_ContentType)
Definition: helpers.cpp:503
ID3_Frame::GetID
ID3_FrameID GetID() const
Returns the type of frame that the object represents.
Definition: frame.cpp:94
dami::id3::v2::getLyricist
ID3_C_EXPORT String getLyricist(const ID3_TagImpl &)
Definition: helpers.cpp:478
ID3FID_CONTENTTYPE
Content type.
Definition: globals.h:263
dami::id3::v2::setAlbum
ID3_C_EXPORT ID3_Frame * setAlbum(ID3_TagImpl &, String)
Definition: helpers.cpp:170
dami::id3::v2::removeTitles
ID3_C_EXPORT size_t removeTitles(ID3_TagImpl &)
Definition: helpers.cpp:198
ID3_FrameID
ID3_FrameID
Enumeration of the different types of frames recognized by id3lib.
Definition: globals.h:229
ID3_Field::SetEncoding
virtual bool SetEncoding(ID3_TextEnc enc)=0
ID3FID_LEADARTIST
Lead performer(s)/Soloist(s)
Definition: globals.h:292
uchar
unsigned char uchar
Definition: globals.h:114
ID3FN_DESCRIPTION
Description field.
Definition: globals.h:204
dami::id3::v2::setTrack
ID3_C_EXPORT ID3_Frame * setTrack(ID3_TagImpl &, uchar ucTrack, uchar ucTotal)
Definition: helpers.cpp:356
dami::id3::v2::setYear
ID3_C_EXPORT ID3_Frame * setYear(ID3_TagImpl &, String)
Definition: helpers.cpp:216
ID3_Field::Size
virtual size_t Size() const =0
Returns the size of a field.
ID3FN_CONTENTTYPE
SYLT content type.
Definition: globals.h:222
dami::id3::v2::removeArtists
ID3_C_EXPORT size_t removeArtists(ID3_TagImpl &)
Definition: helpers.cpp:142
ID3_TagImpl::Find
ID3_Frame * Find(ID3_FrameID id) const
Definition: tag_find.cpp:61
dami::id3::v2::getStringAtIndex
ID3_C_EXPORT String getStringAtIndex(const ID3_Frame *, ID3_FieldID, size_t)
Definition: helpers.cpp:63
dami::id3::v2::removeTracks
ID3_C_EXPORT size_t removeTracks(ID3_TagImpl &)
Definition: helpers.cpp:370
dami::id3::v2::removeAllComments
ID3_C_EXPORT size_t removeAllComments(ID3_TagImpl &)
Definition: helpers.cpp:303
dami::id3::v2::getSyncLyrics
ID3_C_EXPORT BString getSyncLyrics(const ID3_TagImpl &tag, String lang, String desc)
Definition: helpers.cpp:527
dami::BString
std::basic_string< unsigned char > BString
Definition: id3lib_strings.h:199
ID3FID_TRACKNUM
Track number/Position in set.
Definition: globals.h:299
dami::id3::v2::getTrackNum
ID3_C_EXPORT size_t getTrackNum(const ID3_TagImpl &)
Definition: helpers.cpp:350
dami::id3::v2::getComment
ID3_C_EXPORT String getComment(const ID3_TagImpl &, String desc)
Definition: helpers.cpp:252
dami::id3::v2::hasLyrics
ID3_C_EXPORT ID3_Frame * hasLyrics(const ID3_TagImpl &)
Definition: helpers.cpp:428
dami::id3::v2::removeComments
ID3_C_EXPORT size_t removeComments(ID3_TagImpl &, String)
Definition: helpers.cpp:309
tag_impl.h
dami::id3::v2::hasArtist
ID3_C_EXPORT ID3_Frame * hasArtist(const ID3_TagImpl &)
Definition: helpers.cpp:120
dami::id3::v2::getString
ID3_C_EXPORT String getString(const ID3_Frame *, ID3_FieldID)
Definition: helpers.cpp:43
ID3_TagImpl::AttachFrame
bool AttachFrame(ID3_Frame *)
Definition: tag_impl.cpp:167
dami::id3::v2::hasYear
ID3_C_EXPORT ID3_Frame * hasYear(const ID3_TagImpl &)
Definition: helpers.cpp:205
dami::id3::v2::setGenre
ID3_C_EXPORT ID3_Frame * setGenre(ID3_TagImpl &, size_t ucGenre)
Definition: helpers.cpp:414
dami::id3::v2::getTrack
ID3_C_EXPORT String getTrack(const ID3_TagImpl &)
Definition: helpers.cpp:345
ID3_TextEnc
ID3_TextEnc
Enumeration of the types of text encodings: ascii or unicode.
Definition: globals.h:137
ID3FID_YEAR
Year.
Definition: globals.h:311
ID3FID_SYNCEDLYRICS
Synchronized lyric/text.
Definition: globals.h:258
ID3_Field::GetRawText
virtual const char * GetRawText() const =0
ID3_Frame
The representative class of an id3v2 frame.
Definition: id3lib_frame.h:38
ID3_Field::Set
virtual void Set(uint32)=0
dami::id3::v2::removeAlbums
ID3_C_EXPORT size_t removeAlbums(ID3_TagImpl &)
Definition: helpers.cpp:175
ID3_Field::GetNumTextItems
virtual size_t GetNumTextItems() const =0
dami::toString
String ID3_C_EXPORT toString(uint32 val)
Definition: utils.cpp:365
ID3_TagImpl::RemoveFrame
ID3_Frame * RemoveFrame(const ID3_Frame *)
Definition: tag_impl.cpp:185
ID3_TimeStampFormat
ID3_TimeStampFormat
Definition: globals.h:417
STR_V1_COMMENT_DESC
#define STR_V1_COMMENT_DESC
String used for the description field of a comment tag converted from an id3v1 tag to an id3v2 tag...
Definition: globals.h:111
ID3_TagImpl::iterator
Frames::iterator iterator
Definition: tag_impl.h:77
ID3FN_DATA
Data field.
Definition: globals.h:203
ID3_Field::GetEncoding
virtual ID3_TextEnc GetEncoding() const =0
ID3FID_BAND
Band/orchestra/accompaniment.
Definition: globals.h:293
dami::id3::v2::getLyrics
ID3_C_EXPORT String getLyrics(const ID3_TagImpl &)
Definition: helpers.cpp:434
NULL
#define NULL
Definition: globals.h:743
dami::id3::v2::getV1Comment
ID3_C_EXPORT String getV1Comment(const ID3_TagImpl &)
Definition: helpers.cpp:243
ID3FID_LYRICIST
Lyricist/Text writer.
Definition: globals.h:274
ID3_Field
The representative class of an ID3v2 field.
Definition: field.h:36
dami::id3::v2::hasSyncLyrics
ID3_C_EXPORT ID3_Frame * hasSyncLyrics(const ID3_TagImpl &, String lang, String desc)
Definition: helpers.cpp:495
ID3_Field::GetRawTextItem
virtual const char * GetRawTextItem(size_t) const =0
dami::id3::v2::removeFrames
ID3_C_EXPORT size_t removeFrames(ID3_TagImpl &, ID3_FrameID)
Definition: helpers.cpp:84
dami::id3::v2::setLyricist
ID3_C_EXPORT ID3_Frame * setLyricist(ID3_TagImpl &, String)
Definition: helpers.cpp:483
helpers.h
dami::id3::v2::setArtist
ID3_C_EXPORT ID3_Frame * setArtist(ID3_TagImpl &, String)
Definition: helpers.cpp:136
dami::id3::v2::hasGenre
ID3_C_EXPORT ID3_Frame * hasGenre(const ID3_TagImpl &)
Definition: helpers.cpp:377
ID3FID_ALBUM
Album/Movie/Show title.
Definition: globals.h:260
dami::id3::v2::getGenre
ID3_C_EXPORT String getGenre(const ID3_TagImpl &)
Definition: helpers.cpp:383
dami::id3::v2::setComment
ID3_C_EXPORT ID3_Frame * setComment(ID3_TagImpl &, String, String, String)
Definition: helpers.cpp:258
ID3FID_UNSYNCEDLYRICS
Unsynchronized lyric/text transcription.
Definition: globals.h:314
dami::id3::v2::setTitle
ID3_C_EXPORT ID3_Frame * setTitle(ID3_TagImpl &, String)
Definition: helpers.cpp:193
dami::id3::v2::hasComment
ID3_C_EXPORT ID3_Frame * hasComment(const ID3_TagImpl &)
Definition: helpers.cpp:237
dami::id3::v2::hasV1Comment
ID3_C_EXPORT ID3_Frame * hasV1Comment(const ID3_TagImpl &)
Definition: helpers.cpp:228
ID3FN_TEXT
Text field.
Definition: globals.h:201
dami::id3::v2::removeLyrics
ID3_C_EXPORT size_t removeLyrics(ID3_TagImpl &)
Definition: helpers.cpp:473
ID3_FieldID
ID3_FieldID
Enumeration of the different types of fields in a frame.
Definition: globals.h:197
dami::id3::v2::setLyrics
ID3_C_EXPORT ID3_Frame * setLyrics(ID3_TagImpl &, String, String, String)
Definition: helpers.cpp:439
dami::id3::v2::setFrameText
ID3_C_EXPORT ID3_Frame * setFrameText(ID3_TagImpl &, ID3_FrameID, String)
Definition: helpers.cpp:105
ID3FID_COMPOSER
Composer.
Definition: globals.h:262