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



commit e3943acf6ac0d503a78479cb815a410b79ad4d54
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  |   15 ++++++++-------
 6 files changed, 60 insertions(+), 32 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 29102e9..2bc0fc8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,6 +131,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 797b3ba..ac42be3 100644
--- a/src/tags/dsf_tag.c
+++ b/src/tags/dsf_tag.c
@@ -30,11 +30,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 11191dc..5b0d82f 100644
--- a/src/tags/id3_tag.c
+++ b/src/tags/id3_tag.c
@@ -28,11 +28,13 @@
 #include <unistd.h>
 
 #include "id3_tag.h"
+
 #include "ape_tag.h"
 #include "picture.h"
 #include "easytag.h"
 #include "browser.h"
 #include "genres.h"
+#include "id3_private.h"
 #include "setting.h"
 #include "misc.h"
 #include "et_core.h"
@@ -41,7 +43,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 da585ff..358214b 100644
--- a/src/tags/id3v24_tag.c
+++ b/src/tags/id3v24_tag.c
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include <config.h>
+#include "config.h"
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
@@ -32,14 +32,15 @@
 #include <unistd.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]