[easytag/wip/et_core-refactor: 3/9] Split a couple of enums out to a new core_types.h



commit 9e855c1b482f11b3114d10cf0b0b48c87b90f931
Author: David King <amigadave amigadave com>
Date:   Sun Dec 28 18:41:22 2014 +0000

    Split a couple of enums out to a new core_types.h
    
    This should make it easier to split up the behemoth that is et_core.h.

 Makefile.am      |    1 +
 src/core_types.h |   75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/et_core.h    |   38 +--------------------------
 src/picture.h    |    5 +++-
 4 files changed, 82 insertions(+), 37 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 643dfe9..f77f013 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -100,6 +100,7 @@ easytag_headers = \
        src/cddb_dialog.h \
        src/charset.h \
        src/crc32.h \
+       src/core_types.h \
        src/dlm.h \
        src/easytag.h \
        src/et_core.h \
diff --git a/src/core_types.h b/src/core_types.h
new file mode 100644
index 0000000..dbd9cb9
--- /dev/null
+++ b/src/core_types.h
@@ -0,0 +1,75 @@
+/* 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_CORE_TYPES_H_
+#define ET_CORE_TYPES_H_
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/*
+ * ET_File_Type:
+ * @MP2_FILE: MPEG audio Layer 2: .mp2 (.mpg) (.mpga)
+ * @MP3_FILE: MPEG audio Layer 3: .mp3 (.mpg) (.mpga)
+ * @MP4_FILE: MPEG audio Layer 4 / AAC: .mp4 (.m4a) (.m4p) (.m4v)
+ * @OGG_FILE: Ogg Vorbis audio: .ogg (.ogm)
+ * @FLAC_FILE: FLAC (lossless): .flac .fla
+ * @MPC_FILE: MusePack: .mpc .mp+ .mpp
+ * @MAC_FILE: Monkey's Audio (lossless): .ape (.mac)
+ * @SPEEX_FILE: Speech audio files: .spx
+ * @OFR_FILE: OptimFROG (lossless): .ofr .ofs
+ * @WAVPACK_FILE: Wavpack (lossless): .wv
+ * @OPUS_FILE: Ogg Opus audio: .opus
+ * @UNKNOWN_FILE: not a recognized file
+ * Types of files
+ */
+typedef enum
+{ /* (.ext) is not so popular. */
+    MP2_FILE = 0,
+    MP3_FILE,
+    MP4_FILE,
+    OGG_FILE,
+    FLAC_FILE,
+    MPC_FILE,
+    MAC_FILE,
+    SPEEX_FILE,
+    OFR_FILE,
+    WAVPACK_FILE,
+    OPUS_FILE,
+    UNKNOWN_FILE
+} ET_File_Type;
+
+/*
+ * Types of tags
+ */
+typedef enum
+{
+    ID3_TAG = 0,
+    OGG_TAG,
+    APE_TAG,
+    FLAC_TAG,
+    MP4_TAG,
+    WAVPACK_TAG,
+    OPUS_TAG,
+    UNKNOWN_TAG
+} ET_Tag_Type;
+
+G_END_DECLS
+
+#endif /* ET_TYPES_H_ */
diff --git a/src/et_core.h b/src/et_core.h
index 1e0879d..e85f675 100644
--- a/src/et_core.h
+++ b/src/et_core.h
@@ -27,48 +27,14 @@ G_BEGIN_DECLS
 #include <glib.h>
 #include <gdk/gdk.h>
 
+#include "core_types.h"
+
 /*
  * Colors Used (see declaration into et_core.c)
  */
 extern GdkRGBA RED;
 
 /*
- * Types of files
- */
-typedef enum
-{                    //                                             (.ext) is not so popular 
-    MP2_FILE = 0,    // Mpeg audio Layer 2        : .mp2            (.mpg) (.mpga)
-    MP3_FILE,        // Mpeg audio Layer 3        : .mp3            (.mpg) (.mpga)
-    MP4_FILE, /* MPEG audio Layer 4 / AAC: .mp4 (.m4a) (.m4p) (.m4v) */
-    OGG_FILE,        // Ogg Vorbis audio          : .ogg            (.ogm)
-    FLAC_FILE,       // FLAC (lossless)           : .flac .fla
-    MPC_FILE,        // MusePack                  : .mpc .mp+ .mpp
-    MAC_FILE,        // Monkey's Audio (lossless) : .ape            (.mac)
-    SPEEX_FILE,      // Speech audio files        : .spx
-    OFR_FILE,        // OptimFROG (lossless)      : .ofr .ofs
-    WAVPACK_FILE,    // Wavpack (lossless)        : .wv
-    OPUS_FILE, /* Ogg Opus File: .opus */
-    UNKNOWN_FILE
-} ET_File_Type;
-
-
-/*
- * Types of tags
- */
-typedef enum
-{
-    ID3_TAG = 0,
-    OGG_TAG,
-    APE_TAG,
-    FLAC_TAG,
-    MP4_TAG,
-    WAVPACK_TAG,
-    OPUS_TAG,
-    UNKNOWN_TAG
-} ET_Tag_Type;
-
-
-/*
  * Description of each item of the FileNameList list
  */
 typedef struct _File_Name File_Name;
diff --git a/src/picture.h b/src/picture.h
index b775e54..19185ff 100644
--- a/src/picture.h
+++ b/src/picture.h
@@ -20,10 +20,13 @@
 #ifndef ET_PICTURE_H_
 #define ET_PICTURE_H_
 
-#include "et_core.h"
+#include <glib-object.h>
 
 G_BEGIN_DECLS
 
+#include "core_types.h"
+#include "et_core.h"
+
 #define ET_TYPE_PICTURE (et_picture_get_type ())
 
 /* Defined in et_core.h


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