Mercurial > audlegacy
changeset 341:46271e2c9622 trunk
[svn] Initial tagging_mp4.c code. Still need to add a class for aac tagging information (ID3)
author | nenolod |
---|---|
date | Mon, 26 Dec 2005 00:38:59 -0800 |
parents | c7a67ac8e19c |
children | 320f0205ad45 |
files | Plugins/Input/aac/src/Makefile.am Plugins/Input/aac/src/tagging.h Plugins/Input/aac/src/tagging_mp4.c |
diffstat | 3 files changed, 111 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- /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 <nenolod@nenolod.net> + * + * 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 <glib.h> +#include <string.h> +#include <unistd.h> + +#include <mp4.h> + +/* 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
--- /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 <nenolod@nenolod.net> + * + * 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 <glib.h> +#include <string.h> +#include <unistd.h> + +#include <mp4.h> + +#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); +}