home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Sound / LAME / src / id3tag.h < prev    next >
C/C++ Source or Header  |  2000-07-04  |  3KB  |  91 lines

  1. /*
  2.  * id3tag.h -- Interface to write ID3 version 1 and 2 tags.
  3.  *
  4.  * Copyright (C) 2000 Don Melton.
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the Free Software
  18.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  19.  */
  20.  
  21. #ifndef ID3TAG_H_
  22. #define ID3TAG_H_
  23.  
  24. #ifdef ID3TAG_INDEPENDENCE
  25. #include <stdio.h>
  26. #else
  27. #include "lame.h"
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. /* utility to obtain alphabetically sorted list of genre names with numbers */
  35. extern void id3tag_genre_list(void (*handler)(int, const char *, void *),
  36.     void *cookie);
  37.  
  38. #ifdef ID3TAG_INDEPENDENCE
  39. struct id3tag_spec
  40. {
  41.     /* private data members */
  42.     int flags;
  43.     const char *title;
  44.     const char *artist;
  45.     const char *album;
  46.     int year;
  47.     const char *comment;
  48.     int track;
  49.     int genre;
  50. };
  51. #endif
  52.  
  53. extern void id3tag_init(struct id3tag_spec *spec);
  54.  
  55. /* force addition of version 2 tag */
  56. extern void id3tag_add_v2(struct id3tag_spec *spec);
  57. /* add only a version 1 tag */
  58. extern void id3tag_v1_only(struct id3tag_spec *spec);
  59. /* add only a version 2 tag */
  60. extern void id3tag_v2_only(struct id3tag_spec *spec);
  61. /* pad version 1 tag with spaces instead of nulls */
  62. extern void id3tag_space_v1(struct id3tag_spec *spec);
  63. /* pad version 2 tag with extra 128 bytes */
  64. extern void id3tag_pad_v2(struct id3tag_spec *spec);
  65.  
  66. extern void id3tag_set_title(struct id3tag_spec *spec, const char *title);
  67. extern void id3tag_set_artist(struct id3tag_spec *spec, const char *artist);
  68. extern void id3tag_set_album(struct id3tag_spec *spec, const char *album);
  69. extern void id3tag_set_year(struct id3tag_spec *spec, const char *year);
  70. extern void id3tag_set_comment(struct id3tag_spec *spec, const char *comment);
  71. extern void id3tag_set_track(struct id3tag_spec *spec, const char *track);
  72.  
  73. /* return non-zero result if genre name or number is invalid */
  74. extern int id3tag_set_genre(struct id3tag_spec *spec, const char *genre);
  75.  
  76. /*
  77.  * NOTE: A version 2 tag will NOT be added unless one of the text fields won't
  78.  * fit in a version 1 tag (e.g. the title string is longer than 30 characters),
  79.  * or the "id3tag_add_v2" or "id3tag_v2_only" functions are used.
  80.  */
  81.  
  82. /* write tag into stream at current position */
  83. extern int id3tag_write_v2(struct id3tag_spec *spec, FILE *stream);
  84. extern int id3tag_write_v1(struct id3tag_spec *spec, FILE *stream);
  85.  
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89.  
  90. #endif
  91.