id3dev 26.01 An ID3 metadata library

Loading...
Searching...
No Matches
id3v1.c
Go to the documentation of this file.
1
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13#include <math.h>
14#include "id3v1/id3v1Parser.h"
15#include "id3v1/id3v1.h"
16#include "id3dependencies/ByteStream/include/byteStream.h"
17#include "id3dependencies/ByteStream/include/byteInt.h"
18
29 Id3v1Tag *id3v1TagFromFile(const char *filePath) {
30 if (filePath == NULL) {
31 return NULL;
32 }
33
34 FILE *fp = NULL;
35 uint8_t id3Bytes[ID3V1_MAX_SIZE];
36
37 // make sure the file can really be read
38 fp = fopen(filePath, "rb");
39 if (fp == NULL) {
40 return NULL;
41 }
42
43 //seek to the start of metadata
44 if ((fseek(fp, -ID3V1_MAX_SIZE, SEEK_END)) != 0) {
45 (void) fclose(fp);
46 return NULL;
47 }
48
49 if ((fread(id3Bytes, ID3V1_MAX_SIZE, 1, fp)) != 1) {
50 (void) fclose(fp);
51 return NULL;
52 }
53
54 (void) fclose(fp);
55 return id3v1TagFromBuffer(id3Bytes);
56}
57
64 Id3v1Tag *id3v1CopyTag(Id3v1Tag *toCopy) {
65 if (toCopy == NULL) {
66 return NULL;
67 }
68
69 return id3v1CreateTag(toCopy->title, toCopy->artist, toCopy->albumTitle, toCopy->year, toCopy->track,
70 toCopy->comment, toCopy->genre);
71}
72
80 static int internal_id3v1CharsToStructUint8(const char *src, uint8_t *dest) {
81 memset(dest, 0, ID3V1_FIELD_SIZE);
82
83 if (src != NULL) {
84 const int len = (int) strlen(src);
85 const int wLen = ((len > ID3V1_FIELD_SIZE) ? ID3V1_FIELD_SIZE : len);
86
87 memcpy(dest, (uint8_t *) src, wLen);
88 }
89
90 return 1;
91}
92
100 int id3v1WriteTitle(const char *title, Id3v1Tag *tag) {
101 return (tag == NULL) ? 0 : internal_id3v1CharsToStructUint8(title, tag->title);
102}
103
111 int id3v1WriteArtist(const char *artist, Id3v1Tag *tag) {
112 return (tag == NULL) ? 0 : internal_id3v1CharsToStructUint8(artist, tag->artist);
113}
114
122 int id3v1WriteAlbum(const char *album, Id3v1Tag *tag) {
123 return (tag == NULL) ? 0 : internal_id3v1CharsToStructUint8(album, tag->albumTitle);
124}
125
133 int id3v1WriteYear(int year, Id3v1Tag *tag) {
134 if (tag == NULL) {
135 return 0;
136 }
137
138 tag->year = year;
139 return 1;
140}
141
149 int id3v1WriteComment(const char *comment, Id3v1Tag *tag) {
150 return (tag == NULL) ? 0 : internal_id3v1CharsToStructUint8(comment, tag->comment);
151}
152
160 int id3v1WriteGenre(Genre genre, Id3v1Tag *tag) {
161 if (tag == NULL) {
162 return 0;
163 }
164
165 tag->genre = genre;
166 return 1;
167}
168
176 int id3v1WriteTrack(int track, Id3v1Tag *tag) {
177 if (tag == NULL) {
178 return 0;
179 }
180
181 tag->track = track;
182 return 1;
183}
184
192 bool id3v1CompareTag(const Id3v1Tag *tag1, const Id3v1Tag *tag2) {
193 if (tag1 == NULL || tag2 == NULL) {
194 return false;
195 }
196
197 if (tag1->genre != tag2->genre) {
198 return false;
199 }
200
201 if (tag1->track != tag2->track) {
202 return false;
203 }
204
205 if (tag1->year != tag2->year) {
206 return false;
207 }
208
209 if (memcmp(tag1->albumTitle, tag2->albumTitle, ID3V1_FIELD_SIZE) != 0) {
210 return false;
211 }
212
213 if (memcmp(tag1->artist, tag2->artist, ID3V1_FIELD_SIZE) != 0) {
214 return false;
215 }
216
217 if (memcmp(tag1->comment, tag2->comment, ID3V1_FIELD_SIZE) != 0) {
218 return false;
219 }
220
221 if (memcmp(tag1->title, tag2->title, ID3V1_FIELD_SIZE) != 0) {
222 return false;
223 }
224
225 return true;
226}
227
235 char *id3v1GenreFromTable(Genre val) {
236 //int to string
237 switch (val) {
238 case BLUES_GENRE:
239 return "Blues\0";
240 case CLASSIC_ROCK_GENRE:
241 return "Classic Rock\0";
242 case COUNTRY_GENRE:
243 return "Country\0";
244 case DANCE_GENRE:
245 return "Dance\0";
246 case DISCO_GENRE:
247 return "Disco\0";
248 case FUNK_GENRE:
249 return "Funk\0";
250 case GRUNGE_GENRE:
251 return "Grunge\0";
252 case HIP_HOP_GENRE:
253 return "Hip-Hop\0";
254 case JAZZ_GENRE:
255 return "Jazz\0";
256 case METAL_GENRE:
257 return "Metal\0";
258 case NEW_AGE_GENRE:
259 return "New Age\0";
260 case OLDIES_GENRE:
261 return "Oldies\0";
262 case OTHER_GENRE:
263 return "Other\0";
264 case POP_GENRE:
265 return "Pop\0";
266 case RHYTHM_AND_BLUES_GENRE:
267 return "Rhythm and Blues\0";
268 case RAP_GENRE:
269 return "Rap\0";
270 case REGGAE_GENRE:
271 return "Reggae\0";
272 case ROCK_GENRE:
273 return "Rock\0";
274 case TECHNO_GENRE:
275 return "Techno\0";
276 case INDUSTRIAL_GENRE:
277 return "Industrial\0";
278 case ALTERNATIVE_GENRE:
279 return "Alternative\0";
280 case SKA_GENRE:
281 return "Ska\0";
282 case DEATH_METAL_GENRE:
283 return "Death Metal\0";
284 case PRANKS_GENRE:
285 return "Pranks\0";
286 case SOUNDTRACK_GENRE:
287 return "Soundtrack\0";
288 case EURO_TECHNO_GENRE:
289 return "Euro-Techno\0";
290 case AMBIENT_GENRE:
291 return "Ambient\0";
292 case TRIP_HOP_GENRE:
293 return "Trip-Hop\0";
294 case VOCAL_GENRE:
295 return "Vocal\0";
296 case JAZZ_AND_FUNK_GENRE:
297 return "Jazz and Funk\0";
298 case FUSION_GENRE:
299 return "Fusion\0";
300 case TRANCE_GENRE:
301 return "Trance\0";
302 case CLASSICAL_GENRE:
303 return "Classical\0";
304 case INSTRUMENTAL_GENRE:
305 return "Instrumental\0";
306 case ACID_GENRE:
307 return "Acid\0";
308 case HOUSE_GENRE:
309 return "House\0";
310 case GAME_GENRE:
311 return "Game\0";
312 case SOUND_CLIP_GENRE:
313 return "Sound Clip\0";
314 case GOSPEL_GENRE:
315 return "Gospel\0";
316 case NOISE_GENRE:
317 return "Noise\0";
318 case ALTERNATIVE_ROCK_GENRE:
319 return "Alternative Rock\0";
320 case BASS_GENRE:
321 return "Bass\0";
322 case SOUL_GENRE:
323 return "Soul\0";
324 case PUNK_GENRE:
325 return "Punk\0";
326 case SPACE_GENRE:
327 return "Space\0";
328 case MEDITATIVE_GENRE:
329 return "Meditative\0";
330 case INSTRUMENTAL_POP_GENRE:
331 return "Instrumental Pop\0";
332 case INSTRUMENTAL_ROCK_GENRE:
333 return "Instrumental Rock\0";
334 case ETHNIC_GENRE:
335 return "Ethnic\0";
336 case GOTHIC_GENRE:
337 return "Gothic\0";
338 case DARKWAVE_GENRE:
339 return "Darkwave\0";
340 case TECHNO_INDUSTRIAL_GENRE:
341 return "Techno Industrial\0";
342 case ELECTRONIC_GENRE:
343 return "Electronic\0";
344 case POP_FOLK_GENRE:
345 return "Pop Folk\0";
346 case EURODANCE_GENRE:
347 return "Eurodance\0";
348 case DREAM_GENRE:
349 return "Dream\0";
350 case SOUTHERN_ROCK_GENRE:
351 return "Southern Rock\0";
352 case COMEDY_GENRE:
353 return "Comedy\0";
354 case CULT_GENRE:
355 return "Cult\0";
356 case GANGSTA_GENRE:
357 return "Gangsta\0";
358 case TOP_40_GENRE:
359 return "Top 40\0";
360 case CHRISTIAN_RAP_GENRE:
361 return "Christian Rap\0";
362 case POP_FUNK_GENRE:
363 return "Pop Funk\0";
364 case JUNGLE_MUSIC_GENRE:
365 return "Jungle Music\0";
366 case NATIVE_US_GENRE:
367 return "Native US\0";
368 case CABARET_GENRE:
369 return "Cabaret\0";
370 case NEW_WAVE_GENRE:
371 return "New Wave\0";
372 case PSYCHEDELIC_GENRE:
373 return "Psychedelic\0";
374 case RAVE_GENRE:
375 return "Rave\0";
376 case SHOWTUNES_GENRE:
377 return "Showtunes\0";
378 case TRAILER_GENRE:
379 return "Trailer\0";
380 case LO_FI_GENRE:
381 return "Lo-Fi\0";
382 case TRIBAL_GENRE:
383 return "Tribal\0";
384 case ACID_PUNK_GENRE:
385 return "Acid Punk\0";
386 case ACID_JAZZ_GENRE:
387 return "Acid Jazz\0";
388 case POLKA_GENRE:
389 return "Polka\0";
390 case RETRO_GENRE:
391 return "Retro\0";
392 case MUSICAL_GENRE:
393 return "Musical\0";
394 case ROCKNROLL_GENRE:
395 return "Rock and Roll\0";
396 case HARD_ROCK_GENRE:
397 return "Hard Rock\0";
398 case FOLK_GENRE:
399 return "Folk\0";
400 case FOLK_ROCK_GENRE:
401 return "Folk Rock\0";
402 case NATIONAL_FOLK_GENRE:
403 return "National Folk\0";
404 case SWING_GENRE:
405 return "Swing\0";
406 case FAST_FUSION_GENRE:
407 return "Fast Fusion\0";
408 case BEBOP_GENRE:
409 return "Bebop\0";
410 case LATIN_GENRE:
411 return "Latin\0";
412 case REVIVAL_GENRE:
413 return "Revival\0";
414 case CELTIC_GENRE:
415 return "Celtic\0";
416 case BLUEGRASS_GENRE:
417 return "Bluegrass\0";
418 case AVANTGARDE_GENRE:
419 return "Avantgarde\0";
420 case GOTHIC_ROCK_GENRE:
421 return "Gothic Rock\0";
422 case PROGRESSIVE_ROCK_GENRE:
423 return "Progressive Rock\0";
424 case PSYCHEDELIC_ROCK_GENRE:
425 return "Psychedelic Rock\0";
426 case SYMPHONIC_ROCK_GENRE:
427 return "Symphonic Rock\0";
428 case SLOW_ROCK_GENRE:
429 return "Slow Rock\0";
430 case BIG_BAND_GENRE:
431 return "Big Band\0";
432 case CHORUS_GENRE:
433 return "Chorus\0";
434 case EASY_LISTENING_GENRE:
435 return "Easy Listening\0";
436 case ACOUSTIC_GENRE:
437 return "Acoustic\0";
438 case HUMOUR_GENRE:
439 return "Humour\0";
440 case SPEECH_GENRE:
441 return "Speech\0";
442 case CHANSON_GENRE:
443 return "Chanson\0";
444 case OPERA_GENRE:
445 return "Opera\0";
446 case CHAMBER_MUSIC_GENRE:
447 return "Chamber Music\0";
448 case SONATA_GENRE:
449 return "Sonata\0";
450 case SYMPHONY_GENRE:
451 return "Symphony\0";
452 case BOOTY_BASS_GENRE:
453 return "Booty Bass\0";
454 case PRIMUS_GENRE:
455 return "Primus\0";
456 case PORN_GROOVE_GENRE:
457 return "Porn Groove\0";
458 case SATIRE_GENRE:
459 return "Satire\0";
460 case SLOW_JAM_GENRE:
461 return "Slow Jam\0";
462 case CLUB_GENRE:
463 return "Club\0";
464 case TANGO_GENRE:
465 return "Tango\0";
466 case SAMBA_GENRE:
467 return "Samba\0";
468 case FOLKLORE_GENRE:
469 return "Folklore\0";
470 case BALLAD_GENRE:
471 return "Ballad\0";
472 case POWER_BALLAD_GENRE:
473 return "Power Ballad\0";
474 case RHYTHMIC_SOUL_GENRE:
475 return "Rhythmic Soul\0";
476 case FREESTYLE_GENRE:
477 return "Freestyle\0";
478 case DUET_GENRE:
479 return "Duet\0";
480 case PUNK_ROCK_GENRE:
481 return "Punk Rock\0";
482 case DRUM_SOLO_GENRE:
483 return "Drum Solo\0";
484 case A_CAPPELLA_GENRE:
485 return "A Cappella\0";
486 case EURO_HOUSE_GENRE:
487 return "Euro-House\0";
488 case DANCE_HALL_GENRE:
489 return "Dance Hall\0";
490 case GOA_MUSIC_GENRE:
491 return "Goa Music\0";
492 case DRUM_AND_BASS_GENRE:
493 return "Drum and Bass\0";
494 case CLUB_HOUSE_GENRE:
495 return "Club-House\0";
496 case HARDCORE_TECHNO_GENRE:
497 return "Hardcore Techno\0";
498 case TERROR_GENRE:
499 return "Terror\0";
500 case INDIE_GENRE:
501 return "Indie\0";
502 case BRITPOP_GENRE:
503 return "Britpop\0";
504 case NEGERPUNK_GENRE:
505 return "Negerpunk\0";
506 case POLSK_PUNK_GENRE:
507 return "Polsk Punk\0";
508 case BEAT_GENRE:
509 return "Beat\0";
510 case CHRISTIAN_GANGSTA_RAP_GENRE:
511 return "Christian Gangsta Rap\0";
512 case HEAVY_METAL_GENRE:
513 return "Heavy Metal\0";
514 case BLACK_METAL_GENRE:
515 return "Black Metal\0";
516 case CROSSOVER_GENRE:
517 return "Crossover\0";
518 case CONTEMPORARY_CHRISTIAN_GENRE:
519 return "Contemporary Christian\0";
520 case CHRISTIAN_ROCK_GENRE:
521 return "Christian Rock\0";
522 case MERENGUE_GENRE:
523 return "Merengue\0";
524 case SALSA_GENRE:
525 return "Salsa\0";
526 case THRASH_METAL_GENRE:
527 return "Thrash Metal\0";
528 case ANIME_GENRE:
529 return "Anime\0";
530 case JPOP_GENRE:
531 return "Jpop\0";
532 case SYNTHPOP_GENRE:
533 return "Synthpop\0";
534 case ABSTRACT_GENRE:
535 return "Abstract\0";
536 case ART_ROCK_GENRE:
537 return "Art Rock";
538 case BAROQUE_GENRE:
539 return "Baroque\0";
540 case BIG_BEAT_GENRE:
541 return "Big Beat\0";
542 case BREAKBEAT_GENRE:
543 return "Breakbeat\0";
544 case CHILLOUT_GENRE:
545 return "Chillout\0";
546 case DOWNTEMPO_GENRE:
547 return "Downtempo\0";
548 case DUB_GENRE:
549 return "Dub\0";
550 case EBM_GENRE:
551 return "EBM\0";
552 case ECLECTIC_GENRE:
553 return "Eclectic\0";
554 case ELECTRO_GENRE:
555 return "Electro\0";
556 case ELECTROCLASH_GENRE:
557 return "Electroclash\0";
558 case EMO_GENRE:
559 return "Emo\0";
560 case EXPERIMENTAL_GENRE:
561 return "Experimental\0";
562 case GARAGE_GENRE:
563 return "Garage\0";
564 case GLOBAL_GENRE:
565 return "Global\0";
566 case IDM_GENRE:
567 return "IDM\0";
568 case ILLBIENT_GENRE:
569 return "Illbient\0";
570 case INDUSTRO_GOTH_GENRE:
571 return "Industro-Goth\0";
572 case JAM_BAND_GENRE:
573 return "Jam Band\0";
574 case KRAUTROCK_GENRE:
575 return "Krautrock\0";
576 case LEFTFIELD_GENRE:
577 return "Leftfield\0";
578 case LOUNGE_GENRE:
579 return "Lounge\0";
580 case MATH_ROCK_GENRE:
581 return "Math Rock\0";
582 case NEW_ROMANTIC_GENRE:
583 return "New Romantic\0";
584 case NU_BREAKZ_GENRE:
585 return "Nu-Breakz\0";
586 case POST_PUNK_GENRE:
587 return "Post-Punk\0";
588 case POST_ROCK_GENRE:
589 return "Post-Rock\0";
590 case PSYTRANCE_GENRE:
591 return "Psytrance\0";
592 case SHOEGAZE_GENRE:
593 return "Shoegaze\0";
594 case SPACE_ROCK_GENRE:
595 return "Space Rock\0";
596 case TROP_ROCK_GENRE:
597 return "Trop Rock\0";
598 case WORLD_MUSIC_GENRE:
599 return "World Music\0";
600 case NEOCLASSICAL_GENRE:
601 return "Neoclassical\0";
602 case AUDIOBOOK_GENRE:
603 return "Audiobook\0";
604 case AUDIO_THEATRE_GENRE:
605 return "Audio Theatre\0";
606 case NEUE_DEUTSCHE_WELLE_GENRE:
607 return "Neue Deutsche Welle\0";
608 case PODCAST_GENRE:
609 return "Podcast\0";
610 case INDIE_ROCK_GENRE:
611 return "Indie-Rock\0";
612 case G_FUNK_GENRE:
613 return "G-Funk\0";
614 case DUBSTEP_GENRE:
615 return "Dubstep\0";
616 case GARAGE_ROCK_GENRE:
617 return "Garage Rock\0";
618 case PSYBIENT_GENRE:
619 return "Psybient\0";
620 default:
621 break;
622 }
623 //191 supported genres god this enum is huge
624 return "Other\0";
625}
626
633 char *id3v1ReadTitle(const Id3v1Tag *tag) {
634 char *r = calloc(sizeof(char), ID3V1_FIELD_SIZE + 1);
635 memcpy(r, tag->title, ID3V1_FIELD_SIZE);
636 return r;
637}
638
645 char *id3v1ReadArtist(const Id3v1Tag *tag) {
646 char *r = calloc(sizeof(char), ID3V1_FIELD_SIZE + 1);
647 memcpy(r, tag->artist, ID3V1_FIELD_SIZE);
648 return r;
649}
650
657 char *id3v1ReadAlbum(const Id3v1Tag *tag) {
658 char *r = calloc(sizeof(char), ID3V1_FIELD_SIZE + 1);
659 memcpy(r, tag->albumTitle, ID3V1_FIELD_SIZE);
660 return r;
661}
662
669 int id3v1ReadYear(const Id3v1Tag *tag) {
670 return tag->year;
671}
672
679 char *id3v1ReadComment(const Id3v1Tag *tag) {
680 char *r = calloc(sizeof(char), ID3V1_FIELD_SIZE + 1);
681 memcpy(r, tag->comment, ID3V1_FIELD_SIZE);
682 return r;
683}
684
691 Genre id3v1ReadGenre(const Id3v1Tag *tag) {
692 return tag->genre;
693}
694
701 int id3v1ReadTrack(const Id3v1Tag *tag) {
702 return tag->track;
703}
704
713 char *id3v1ToJSON(const Id3v1Tag *tag) {
714 char *json = NULL;
715 int memCount = 3;
716
717 if (tag == NULL) {
718 json = calloc(memCount, sizeof(char));
719 memcpy(json, "{}\0", memCount);
720 return json;
721 }
722
723 memCount += snprintf(
724 NULL, 0,
725 "{\"title\":\"%s\",\"artist\":\"%s\",\"album\":\"%s\",\"year\":%d,\"track\":%d,\"comment\":\"%s\",\"genreNumber\":%d,\"genre\":\"%s\"}",
726 (char *) tag->title,
727 (char *) tag->artist,
728 (char *) tag->albumTitle,
729 tag->year,
730 tag->track,
731 (char *) tag->comment,
732 tag->genre,
733 id3v1GenreFromTable(tag->genre));
734
735 json = calloc(memCount + 1, sizeof(char));
736 (void) snprintf(json, memCount,
737 "{\"title\":\"%s\",\"artist\":\"%s\",\"album\":\"%s\",\"year\":%d,\"track\":%d,\"comment\":\"%s\",\"genreNumber\":%d,\"genre\":\"%s\"}",
738 (char *) tag->title,
739 (char *) tag->artist,
740 (char *) tag->albumTitle,
741 tag->year,
742 tag->track,
743 (char *) tag->comment,
744 tag->genre,
745 id3v1GenreFromTable(tag->genre));
746
747
748 return json;
749}
750
759 int id3v1WriteTagToFile(const char *filePath, const Id3v1Tag *tag) {
760 if (filePath == NULL || tag == NULL) {
761 return 0;
762 }
763
764 char *tmp = NULL;
765 unsigned char byte = 0x00;
766 int n = 0;
767 int yearW = 0;
768 FILE *fp = NULL;
769 ByteStream *stream = byteStreamCreate(NULL, ID3V1_MAX_SIZE);
770
771 byteStreamWrite(stream, (unsigned char *) "TAG", ID3V1_TAG_ID_SIZE);
772 byteStreamWrite(stream, (unsigned char *) tag->title, ID3V1_FIELD_SIZE);
773 byteStreamWrite(stream, (unsigned char *) tag->artist, ID3V1_FIELD_SIZE);
774 byteStreamWrite(stream, (unsigned char *) tag->albumTitle, ID3V1_FIELD_SIZE);
775
776 //int to string
777 n = (int) log10(tag->year) + 1;
778 yearW = tag->year;
779 tmp = calloc(n, sizeof(char));
780
781 for (int i = n - 1; i >= 0; --i, yearW /= 10) {
782 tmp[i] = (char) ((yearW % 10) + '0');
783 }
784
785 //write convert
786 byteStreamWrite(stream, (unsigned char *) tmp, ID3V1_YEAR_SIZE);
787 free(tmp);
788
789 byteStreamWrite(stream, (unsigned char *) tag->comment, ID3V1_FIELD_SIZE);
790
791 //track is one byte but an int can be more so clamp it
792 if (tag->track <= 0xFF && tag->track > 0x00) {
793 byteStreamSeek(stream, -1, SEEK_CUR);
794 byte = (unsigned char) tag->track & 0xFF;
795 byteStreamWrite(stream, &byte, 1);
796 }
797
798 //genere is one byte as well
799 byte = (unsigned char) tag->genre & 0xFF;
800 byteStreamWrite(stream, &byte, 1);
801
802 byteStreamRewind(stream);
803
804 fp = fopen(filePath, "r+b");
805 if (fp == NULL) {
806 //create a new file and write the bytes to it
807 fp = fopen(filePath, "wb");
808 if (fp == NULL) {
809 byteStreamDestroy(stream);
810 return 0;
811 }
812
813 if ((fwrite(byteStreamCursor(stream), 1, ID3V1_MAX_SIZE, fp)) == 0) {
814 byteStreamDestroy(stream);
815 (void) fclose(fp);
816 return 0;
817 }
818 } else {
819 //get file size
820 (void) fseek(fp, 0, SEEK_END);
821 const long index = ftell(fp);
822 unsigned char buffer[ID3V1_MAX_SIZE];
823
824 //seek to tag start
825 //if the file is less than 128 bytes then we can catch that here.
826 //there will be no tag due to size or if there is its corrupt and
827 //will be treated as regular file data and skipped over.
828 if ((fseek(fp, index - ID3V1_MAX_SIZE, SEEK_SET)) != 0) {
829 (void) fseek(fp, 0, SEEK_END);
830 if (fwrite(byteStreamCursor(stream), 1, ID3V1_MAX_SIZE, fp) != 0) {
831 byteStreamDestroy(stream);
832 (void) fclose(fp);
833 return 1;
834 }
835
836 byteStreamDestroy(stream);
837 (void) fclose(fp);
838 return 0;
839 }
840
841 //check to see if the file has ID3 metadata
842 if (fread(buffer, 1, ID3V1_TAG_ID_SIZE, fp) == 0) {
843 byteStreamDestroy(stream);
844 (void) fclose(fp);
845 return 0;
846 }
847
848 //coupled not find 'TAG'
849 if (!id3v1HasTag((uint8_t *) buffer)) {
850 if (fseek(fp, 0, SEEK_END) != 0) {
851 byteStreamDestroy(stream);
852 (void) fclose(fp);
853 return 0;
854 }
855 } else {
856 if (fseek(fp, index - ID3V1_MAX_SIZE, SEEK_SET) != 0) {
857 byteStreamDestroy(stream);
858 (void) fclose(fp);
859 return 0;
860 }
861 }
862
863 //write bytes to the file at the right position
864 if ((fwrite(byteStreamCursor(stream), 1, ID3V1_MAX_SIZE, fp)) == 0) {
865 byteStreamDestroy(stream);
866 (void) fclose(fp);
867 return 0;
868 }
869 }
870
871 byteStreamDestroy(stream);
872 (void) fclose(fp);
873 return 1;
874}
id3v1CopyTag
Id3v1Tag * id3v1CopyTag(Id3v1Tag *toCopy)
Creates a deep copy of an Id3v1Tag structure.
Definition id3v1.c:64
id3v1ReadComment
char * id3v1ReadComment(const Id3v1Tag *tag)
Reads the comment member from an Id3v1Tag.
Definition id3v1.c:679
id3v1ReadTrack
int id3v1ReadTrack(const Id3v1Tag *tag)
Reads a track number from a tag.
Definition id3v1.c:701
id3v1GenreFromTable
char * id3v1GenreFromTable(Genre val)
Converts a Genre enum value to it's string representation.
Definition id3v1.c:235
id3v1WriteArtist
int id3v1WriteArtist(const char *artist, Id3v1Tag *tag)
Writes an artist to an Id3v1Tag.
Definition id3v1.c:111
id3v1ReadArtist
char * id3v1ReadArtist(const Id3v1Tag *tag)
Reads the artist member from an Id3v1Tag.
Definition id3v1.c:645
id3v1WriteGenre
int id3v1WriteGenre(Genre genre, Id3v1Tag *tag)
Writes a Genre to an Id3v1Tag.
Definition id3v1.c:160
id3v1ReadGenre
Genre id3v1ReadGenre(const Id3v1Tag *tag)
Reads a Genre from a tag.
Definition id3v1.c:691
id3v1WriteTagToFile
int id3v1WriteTagToFile(const char *filePath, const Id3v1Tag *tag)
Writes/Overwrites an Id3v1Tag to the bottom of a file .
Definition id3v1.c:759
id3v1ToJSON
char * id3v1ToJSON(const Id3v1Tag *tag)
Converts an Id3v1Tag to a JSON string representation.
Definition id3v1.c:713
id3v1WriteComment
int id3v1WriteComment(const char *comment, Id3v1Tag *tag)
Writes a comment to an Id3v1Tag.
Definition id3v1.c:149
id3v1ReadTitle
char * id3v1ReadTitle(const Id3v1Tag *tag)
Reads the title member from an Id3v1Tag.
Definition id3v1.c:633
id3v1ReadYear
int id3v1ReadYear(const Id3v1Tag *tag)
Reads the year member from an Id3v1Tag.
Definition id3v1.c:669
id3v1WriteAlbum
int id3v1WriteAlbum(const char *album, Id3v1Tag *tag)
Writes an album to an Id3v1Tag.
Definition id3v1.c:122
id3v1WriteTitle
int id3v1WriteTitle(const char *title, Id3v1Tag *tag)
Writes a title to an Id3v1Tag.
Definition id3v1.c:100
id3v1TagFromFile
Id3v1Tag * id3v1TagFromFile(const char *filePath)
Creates an Id3v1Tag from a provided file path.
Definition id3v1.c:29
id3v1WriteTrack
int id3v1WriteTrack(int track, Id3v1Tag *tag)
Writes a track number to an Id3v1Tag.
Definition id3v1.c:176
id3v1WriteYear
int id3v1WriteYear(int year, Id3v1Tag *tag)
Writes a year to an Id3v1Tag.
Definition id3v1.c:133
id3v1CompareTag
bool id3v1CompareTag(const Id3v1Tag *tag1, const Id3v1Tag *tag2)
Compares two Id3v1Tag structures for equality.
Definition id3v1.c:192
id3v1ReadAlbum
char * id3v1ReadAlbum(const Id3v1Tag *tag)
Reads the album member from an Id3v1Tag.
Definition id3v1.c:657
id3v1.h
id3v1GenreFromTable
char * id3v1GenreFromTable(Genre val)
Converts a Genre enum value to it's string representation.
Definition id3v1.c:235
id3v1Parser.h
id3v1TagFromBuffer
Id3v1Tag * id3v1TagFromBuffer(uint8_t *buffer)
Parses an ID3V1_MAX_SIZE buffer into an Id3v1Tag structure.
Definition id3v1Parser.c:119
id3v1HasTag
bool id3v1HasTag(const uint8_t *buffer)
Checks if a buffer contains a valid ID3v1 tag identifier.
Definition id3v1Parser.c:25
id3v1CreateTag
Id3v1Tag * id3v1CreateTag(uint8_t *title, uint8_t *artist, uint8_t *albumTitle, int year, int track, uint8_t *comment, Genre genre)
Creates and allocates a new Id3v1Tag structure.
Definition id3v1Parser.c:41
ID3V1_YEAR_SIZE
#define ID3V1_YEAR_SIZE
Size in bytes of the year field in ID3v1 tags (4 bytes)
Definition id3v1Types.h:25
ID3V1_MAX_SIZE
#define ID3V1_MAX_SIZE
Total size in bytes of a complete ID3v1/ID3v1.1 tag on disk (128 bytes)
Definition id3v1Types.h:31
ID3V1_FIELD_SIZE
#define ID3V1_FIELD_SIZE
Size in bytes of text fields (title, artist, album, comment) in ID3v1 tags (30 bytes)
Definition id3v1Types.h:28
DUB_GENRE
@ DUB_GENRE
Dub Audio.
Definition id3v1Types.h:358
SPACE_GENRE
@ SPACE_GENRE
Space Audio.
Definition id3v1Types.h:132
TECHNO_INDUSTRIAL_GENRE
@ TECHNO_INDUSTRIAL_GENRE
Techno Industrial Audio.
Definition id3v1Types.h:146
GOSPEL_GENRE
@ GOSPEL_GENRE
Gospel Audio.
Definition id3v1Types.h:120
DRUM_AND_BASS_GENRE
@ DRUM_AND_BASS_GENRE
Drum and Bass Audio.
Definition id3v1Types.h:298
FOLKLORE_GENRE
@ FOLKLORE_GENRE
Folklore Audio.
Definition id3v1Types.h:274
RAP_GENRE
@ RAP_GENRE
Rap Audio.
Definition id3v1Types.h:74
CHAMBER_MUSIC_GENRE
@ CHAMBER_MUSIC_GENRE
Chamber Audio.
Definition id3v1Types.h:252
ECLECTIC_GENRE
@ ECLECTIC_GENRE
Eclectic Audio.
Definition id3v1Types.h:362
REVIVAL_GENRE
@ REVIVAL_GENRE
Revival Audio.
Definition id3v1Types.h:218
PUNK_GENRE
@ PUNK_GENRE
Punk Audio.
Definition id3v1Types.h:130
WORLD_MUSIC_GENRE
@ WORLD_MUSIC_GENRE
World Music Audio.
Definition id3v1Types.h:408
DANCE_GENRE
@ DANCE_GENRE
Dance Audio.
Definition id3v1Types.h:50
HOUSE_GENRE
@ HOUSE_GENRE
House Audio.
Definition id3v1Types.h:114
JPOP_GENRE
@ JPOP_GENRE
Japanese Pop Audio.
Definition id3v1Types.h:336
CULT_GENRE
@ CULT_GENRE
Cult Audio.
Definition id3v1Types.h:160
TROP_ROCK_GENRE
@ TROP_ROCK_GENRE
Trop Rock Audio.
Definition id3v1Types.h:406
CHRISTIAN_ROCK_GENRE
@ CHRISTIAN_ROCK_GENRE
Christian Rock Audio.
Definition id3v1Types.h:326
FUNK_GENRE
@ FUNK_GENRE
Funk Audio.
Definition id3v1Types.h:54
ANIME_GENRE
@ ANIME_GENRE
Anime Audio.
Definition id3v1Types.h:334
DOWNTEMPO_GENRE
@ DOWNTEMPO_GENRE
Down tempo Audio.
Definition id3v1Types.h:356
CLASSICAL_GENRE
@ CLASSICAL_GENRE
Classical Audio.
Definition id3v1Types.h:108
KRAUTROCK_GENRE
@ KRAUTROCK_GENRE
Krautrock Audio.
Definition id3v1Types.h:384
MERENGUE_GENRE
@ MERENGUE_GENRE
Merengue Audio.
Definition id3v1Types.h:328
MUSICAL_GENRE
@ MUSICAL_GENRE
Audio from Musicals.
Definition id3v1Types.h:198
OTHER_GENRE
@ OTHER_GENRE
Other Music Genres not Defined.
Definition id3v1Types.h:68
DUBSTEP_GENRE
@ DUBSTEP_GENRE
Dubstep Audio.
Definition id3v1Types.h:424
JAZZ_AND_FUNK_GENRE
@ JAZZ_AND_FUNK_GENRE
Jazz and Funk Audio.
Definition id3v1Types.h:102
NEGERPUNK_GENRE
@ NEGERPUNK_GENRE
Neger Punk Audio.
Definition id3v1Types.h:310
PORN_GROOVE_GENRE
@ PORN_GROOVE_GENRE
Porn Groove Audio.
Definition id3v1Types.h:262
DRUM_SOLO_GENRE
@ DRUM_SOLO_GENRE
Drum Solo Audio.
Definition id3v1Types.h:288
SHOWTUNES_GENRE
@ SHOWTUNES_GENRE
Theatre Show Tunes Audio.
Definition id3v1Types.h:182
NATIVE_US_GENRE
@ NATIVE_US_GENRE
Native Audio.
Definition id3v1Types.h:172
SWING_GENRE
@ SWING_GENRE
Swing Audio.
Definition id3v1Types.h:210
INDUSTRO_GOTH_GENRE
@ INDUSTRO_GOTH_GENRE
Industro Goth Audio.
Definition id3v1Types.h:380
GOTHIC_ROCK_GENRE
@ GOTHIC_ROCK_GENRE
Gothic Rock Audio.
Definition id3v1Types.h:226
AMBIENT_GENRE
@ AMBIENT_GENRE
Ambient Audio.
Definition id3v1Types.h:96
TRIBAL_GENRE
@ TRIBAL_GENRE
Tribal Audio.
Definition id3v1Types.h:188
SYNTHPOP_GENRE
@ SYNTHPOP_GENRE
Synth Pop Audio.
Definition id3v1Types.h:338
ROCKNROLL_GENRE
@ ROCKNROLL_GENRE
Rock and Roll Audio.
Definition id3v1Types.h:200
EXPERIMENTAL_GENRE
@ EXPERIMENTAL_GENRE
Experimental Audio.
Definition id3v1Types.h:370
GLOBAL_GENRE
@ GLOBAL_GENRE
Global Audio.
Definition id3v1Types.h:374
NEUE_DEUTSCHE_WELLE_GENRE
@ NEUE_DEUTSCHE_WELLE_GENRE
Neue Deutsche Welle Audio.
Definition id3v1Types.h:416
PSYCHEDELIC_GENRE
@ PSYCHEDELIC_GENRE
Psychedelic Audio.
Definition id3v1Types.h:178
BIG_BEAT_GENRE
@ BIG_BEAT_GENRE
Big Beat Audio.
Definition id3v1Types.h:350
SAMBA_GENRE
@ SAMBA_GENRE
Samba Audio.
Definition id3v1Types.h:272
ETHNIC_GENRE
@ ETHNIC_GENRE
Ethnic Audio.
Definition id3v1Types.h:140
SALSA_GENRE
@ SALSA_GENRE
Salsa Audio.
Definition id3v1Types.h:330
SYMPHONY_GENRE
@ SYMPHONY_GENRE
Symphony Audio.
Definition id3v1Types.h:256
LO_FI_GENRE
@ LO_FI_GENRE
Lo-Fi Audio.
Definition id3v1Types.h:186
ELECTRONIC_GENRE
@ ELECTRONIC_GENRE
Electronic Audio.
Definition id3v1Types.h:148
PROGRESSIVE_ROCK_GENRE
@ PROGRESSIVE_ROCK_GENRE
Progressive Audio.
Definition id3v1Types.h:228
GARAGE_ROCK_GENRE
@ GARAGE_ROCK_GENRE
Garage Rock Audio.
Definition id3v1Types.h:426
GARAGE_GENRE
@ GARAGE_GENRE
Garage Audio.
Definition id3v1Types.h:372
NOISE_GENRE
@ NOISE_GENRE
Noise Audio.
Definition id3v1Types.h:122
SONATA_GENRE
@ SONATA_GENRE
Sonata Audio.
Definition id3v1Types.h:254
EURO_TECHNO_GENRE
@ EURO_TECHNO_GENRE
European Techno Audio.
Definition id3v1Types.h:94
CHANSON_GENRE
@ CHANSON_GENRE
Chanson Audio.
Definition id3v1Types.h:248
JAZZ_GENRE
@ JAZZ_GENRE
Jazz Audio.
Definition id3v1Types.h:60
ELECTROCLASH_GENRE
@ ELECTROCLASH_GENRE
Electro Clash Audio.
Definition id3v1Types.h:366
CELTIC_GENRE
@ CELTIC_GENRE
Celtic Audio.
Definition id3v1Types.h:220
DUET_GENRE
@ DUET_GENRE
Duet Audio.
Definition id3v1Types.h:284
HARDCORE_TECHNO_GENRE
@ HARDCORE_TECHNO_GENRE
Hardcore Techno Audio.
Definition id3v1Types.h:302
ACID_PUNK_GENRE
@ ACID_PUNK_GENRE
Acid Punk Audio.
Definition id3v1Types.h:190
BEAT_GENRE
@ BEAT_GENRE
Beat Audio.
Definition id3v1Types.h:314
BLACK_METAL_GENRE
@ BLACK_METAL_GENRE
Black Metal Audio.
Definition id3v1Types.h:320
CROSSOVER_GENRE
@ CROSSOVER_GENRE
Crossover Audio.
Definition id3v1Types.h:322
CHORUS_GENRE
@ CHORUS_GENRE
Chorus Audio.
Definition id3v1Types.h:238
DANCE_HALL_GENRE
@ DANCE_HALL_GENRE
Dance Hall Audio.
Definition id3v1Types.h:294
BLUEGRASS_GENRE
@ BLUEGRASS_GENRE
Blue Grass Audio.
Definition id3v1Types.h:222
BAROQUE_GENRE
@ BAROQUE_GENRE
Baroque Audio.
Definition id3v1Types.h:346
POP_GENRE
@ POP_GENRE
Pop Audio.
Definition id3v1Types.h:70
INSTRUMENTAL_GENRE
@ INSTRUMENTAL_GENRE
Instrumental Audio.
Definition id3v1Types.h:110
POST_PUNK_GENRE
@ POST_PUNK_GENRE
Post Punk Audio.
Definition id3v1Types.h:396
BALLAD_GENRE
@ BALLAD_GENRE
Ballad Audio.
Definition id3v1Types.h:276
EASY_LISTENING_GENRE
@ EASY_LISTENING_GENRE
Easy Listening Audio.
Definition id3v1Types.h:240
NEW_WAVE_GENRE
@ NEW_WAVE_GENRE
New Wave Audio.
Definition id3v1Types.h:176
GOTHIC_GENRE
@ GOTHIC_GENRE
Gothic Audio.
Definition id3v1Types.h:142
TRANCE_GENRE
@ TRANCE_GENRE
Trance Audio.
Definition id3v1Types.h:106
PRANKS_GENRE
@ PRANKS_GENRE
Pranks Audio.
Definition id3v1Types.h:90
RHYTHMIC_SOUL_GENRE
@ RHYTHMIC_SOUL_GENRE
Rhythmic Soul Audio.
Definition id3v1Types.h:280
POP_FOLK_GENRE
@ POP_FOLK_GENRE
Pop Folk Audio.
Definition id3v1Types.h:150
INSTRUMENTAL_POP_GENRE
@ INSTRUMENTAL_POP_GENRE
Instrumental Pop Audio.
Definition id3v1Types.h:136
BRITPOP_GENRE
@ BRITPOP_GENRE
Britpop Audio.
Definition id3v1Types.h:308
CLUB_HOUSE_GENRE
@ CLUB_HOUSE_GENRE
Club House Audio.
Definition id3v1Types.h:300
NEOCLASSICAL_GENRE
@ NEOCLASSICAL_GENRE
Neo Classical Audio.
Definition id3v1Types.h:410
AUDIOBOOK_GENRE
@ AUDIOBOOK_GENRE
Audio Book.
Definition id3v1Types.h:412
G_FUNK_GENRE
@ G_FUNK_GENRE
G-Funk Audio.
Definition id3v1Types.h:422
BREAKBEAT_GENRE
@ BREAKBEAT_GENRE
Beark Beat Audio.
Definition id3v1Types.h:352
PSYTRANCE_GENRE
@ PSYTRANCE_GENRE
Psytrance Audio.
Definition id3v1Types.h:400
POLKA_GENRE
@ POLKA_GENRE
Polka Audio.
Definition id3v1Types.h:194
DARKWAVE_GENRE
@ DARKWAVE_GENRE
Darkwave Audio.
Definition id3v1Types.h:144
ILLBIENT_GENRE
@ ILLBIENT_GENRE
Illbient Audio.
Definition id3v1Types.h:378
HARD_ROCK_GENRE
@ HARD_ROCK_GENRE
Hard Rock Audio.
Definition id3v1Types.h:202
CHRISTIAN_RAP_GENRE
@ CHRISTIAN_RAP_GENRE
Christian Rap Audio.
Definition id3v1Types.h:166
SPEECH_GENRE
@ SPEECH_GENRE
Speech Audio.
Definition id3v1Types.h:246
INDIE_ROCK_GENRE
@ INDIE_ROCK_GENRE
Indie Rock Audio.
Definition id3v1Types.h:420
MATH_ROCK_GENRE
@ MATH_ROCK_GENRE
Math Rock Audio.
Definition id3v1Types.h:390
ACOUSTIC_GENRE
@ ACOUSTIC_GENRE
Acoustic Audio.
Definition id3v1Types.h:242
FAST_FUSION_GENRE
@ FAST_FUSION_GENRE
Fast Fusion Audio.
Definition id3v1Types.h:212
HEAVY_METAL_GENRE
@ HEAVY_METAL_GENRE
Heavy Metal Audio.
Definition id3v1Types.h:318
PRIMUS_GENRE
@ PRIMUS_GENRE
Primus Audio.
Definition id3v1Types.h:260
SOUNDTRACK_GENRE
@ SOUNDTRACK_GENRE
Soundtracks and OSTs from other media.
Definition id3v1Types.h:92
ACID_GENRE
@ ACID_GENRE
Acid Audio.
Definition id3v1Types.h:112
FREESTYLE_GENRE
@ FREESTYLE_GENRE
Free Style Audio.
Definition id3v1Types.h:282
LATIN_GENRE
@ LATIN_GENRE
Latin Audio.
Definition id3v1Types.h:216
ACID_JAZZ_GENRE
@ ACID_JAZZ_GENRE
Acid Jazz Audio.
Definition id3v1Types.h:192
SKA_GENRE
@ SKA_GENRE
Ska Audio.
Definition id3v1Types.h:86
TERROR_GENRE
@ TERROR_GENRE
Terror Audio.
Definition id3v1Types.h:304
ART_ROCK_GENRE
@ ART_ROCK_GENRE
Art Rock Audio.
Definition id3v1Types.h:344
RHYTHM_AND_BLUES_GENRE
@ RHYTHM_AND_BLUES_GENRE
Rythem and Blues Audio.
Definition id3v1Types.h:72
TOP_40_GENRE
@ TOP_40_GENRE
Top 40 Chart Hits.
Definition id3v1Types.h:164
ALTERNATIVE_GENRE
@ ALTERNATIVE_GENRE
Alternative Audio.
Definition id3v1Types.h:84
A_CAPPELLA_GENRE
@ A_CAPPELLA_GENRE
Acappella Audio.
Definition id3v1Types.h:290
COMEDY_GENRE
@ COMEDY_GENRE
Comedy Audio.
Definition id3v1Types.h:158
COUNTRY_GENRE
@ COUNTRY_GENRE
Country Audio.
Definition id3v1Types.h:48
GRUNGE_GENRE
@ GRUNGE_GENRE
Grunge Audio.
Definition id3v1Types.h:56
PSYCHEDELIC_ROCK_GENRE
@ PSYCHEDELIC_ROCK_GENRE
Psychedelic Audio.
Definition id3v1Types.h:230
JUNGLE_MUSIC_GENRE
@ JUNGLE_MUSIC_GENRE
Jungle Audio.
Definition id3v1Types.h:170
LEFTFIELD_GENRE
@ LEFTFIELD_GENRE
LeftField Audio.
Definition id3v1Types.h:386
INSTRUMENTAL_ROCK_GENRE
@ INSTRUMENTAL_ROCK_GENRE
Instrumental Rock Audio.
Definition id3v1Types.h:138
NEW_AGE_GENRE
@ NEW_AGE_GENRE
New Age Audio.
Definition id3v1Types.h:64
NU_BREAKZ_GENRE
@ NU_BREAKZ_GENRE
Nu-Breakz Audio.
Definition id3v1Types.h:394
SPACE_ROCK_GENRE
@ SPACE_ROCK_GENRE
Space Rock Audio.
Definition id3v1Types.h:404
REGGAE_GENRE
@ REGGAE_GENRE
Reggae Audio.
Definition id3v1Types.h:76
BASS_GENRE
@ BASS_GENRE
Bass Audio.
Definition id3v1Types.h:126
OLDIES_GENRE
@ OLDIES_GENRE
Oldies Music, pre-1950s.
Definition id3v1Types.h:66
SATIRE_GENRE
@ SATIRE_GENRE
Satire Audio.
Definition id3v1Types.h:264
TECHNO_GENRE
@ TECHNO_GENRE
Techno Audio.
Definition id3v1Types.h:80
PODCAST_GENRE
@ PODCAST_GENRE
Podcast Audio.
Definition id3v1Types.h:418
ALTERNATIVE_ROCK_GENRE
@ ALTERNATIVE_ROCK_GENRE
Alternative Rock Audio.
Definition id3v1Types.h:124
BEBOP_GENRE
@ BEBOP_GENRE
Bebop Audio.
Definition id3v1Types.h:214
TRAILER_GENRE
@ TRAILER_GENRE
Audio From Media Trailers.
Definition id3v1Types.h:184
IDM_GENRE
@ IDM_GENRE
IDM Audio.
Definition id3v1Types.h:376
INDUSTRIAL_GENRE
@ INDUSTRIAL_GENRE
Industrial Audio.
Definition id3v1Types.h:82
EURO_HOUSE_GENRE
@ EURO_HOUSE_GENRE
European House Audio.
Definition id3v1Types.h:292
POWER_BALLAD_GENRE
@ POWER_BALLAD_GENRE
Power Ballad Audio.
Definition id3v1Types.h:278
NEW_ROMANTIC_GENRE
@ NEW_ROMANTIC_GENRE
New Romantic Audio.
Definition id3v1Types.h:392
RETRO_GENRE
@ RETRO_GENRE
Retro Audio.
Definition id3v1Types.h:196
HIP_HOP_GENRE
@ HIP_HOP_GENRE
Hip-Hop Audio.
Definition id3v1Types.h:58
CLUB_GENRE
@ CLUB_GENRE
Club Audio.
Definition id3v1Types.h:268
RAVE_GENRE
@ RAVE_GENRE
Rave Audio.
Definition id3v1Types.h:180
CLASSIC_ROCK_GENRE
@ CLASSIC_ROCK_GENRE
Classic Rock.
Definition id3v1Types.h:46
DEATH_METAL_GENRE
@ DEATH_METAL_GENRE
Death Metal Audio.
Definition id3v1Types.h:88
FUSION_GENRE
@ FUSION_GENRE
Fusion of Genres.
Definition id3v1Types.h:104
DISCO_GENRE
@ DISCO_GENRE
Disco Audio.
Definition id3v1Types.h:52
JAM_BAND_GENRE
@ JAM_BAND_GENRE
Jam Band Audio.
Definition id3v1Types.h:382
SOUL_GENRE
@ SOUL_GENRE
Soul Audio.
Definition id3v1Types.h:128
HUMOUR_GENRE
@ HUMOUR_GENRE
Humour Audio.
Definition id3v1Types.h:244
GAME_GENRE
@ GAME_GENRE
Video Game Audio.
Definition id3v1Types.h:116
SLOW_JAM_GENRE
@ SLOW_JAM_GENRE
Slow Jam Audio.
Definition id3v1Types.h:266
SYMPHONIC_ROCK_GENRE
@ SYMPHONIC_ROCK_GENRE
Symphonic Rock Audio.
Definition id3v1Types.h:232
CHILLOUT_GENRE
@ CHILLOUT_GENRE
Chillout Audio.
Definition id3v1Types.h:354
POP_FUNK_GENRE
@ POP_FUNK_GENRE
Funk Pop Audio.
Definition id3v1Types.h:168
SOUND_CLIP_GENRE
@ SOUND_CLIP_GENRE
Sound Clip Audio.
Definition id3v1Types.h:118
TRIP_HOP_GENRE
@ TRIP_HOP_GENRE
Trip Audio.
Definition id3v1Types.h:98
VOCAL_GENRE
@ VOCAL_GENRE
Vocal Audio.
Definition id3v1Types.h:100
MEDITATIVE_GENRE
@ MEDITATIVE_GENRE
Meditative Audio.
Definition id3v1Types.h:134
EBM_GENRE
@ EBM_GENRE
EBM Audio.
Definition id3v1Types.h:360
SHOEGAZE_GENRE
@ SHOEGAZE_GENRE
Shoegaze Audio.
Definition id3v1Types.h:402
SOUTHERN_ROCK_GENRE
@ SOUTHERN_ROCK_GENRE
Southern Rock Audio.
Definition id3v1Types.h:156
POLSK_PUNK_GENRE
@ POLSK_PUNK_GENRE
Polsk Punk Audio.
Definition id3v1Types.h:312
AVANTGARDE_GENRE
@ AVANTGARDE_GENRE
Avantgarde Audio.
Definition id3v1Types.h:224
FOLK_ROCK_GENRE
@ FOLK_ROCK_GENRE
Folk Rock Audio.
Definition id3v1Types.h:206
OPERA_GENRE
@ OPERA_GENRE
Opera Audio.
Definition id3v1Types.h:250
FOLK_GENRE
@ FOLK_GENRE
Folk Audio.
Definition id3v1Types.h:204
SLOW_ROCK_GENRE
@ SLOW_ROCK_GENRE
Slow Rock Audio.
Definition id3v1Types.h:234
GOA_MUSIC_GENRE
@ GOA_MUSIC_GENRE
GOA Audio.
Definition id3v1Types.h:296
CONTEMPORARY_CHRISTIAN_GENRE
@ CONTEMPORARY_CHRISTIAN_GENRE
Contemporary Christian Audio.
Definition id3v1Types.h:324
PUNK_ROCK_GENRE
@ PUNK_ROCK_GENRE
Punk Rock Audio.
Definition id3v1Types.h:286
BOOTY_BASS_GENRE
@ BOOTY_BASS_GENRE
Booty Bass Audio.
Definition id3v1Types.h:258
ELECTRO_GENRE
@ ELECTRO_GENRE
Electro Audio.
Definition id3v1Types.h:364
THRASH_METAL_GENRE
@ THRASH_METAL_GENRE
Thrash Metal Audio.
Definition id3v1Types.h:332
EURODANCE_GENRE
@ EURODANCE_GENRE
European Dance Audio.
Definition id3v1Types.h:152
ABSTRACT_GENRE
@ ABSTRACT_GENRE
Abstract Audio.
Definition id3v1Types.h:342
DREAM_GENRE
@ DREAM_GENRE
Dream Audio.
Definition id3v1Types.h:154
EMO_GENRE
@ EMO_GENRE
EMO Audio.
Definition id3v1Types.h:368
CABARET_GENRE
@ CABARET_GENRE
Cabaret Audio.
Definition id3v1Types.h:174
CHRISTIAN_GANGSTA_RAP_GENRE
@ CHRISTIAN_GANGSTA_RAP_GENRE
Christian Gangsta Rap Audio.
Definition id3v1Types.h:316
INDIE_GENRE
@ INDIE_GENRE
Indie Audio.
Definition id3v1Types.h:306
GANGSTA_GENRE
@ GANGSTA_GENRE
Gangsta Audio.
Definition id3v1Types.h:162
LOUNGE_GENRE
@ LOUNGE_GENRE
Lounge Audio.
Definition id3v1Types.h:388
TANGO_GENRE
@ TANGO_GENRE
Tangp Audio.
Definition id3v1Types.h:270
POST_ROCK_GENRE
@ POST_ROCK_GENRE
Post Rock Audio.
Definition id3v1Types.h:398
BIG_BAND_GENRE
@ BIG_BAND_GENRE
Big Band Audio.
Definition id3v1Types.h:236
ROCK_GENRE
@ ROCK_GENRE
Rock Audio.
Definition id3v1Types.h:78
NATIONAL_FOLK_GENRE
@ NATIONAL_FOLK_GENRE
National Folk Audio.
Definition id3v1Types.h:208
BLUES_GENRE
@ BLUES_GENRE
Blues Audio.
Definition id3v1Types.h:44
PSYBIENT_GENRE
@ PSYBIENT_GENRE
Psybient Audio.
Definition id3v1Types.h:428
METAL_GENRE
@ METAL_GENRE
Metal Audio.
Definition id3v1Types.h:62
AUDIO_THEATRE_GENRE
@ AUDIO_THEATRE_GENRE
Audio Theatre.
Definition id3v1Types.h:414
ID3V1_TAG_ID_SIZE
#define ID3V1_TAG_ID_SIZE
Size in bytes of the ID3v1 tag identifier "TAG" (3 bytes)
Definition id3v1Types.h:22
Genre
enum _Genre Genre
ID3v1 genre enumeration with Winamp extensions (genres 0-191).
Id3v1Tag
struct _Id3v1Tag Id3v1Tag
ID3v1/ID3v1.1 tag structure containing all metadata fields.
_Id3v1Tag::track
int track
Track number (0 if not present, ID3v1.1 only)
Definition id3v1Types.h:451
_Id3v1Tag::genre
Genre genre
Genre value (0-191, maps to Genre enum)
Definition id3v1Types.h:457
_Id3v1Tag::artist
uint8_t artist[ID3V1_FIELD_SIZE]
Artist name (ID3V1_FIELD_SIZE bytes, null-padded)
Definition id3v1Types.h:442
_Id3v1Tag::comment
uint8_t comment[ID3V1_FIELD_SIZE]
Comment text (ID3V1_FIELD_SIZE bytes, null-padded; ID3V1_FIELD_SIZE - 2 bytes if track number present...
Definition id3v1Types.h:454
_Id3v1Tag::title
uint8_t title[ID3V1_FIELD_SIZE]
Song title (ID3V1_FIELD_SIZE bytes, null-padded)
Definition id3v1Types.h:439
_Id3v1Tag::year
int year
Release year (4-digit integer)
Definition id3v1Types.h:448
_Id3v1Tag::albumTitle
uint8_t albumTitle[ID3V1_FIELD_SIZE]
Album title (ID3V1_FIELD_SIZE bytes, null-padded)
Definition id3v1Types.h:445