[gnome-games] utils: Add CueSheetFileFormat



commit 887e66cf1917b767f7f54db7c659115a881ba469
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jul 28 10:51:54 2016 +0200

    utils: Add CueSheetFileFormat
    
    This will be used in a later commit to improve cue sheets handling.

 src/Makefile.am                                |    1 +
 src/utils/cue-sheet/cue-sheet-file-format.vala |   33 ++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 7bb4bce..ea29bcd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -104,6 +104,7 @@ gnome_games_SOURCES = \
        ui/search-bar.vala \
        ui/ui-state.vala \
        \
+       utils/cue-sheet/cue-sheet-file-format.vala \
        utils/filename-title.vala \
        utils/fingerprint.vala \
        utils/generic-game.vala \
diff --git a/src/utils/cue-sheet/cue-sheet-file-format.vala b/src/utils/cue-sheet/cue-sheet-file-format.vala
new file mode 100644
index 0000000..9ed0590
--- /dev/null
+++ b/src/utils/cue-sheet/cue-sheet-file-format.vala
@@ -0,0 +1,33 @@
+// This file is part of GNOME Games. License: GPLv3
+
+public enum Games.CueSheetFileFormat {
+       INVALID,
+       AIFF,
+       BINARY,
+       MOTOROLA,
+       MP3,
+       VORBIS,
+       WAVE,
+       UNKNOWN;
+
+       public static CueSheetFileFormat parse_string (string? value) {
+               switch (value) {
+               case "AIFF":
+                       return CueSheetFileFormat.AIFF;
+               case "BINARY":
+                       return CueSheetFileFormat.BINARY;
+               case "MOTOROLA":
+                       return CueSheetFileFormat.MOTOROLA;
+               case "MP3":
+                       return CueSheetFileFormat.MP3;
+               case "VORBIS":
+                       return CueSheetFileFormat.VORBIS;
+               case "WAVE":
+                       return CueSheetFileFormat.WAVE;
+               case null:
+                       return CueSheetFileFormat.UNKNOWN;
+               default:
+                       return CueSheetFileFormat.INVALID;
+               }
+       }
+}


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