[easytag/wip/dsf-support: 24/26] Move private ID3 functions into a separate header



commit 59d29a22550aad851c5ba51051968846903df8ba
Author: David King <amigadave amigadave com>
Date:   Fri Nov 14 23:54:28 2014 +0000

    Move private ID3 functions into a separate header

 Makefile.am            |    1 +
 src/tags/dsf_tag.c     |    4 +---
 src/tags/id3_private.h |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/tags/id3_tag.c     |    3 ++-
 src/tags/id3_tag.h     |   21 ---------------------
 src/tags/id3v24_tag.c  |   13 +++++++------
 6 files changed, 59 insertions(+), 31 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 647e61f..fb30573 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -134,6 +134,7 @@ easytag_headers = \
        src/tags/flac_tag.h \
        src/tags/gio_wrapper.h \
        src/tags/id3_tag.h \
+       src/tags/id3_private.h \
        src/tags/monkeyaudio_header.h \
        src/tags/mpeg_header.h \
        src/tags/mp4_header.h \
diff --git a/src/tags/dsf_tag.c b/src/tags/dsf_tag.c
index 1a80b1e..7a89871 100644
--- a/src/tags/dsf_tag.c
+++ b/src/tags/dsf_tag.c
@@ -31,11 +31,9 @@
 
 #ifdef ENABLE_MP3
 
-#include <id3tag.h>
-#include "id3_tag.h"
+#include "id3_private.h"
 
 #ifdef ENABLE_ID3LIB
-#include <id3.h>
 #include "id3lib/id3_bugfix.h"
 #endif
 
diff --git a/src/tags/id3_private.h b/src/tags/id3_private.h
new file mode 100644
index 0000000..4455f07
--- /dev/null
+++ b/src/tags/id3_private.h
@@ -0,0 +1,48 @@
+/* EasyTAG - Tag editor for audio files
+ * Copyright (C) 2014  David King <amigadave amigadave com>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef ET_ID3_PRIVATE_H_
+#define ET_ID3_PRIVATE_H_
+
+#include "config.h"
+
+#include <glib.h>
+#include "et_core.h"
+
+G_BEGIN_DECLS
+
+#define ID3_INVALID_GENRE 255
+
+gboolean id3tag_write_file_v24tag (const ET_File *ETFile, GError **error);
+guchar Id3tag_String_To_Genre (const gchar *genre);
+gchar *et_id3tag_get_tpos_from_file_tag (const File_Tag *file_tag);
+
+#ifdef ENABLE_MP3
+#include <id3tag.h>
+gboolean et_id3tag_fill_file_tag_from_id3tag (struct id3_tag *tag, File_Tag *file_tag);
+void et_id3tag_set_id3_tag_from_file_tag (const File_Tag *FileTag, struct id3_tag *v1tag, struct id3_tag 
*v2tag, gboolean *strip_tags);
+#ifdef ENABLE_ID3LIB
+#include <id3.h>
+gchar * Id3tag_Get_Error_Message (ID3_Err error);
+void et_id3tag_set_id3tag_from_file_tag (const File_Tag *FileTag, ID3Tag *id3_tag, gboolean *strip_tags);
+#endif /* ENABLE_ID3LIB */
+#endif /* ENABLE_MP3 */
+
+G_END_DECLS
+
+#endif /* ET_ID3TAG_H_ */
diff --git a/src/tags/id3_tag.c b/src/tags/id3_tag.c
index e9706eb..471ff10 100644
--- a/src/tags/id3_tag.c
+++ b/src/tags/id3_tag.c
@@ -24,10 +24,12 @@
 #include <errno.h>
 
 #include "id3_tag.h"
+
 #include "ape_tag.h"
 #include "picture.h"
 #include "easytag.h"
 #include "genres.h"
+#include "id3_private.h"
 #include "setting.h"
 #include "misc.h"
 #include "et_core.h"
@@ -36,7 +38,6 @@
 #ifdef ENABLE_MP3
 
 #ifdef ENABLE_ID3LIB
-#include <id3.h>
 #include "id3lib/id3_bugfix.h"
 #endif
 
diff --git a/src/tags/id3_tag.h b/src/tags/id3_tag.h
index a63e423..9adc501 100644
--- a/src/tags/id3_tag.h
+++ b/src/tags/id3_tag.h
@@ -20,35 +20,14 @@
 #ifndef ET_ID3TAG_H_
 #define ET_ID3TAG_H_
 
-#include "config.h"
-
 #include <glib.h>
 #include "et_core.h"
 
 G_BEGIN_DECLS
 
-#define ID3_INVALID_GENRE 255
-
 gboolean id3tag_read_file_tag (GFile *file, File_Tag *FileTag, GError **error);
-gboolean id3tag_write_file_v24tag (const ET_File *ETFile, GError **error);
 gboolean id3tag_write_file_tag (const ET_File *ETFile, GError **error);
-
 const gchar * Id3tag_Genre_To_String (unsigned char genre_code);
-guchar Id3tag_String_To_Genre (const gchar *genre);
-
-gchar *et_id3tag_get_tpos_from_file_tag (const File_Tag *file_tag);
-
-
-#ifdef ENABLE_MP3
-#include <id3tag.h>
-gboolean et_id3tag_fill_file_tag_from_id3tag (struct id3_tag *tag, File_Tag *file_tag);
-void et_id3tag_set_id3_tag_from_file_tag (const File_Tag *FileTag, struct id3_tag *v1tag, struct id3_tag 
*v2tag, gboolean *strip_tags);
-#ifdef ENABLE_ID3LIB
-#include <id3.h>
-gchar * Id3tag_Get_Error_Message (ID3_Err error);
-void et_id3tag_set_id3tag_from_file_tag (const File_Tag *FileTag, ID3Tag *id3_tag, gboolean *strip_tags);
-#endif /* ENABLE_ID3LIB */
-#endif /* ENABLE_MP3 */
 
 G_END_DECLS
 
diff --git a/src/tags/id3v24_tag.c b/src/tags/id3v24_tag.c
index 1c08c05..4e1d53c 100644
--- a/src/tags/id3v24_tag.c
+++ b/src/tags/id3v24_tag.c
@@ -28,14 +28,15 @@
 #include <stdlib.h>
 
 #include "id3_tag.h"
-#include "picture.h"
-#include "easytag.h"
+
 #include "browser.h"
-#include "setting.h"
-#include "misc.h"
-#include "et_core.h"
 #include "charset.h"
-
+#include "easytag.h"
+#include "et_core.h"
+#include "id3_private.h"
+#include "misc.h"
+#include "picture.h"
+#include "setting.h"
 #include "win32/win32dep.h"
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]