Miam-Player  0.8.0
A nice music player
tag_c.h File Reference

Go to the source code of this file.

Classes

struct  TagLib_File
 
struct  TagLib_Tag
 
struct  TagLib_AudioProperties
 

Macros

#define TAGLIB_C_EXPORT
 
#define BOOL   int
 

Enumerations

enum  TagLib_File_Type {
  TagLib_File_MPEG, TagLib_File_OggVorbis, TagLib_File_FLAC, TagLib_File_MPC,
  TagLib_File_OggFlac, TagLib_File_WavPack, TagLib_File_Speex, TagLib_File_TrueAudio,
  TagLib_File_MP4, TagLib_File_ASF
}
 
enum  TagLib_ID3v2_Encoding { TagLib_ID3v2_Latin1, TagLib_ID3v2_UTF16, TagLib_ID3v2_UTF16BE, TagLib_ID3v2_UTF8 }
 

Functions

TAGLIB_C_EXPORT void taglib_set_strings_unicode (BOOL unicode)
 By default all strings coming into or out of TagLib's C API are in UTF8. More...
 
TAGLIB_C_EXPORT void taglib_set_string_management_enabled (BOOL management)
 TagLib can keep track of strings that are created when outputting tag values and clear them using taglib_tag_clear_strings(). More...
 
TAGLIB_C_EXPORT void taglib_free (void *pointer)
 Explicitly free a string returned from TagLib. More...
 
TAGLIB_C_EXPORT TagLib_Filetaglib_file_new (const char *filename)
 Creates a TagLib file based on filename. More...
 
TAGLIB_C_EXPORT TagLib_Filetaglib_file_new_type (const char *filename, TagLib_File_Type type)
 Creates a TagLib file based on filename. More...
 
TAGLIB_C_EXPORT void taglib_file_free (TagLib_File *file)
 Frees and closes the file. More...
 
TAGLIB_C_EXPORT BOOL taglib_file_is_valid (const TagLib_File *file)
 Returns true if the file is open and readable and valid information for the Tag and / or AudioProperties was found. More...
 
TAGLIB_C_EXPORT TagLib_Tagtaglib_file_tag (const TagLib_File *file)
 Returns a pointer to the tag associated with this file. More...
 
TAGLIB_C_EXPORT const TagLib_AudioPropertiestaglib_file_audioproperties (const TagLib_File *file)
 Returns a pointer to the audio properties associated with this file. More...
 
TAGLIB_C_EXPORT BOOL taglib_file_save (TagLib_File *file)
 Saves the file to disk. More...
 
TAGLIB_C_EXPORT char * taglib_tag_title (const TagLib_Tag *tag)
 Returns a string with this tag's title. More...
 
TAGLIB_C_EXPORT char * taglib_tag_artist (const TagLib_Tag *tag)
 Returns a string with this tag's artist. More...
 
TAGLIB_C_EXPORT char * taglib_tag_album (const TagLib_Tag *tag)
 Returns a string with this tag's album name. More...
 
TAGLIB_C_EXPORT char * taglib_tag_comment (const TagLib_Tag *tag)
 Returns a string with this tag's comment. More...
 
TAGLIB_C_EXPORT char * taglib_tag_genre (const TagLib_Tag *tag)
 Returns a string with this tag's genre. More...
 
TAGLIB_C_EXPORT unsigned int taglib_tag_year (const TagLib_Tag *tag)
 Returns the tag's year or 0 if year is not set. More...
 
TAGLIB_C_EXPORT unsigned int taglib_tag_track (const TagLib_Tag *tag)
 Returns the tag's track number or 0 if track number is not set. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_title (TagLib_Tag *tag, const char *title)
 Sets the tag's title. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_artist (TagLib_Tag *tag, const char *artist)
 Sets the tag's artist. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_album (TagLib_Tag *tag, const char *album)
 Sets the tag's album. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_comment (TagLib_Tag *tag, const char *comment)
 Sets the tag's comment. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_genre (TagLib_Tag *tag, const char *genre)
 Sets the tag's genre. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_year (TagLib_Tag *tag, unsigned int year)
 Sets the tag's year. More...
 
TAGLIB_C_EXPORT void taglib_tag_set_track (TagLib_Tag *tag, unsigned int track)
 Sets the tag's track number. More...
 
TAGLIB_C_EXPORT void taglib_tag_free_strings (void)
 Frees all of the strings that have been created by the tag. More...
 
TAGLIB_C_EXPORT int taglib_audioproperties_length (const TagLib_AudioProperties *audioProperties)
 Returns the length of the file in seconds. More...
 
TAGLIB_C_EXPORT int taglib_audioproperties_bitrate (const TagLib_AudioProperties *audioProperties)
 Returns the bitrate of the file in kb/s. More...
 
TAGLIB_C_EXPORT int taglib_audioproperties_samplerate (const TagLib_AudioProperties *audioProperties)
 Returns the sample rate of the file in Hz. More...
 
TAGLIB_C_EXPORT int taglib_audioproperties_channels (const TagLib_AudioProperties *audioProperties)
 Returns the number of channels in the audio stream. More...
 
TAGLIB_C_EXPORT void taglib_id3v2_set_default_text_encoding (TagLib_ID3v2_Encoding encoding)
 This sets the default encoding for ID3v2 frames that are written to tags. More...
 

Macro Definition Documentation

◆ BOOL

#define BOOL   int

◆ TAGLIB_C_EXPORT

#define TAGLIB_C_EXPORT

Enumeration Type Documentation

◆ TagLib_File_Type

Enumerator
TagLib_File_MPEG 
TagLib_File_OggVorbis 
TagLib_File_FLAC 
TagLib_File_MPC 
TagLib_File_OggFlac 
TagLib_File_WavPack 
TagLib_File_Speex 
TagLib_File_TrueAudio 
TagLib_File_MP4 
TagLib_File_ASF 

◆ TagLib_ID3v2_Encoding

Enumerator
TagLib_ID3v2_Latin1 
TagLib_ID3v2_UTF16 
TagLib_ID3v2_UTF16BE 
TagLib_ID3v2_UTF8 

Function Documentation

◆ taglib_audioproperties_bitrate()

TAGLIB_C_EXPORT int taglib_audioproperties_bitrate ( const TagLib_AudioProperties audioProperties)

Returns the bitrate of the file in kb/s.

◆ taglib_audioproperties_channels()

TAGLIB_C_EXPORT int taglib_audioproperties_channels ( const TagLib_AudioProperties audioProperties)

Returns the number of channels in the audio stream.

◆ taglib_audioproperties_length()

TAGLIB_C_EXPORT int taglib_audioproperties_length ( const TagLib_AudioProperties audioProperties)

Returns the length of the file in seconds.

◆ taglib_audioproperties_samplerate()

TAGLIB_C_EXPORT int taglib_audioproperties_samplerate ( const TagLib_AudioProperties audioProperties)

Returns the sample rate of the file in Hz.

◆ taglib_file_audioproperties()

TAGLIB_C_EXPORT const TagLib_AudioProperties* taglib_file_audioproperties ( const TagLib_File file)

Returns a pointer to the audio properties associated with this file.

This will be freed automatically when the file is freed.

◆ taglib_file_free()

TAGLIB_C_EXPORT void taglib_file_free ( TagLib_File file)

Frees and closes the file.

◆ taglib_file_is_valid()

TAGLIB_C_EXPORT BOOL taglib_file_is_valid ( const TagLib_File file)

Returns true if the file is open and readable and valid information for the Tag and / or AudioProperties was found.

◆ taglib_file_new()

TAGLIB_C_EXPORT TagLib_File* taglib_file_new ( const char *  filename)

Creates a TagLib file based on filename.

TagLib will try to guess the file type.

Returns
NULL if the file type cannot be determined or the file cannot be opened.

◆ taglib_file_new_type()

TAGLIB_C_EXPORT TagLib_File* taglib_file_new_type ( const char *  filename,
TagLib_File_Type  type 
)

Creates a TagLib file based on filename.

Rather than attempting to guess the type, it will use the one specified by type.

◆ taglib_file_save()

TAGLIB_C_EXPORT BOOL taglib_file_save ( TagLib_File file)

Saves the file to disk.

◆ taglib_file_tag()

TAGLIB_C_EXPORT TagLib_Tag* taglib_file_tag ( const TagLib_File file)

Returns a pointer to the tag associated with this file.

This will be freed automatically when the file is freed.

◆ taglib_free()

TAGLIB_C_EXPORT void taglib_free ( void *  pointer)

Explicitly free a string returned from TagLib.

◆ taglib_id3v2_set_default_text_encoding()

TAGLIB_C_EXPORT void taglib_id3v2_set_default_text_encoding ( TagLib_ID3v2_Encoding  encoding)

This sets the default encoding for ID3v2 frames that are written to tags.

◆ taglib_set_string_management_enabled()

TAGLIB_C_EXPORT void taglib_set_string_management_enabled ( BOOL  management)

TagLib can keep track of strings that are created when outputting tag values and clear them using taglib_tag_clear_strings().

This is enabled by default. However if you wish to do more fine grained management of strings, you can do so by setting management to FALSE.

◆ taglib_set_strings_unicode()

TAGLIB_C_EXPORT void taglib_set_strings_unicode ( BOOL  unicode)

By default all strings coming into or out of TagLib's C API are in UTF8.

However, it may be desirable for TagLib to operate on Latin1 (ISO-8859-1) strings in which case this should be set to FALSE.

◆ taglib_tag_album()

TAGLIB_C_EXPORT char* taglib_tag_album ( const TagLib_Tag tag)

Returns a string with this tag's album name.

Note
By default this string should be UTF8 encoded and its memory should be freed using taglib_tag_free_strings().

◆ taglib_tag_artist()

TAGLIB_C_EXPORT char* taglib_tag_artist ( const TagLib_Tag tag)

Returns a string with this tag's artist.

Note
By default this string should be UTF8 encoded and its memory should be freed using taglib_tag_free_strings().

◆ taglib_tag_comment()

TAGLIB_C_EXPORT char* taglib_tag_comment ( const TagLib_Tag tag)

Returns a string with this tag's comment.

Note
By default this string should be UTF8 encoded and its memory should be freed using taglib_tag_free_strings().

◆ taglib_tag_free_strings()

TAGLIB_C_EXPORT void taglib_tag_free_strings ( void  )

Frees all of the strings that have been created by the tag.

◆ taglib_tag_genre()

TAGLIB_C_EXPORT char* taglib_tag_genre ( const TagLib_Tag tag)

Returns a string with this tag's genre.

Note
By default this string should be UTF8 encoded and its memory should be freed using taglib_tag_free_strings().

◆ taglib_tag_set_album()

TAGLIB_C_EXPORT void taglib_tag_set_album ( TagLib_Tag tag,
const char *  album 
)

Sets the tag's album.

Note
By default this string should be UTF8 encoded.

◆ taglib_tag_set_artist()

TAGLIB_C_EXPORT void taglib_tag_set_artist ( TagLib_Tag tag,
const char *  artist 
)

Sets the tag's artist.

Note
By default this string should be UTF8 encoded.

◆ taglib_tag_set_comment()

TAGLIB_C_EXPORT void taglib_tag_set_comment ( TagLib_Tag tag,
const char *  comment 
)

Sets the tag's comment.

Note
By default this string should be UTF8 encoded.

◆ taglib_tag_set_genre()

TAGLIB_C_EXPORT void taglib_tag_set_genre ( TagLib_Tag tag,
const char *  genre 
)

Sets the tag's genre.

Note
By default this string should be UTF8 encoded.

◆ taglib_tag_set_title()

TAGLIB_C_EXPORT void taglib_tag_set_title ( TagLib_Tag tag,
const char *  title 
)

Sets the tag's title.

Note
By default this string should be UTF8 encoded.

◆ taglib_tag_set_track()

TAGLIB_C_EXPORT void taglib_tag_set_track ( TagLib_Tag tag,
unsigned int  track 
)

Sets the tag's track number.

0 indicates that this field should be cleared.

◆ taglib_tag_set_year()

TAGLIB_C_EXPORT void taglib_tag_set_year ( TagLib_Tag tag,
unsigned int  year 
)

Sets the tag's year.

0 indicates that this field should be cleared.

◆ taglib_tag_title()

TAGLIB_C_EXPORT char* taglib_tag_title ( const TagLib_Tag tag)

Returns a string with this tag's title.

Note
By default this string should be UTF8 encoded and its memory should be freed using taglib_tag_free_strings().

◆ taglib_tag_track()

TAGLIB_C_EXPORT unsigned int taglib_tag_track ( const TagLib_Tag tag)

Returns the tag's track number or 0 if track number is not set.

◆ taglib_tag_year()

TAGLIB_C_EXPORT unsigned int taglib_tag_year ( const TagLib_Tag tag)

Returns the tag's year or 0 if year is not set.