TagLib API Documentation

tag_c.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2003 by Scott Wheeler
00003     email                : wheeler@kde.org
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it  under the terms of the GNU Lesser General Public License version  *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_TAG_C
00023 #define TAGLIB_TAG_C
00024 
00025 /* Do not include this in the main TagLib documentation. */
00026 #ifndef DO_NOT_DOCUMENT
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 #ifndef BOOL
00033 #define BOOL int
00034 #endif
00035 
00036 /*******************************************************************************
00037  * [ TagLib C Binding ]
00038  *
00039  * This is an interface to TagLib's "simple" API, meaning that you can read and
00040  * modify media files in a generic, but not specialized way.  This is a rough
00041  * representation of TagLib::File and TagLib::Tag, for which the documentation
00042  * is somewhat more complete and worth consulting.
00043  *******************************************************************************/
00044 
00045 /*
00046  * These are used for type provide some type safety to the C API (as opposed to
00047  * using void *, but pointers to them are simply cast to the coresponding C++
00048  * types in the implementation.
00049  */
00050 
00051 typedef struct { int dummy; } TagLib_File;
00052 typedef struct { int dummy; } TagLib_Tag;
00053 typedef struct { int dummy; } TagLib_AudioProperties;
00054 
00060 void taglib_set_strings_unicode(BOOL unicode);
00061 
00068 void taglib_set_string_management_enabled(BOOL management);
00069 
00070 /*******************************************************************************
00071  * File API
00072  ******************************************************************************/
00073 
00074 typedef enum { TagLib_File_MPEG, TagLib_File_OggVorbis } TagLib_File_Type;
00075 
00080 TagLib_File *taglib_file_new(const char *filename);
00081 
00086 TagLib_File *taglib_file_new_type(const char *filename, TagLib_File_Type type);
00087 
00091 void taglib_file_free(TagLib_File *file);
00092 
00097 TagLib_Tag *taglib_file_tag(const TagLib_File *file);
00098 
00103 const TagLib_AudioProperties *taglib_file_audioproperties(const TagLib_File *file);
00104 
00108 void taglib_file_save(TagLib_File *file);
00109 
00110 /******************************************************************************
00111  * Tag API
00112  ******************************************************************************/
00113 
00120 char *taglib_tag_title(const TagLib_Tag *tag);
00121 
00128 char *taglib_tag_artist(const TagLib_Tag *tag);
00129 
00136 char *taglib_tag_album(const TagLib_Tag *tag);
00137 
00144 char *taglib_tag_comment(const TagLib_Tag *tag);
00145 
00152 char *taglib_tag_genre(const TagLib_Tag *tag);
00153 
00157 unsigned int taglib_tag_year(const TagLib_Tag *tag);
00158 
00162 unsigned int taglib_tag_track(const TagLib_Tag *tag);
00163 
00169 void taglib_tag_set_title(TagLib_Tag *tag, const char *title);
00170 
00176 void taglib_tag_set_artist(TagLib_Tag *tag, const char *artist);
00177 
00183 void taglib_tag_set_album(TagLib_Tag *tag, const char *album);
00184 
00190 void taglib_tag_set_comment(TagLib_Tag *tag, const char *comment);
00191 
00197 void taglib_tag_set_genre(TagLib_Tag *tag, const char *genre);
00198 
00202 void taglib_tag_set_year(TagLib_Tag *tag, unsigned int year);
00203 
00207 void taglib_tag_set_track(TagLib_Tag *tag, unsigned int track);
00208 
00212 void taglib_tag_free_strings();
00213 
00214 /******************************************************************************
00215  * Audio Properties API
00216  ******************************************************************************/
00217 
00221 int taglib_audioproperties_length(const TagLib_AudioProperties *audioProperties);
00222 
00226 int taglib_audioproperties_bitrate(const TagLib_AudioProperties *audioProperties);
00227 
00231 int taglib_audioproperties_samplerate(const TagLib_AudioProperties *audioProperties);
00232 
00236 int taglib_audioproperties_channels(const TagLib_AudioProperties *audioProperties);
00237 
00238 #ifdef __cplusplus
00239 }
00240 #endif
00241 #endif /* DO_NOT_DOCUMENT */
00242 #endif
KDE Logo
This file is part of the documentation for TagLib Version 1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jan 22 05:44:21 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003