# HG changeset patch # User nenolod # Date 1135586339 28800 # Node ID 46271e2c9622dc4c689b0721c00bbb65b9aecfd1 # Parent c7a67ac8e19c0b5a50833a782c4123aff52a049b [svn] Initial tagging_mp4.c code. Still need to add a class for aac tagging information (ID3) diff -r c7a67ac8e19c -r 46271e2c9622 Plugins/Input/aac/src/Makefile.am --- a/Plugins/Input/aac/src/Makefile.am Sun Dec 25 23:56:55 2005 -0800 +++ b/Plugins/Input/aac/src/Makefile.am Mon Dec 26 00:38:59 2005 -0800 @@ -4,6 +4,6 @@ libaac_la_LDFLAGS = $(PLUGIN_LDFLAGS) ../libmp4v2/libmp4v2.la ../libfaad2/libfaad.la -lstdc++ -libaac_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c +libaac_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c tagging_mp4.c INCLUDES = $(GTK_CFLAGS) -I$(top_builddir)/intl -I$(top_srcdir) -I../include -I../libmp4v2 -I../libfaad diff -r c7a67ac8e19c -r 46271e2c9622 Plugins/Input/aac/src/tagging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Input/aac/src/tagging.h Mon Dec 26 00:38:59 2005 -0800 @@ -0,0 +1,36 @@ +/* + * Audacious -- Cross-platform Multimedia Player + * Copyright (c) 2005 William Pitcock + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef _AUDMP4_TAGGING_H +#define _AUDMP4_TAGGING_H + +#include +#include +#include + +#include + +/* XXX: We will need the same for AAC eventually */ +extern gchar *audmp4_get_artist(MP4FileHandle); +extern gchar *audmp4_get_title(MP4FileHandle); +extern gchar *audmp4_get_album(MP4FileHandle); +extern gchar *audmp4_get_genre(MP4FileHandle); +extern gint audmp4_get_year(MP4FileHandle); + +#endif diff -r c7a67ac8e19c -r 46271e2c9622 Plugins/Input/aac/src/tagging_mp4.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Plugins/Input/aac/src/tagging_mp4.c Mon Dec 26 00:38:59 2005 -0800 @@ -0,0 +1,74 @@ +/* + * Audacious -- Cross-platform Multimedia Player + * Copyright (c) 2005 William Pitcock + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include +#include +#include + +#include + +#include "tagging.h" + +gchar *audmp4_get_artist(MP4FileHandle file) +{ + gchar *value; + + MP4GetMetadataArtist(file, &value); + + return value; +} + +gchar *audmp4_get_title(MP4FileHandle file) +{ + gchar *value; + + MP4GetMetadataName(file, &value); + + return value; +} + +gchar *audmp4_get_album(MP4FileHandle file) +{ + gchar *value; + + MP4GetMetadataAlbum(file, &value); + + return value; +} + +gchar *audmp4_get_genre(MP4FileHandle file) +{ + gchar *value; + + MP4GetMetadataGenre(file, &value); + + return value; +} + +gint audmp4_get_year(MP4FileHandle file) +{ + gchar *value; + + MP4GetMetadataYear(file, &value); + + if (!value) + return 0; + + return atoi(value); +}