[Scummvm-cvs-logs] SF.net SVN: scummvm:[39941] tools/trunk/tools_gui.h

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Apr 11 23:14:49 CEST 2009


Revision: 39941
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39941&view=rev
Author:   fingolfin
Date:     2009-04-11 21:14:48 +0000 (Sat, 11 Apr 2009)

Log Message:
-----------
Part of patch #2741849: GSOC09: Compression GUI Tool touchup

Modified Paths:
--------------
    tools/trunk/tools_gui.h

Modified: tools/trunk/tools_gui.h
===================================================================
--- tools/trunk/tools_gui.h	2009-04-11 20:20:09 UTC (rev 39940)
+++ tools/trunk/tools_gui.h	2009-04-11 21:14:48 UTC (rev 39941)
@@ -63,35 +63,57 @@
 #  define wxFD_MULTIPLE wxMULTIPLE
 #endif
 
-#define kNumCompressionTools 12
+/* Options available in the UI 
+ * In most cases, the "Names" filled in here will directly be provided in the UI
+ * For the fields that have two options, the second option will be the one
+ * passed on as a command line option, in other cases the Name will be directly
+ * passed
+ */
+
+/* List of compression tools, name will display in UI */
 wxString kCompressionToolNames[12] = {wxT("AGOS"), wxT("Broken Sword 1"), wxT("Broken Sword 2"), wxT("Encode DXA"), wxT("Flight of the Amazon Queen"), wxT("Kyra"), wxT("SAGA"), wxT("SCUMM BUN"), wxT("SCUMM SAN"), wxT("SCUMM SOU"), wxT("Simon 2 (MAC)"), wxT("Touche")};
+/* Name of tool executable (position must match list above), .exe will be appended under Windows */
 wxString kCompressionToolFilenames[12] = {wxT("compress_agos"), wxT("compress_sword1"), wxT("compress_sword2"), wxT("encode_dxa"), wxT("compress_queen"), wxT("compress_kyra"), wxT("compress_saga"), wxT("compress_scumm_bun"), wxT("compress_scumm_san"), wxT("compress_scumm_sou"), wxT("compress_agos --mac"), wxT("compress_touche")};
 
-#define kNumExtractionTools 9
+/* List of extraction tools, name will display in UI */
 wxString kExtractionToolNames[9] = {wxT("AGOS"), wxT("Kyra"), wxT("Loom (TG16)"), wxT("Maniac Mansion (Apple)"), wxT("Maniac Mansion (C64)"), wxT("Maniac Mansion (NES)"), wxT("Parallaction"), wxT("SCUMM (MAC)"), wxT("Zak McKracken (C64)")};
+/* Name of extraction executable */
 wxString kExtractionToolFilenames[9] = {wxT("extract_agos"), wxT("extract_kyra"), wxT("extract_loom_tg16"), wxT("extract_mm_apple"), wxT("extract_mm_c64"), wxT("extract_mm_nes"), wxT("extract_parallaction"), wxT("extract_scumm_mac"), wxT("extract_zak_c64")};
 
-#define kNumCompressionTypes 3
+/* List of possible audio codecs to use when compressing */
 wxString kCompressionTypeNames[3] = {wxT("MP3"), wxT("Vorbis"), wxT("FLAC")};
+/* The codecs respective CLI arguments */
 wxString kCompressionTypeArguments[3] = {wxT("--mp3"), wxT("--vorbis"), wxT("--flac")};
 
-#define kNumValidBitrates 21
+/* List of possible bitrates, first entry is default (no argument will be if input equals it) */
 wxString kValidBitrateNames[21] = {wxT(""), wxT("8"), wxT("16"), wxT("24"), wxT("32"), wxT("40"), wxT("48"), wxT("56"), wxT("64"), wxT("72"), wxT("80"), wxT("88"), wxT("96"), wxT("104"), wxT("112"), wxT("120"), wxT("128"), wxT("136"), wxT("144"), wxT("152"), wxT("160")};
 
-#define kNumValidQuality 10
+/* VBR/MPEG quality options */
 wxString kVaildQualityNames[10] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9")};
 
-#define kNumValidCompressionLevels 9
-wxString kVaildCompressionLevels[9] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8")};
+/* Compression level options */
+wxString kValidCompressionLevels[9] = {wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8")};
 
-#define kNumValidFlacBlocksize 4
+/* Possible FLAC block sizes */
 wxString kValidFlacBlocksize[4] = {wxT("576"), wxT("1152"), wxT("2304"), wxT("4608")};
 
-#define kNumMP3Modes 2
+/* Possible MP3 compression modes */
 wxString kMP3ModeNames[2] = {wxT("VBR"), wxT("ABR")};
 
+// Length of above fields
+#define kNumCompressionTools (sizeof kCompressionToolNames / sizeof *kCompressionToolNames)
+#define kNumExtractionTools (sizeof kExtractionToolNames / sizeof *kExtractionToolNames)
+#define kNumCompressionTypes (sizeof kCompressionTypeNames / sizeof *kCompressionTypeNames)
+#define kNumValidBitrates (sizeof kValidBitrateNames / sizeof *kValidBitrateNames)
+#define kNumValidQuality (sizeof kVaildQualityNames / sizeof *kVaildQualityNames)
+#define kNumValidCompressionLevels (sizeof kValidCompressionLevels / sizeof *kValidCompressionLevels)
+#define kNumValidFlacBlocksize (sizeof kValidFlacBlocksize / sizeof *kValidFlacBlocksize)
+#define kNumMP3Modes (sizeof kMP3ModeNames / sizeof *kMP3ModeNames)
+
+// Window IDs for the widgets in the tool
+// used for event handling
 enum kEventId {
-	kCompressionToolChoice,
+	kCompressionToolChoice = wxID_HIGHEST,
 	kCompressionTypeChoice,
 	kCompressionModeChoice,
 	kCompressionInputBrowse,
@@ -133,6 +155,9 @@
 
 /* ----- Common ----- */
 
+/* A process with the additional functionality of redirectig output to a
+ * target text control
+ */
 class Process : public wxProcess {
 public:
     Process(MainFrame *parent, wxTextCtrl *target);
@@ -144,6 +169,7 @@
     virtual bool HasInput();
 };
 
+/* A wxFileDialog with a constructor argument for picking directories instead */
 class LocationDialog {
 public:
 	LocationDialog(wxTextCtrl *target, bool isFileChooser, wxString wildcard);
@@ -155,6 +181,7 @@
 	void prompt();
 };
 
+/* Used to enable drag & drop ontop of the file picker control */
 #if wxUSE_DRAG_AND_DROP
 class FileDrop : public wxFileDropTarget {
 public:
@@ -167,6 +194,9 @@
 };
 #endif
 
+/* This is just a wxFilePicker with the addition of a constructor
+ * argument for picking directiories instead 
+ */
 class IOChooser : public wxPanel {
 public:
 	IOChooser(wxWindow *parent, kEventId buttonId, wxString title, bool isFileChooser);
@@ -179,6 +209,10 @@
 #endif
 };
 
+/* Very thin wrapper for a wxChoice, it's purpose being
+ * constructor arguments rewrite and putting a frame
+ * around the control.
+ */
 class DropDownBox : public wxPanel {
 public:
 	DropDownBox(wxWindow *parent, kEventId boxId, wxString title, int numItems, wxString items[]);
@@ -188,6 +222,9 @@
 
 /* ----- Compression ----- */
 
+/* The compression options, a panel containing the controls
+ * for controlling the output of the tools 
+ */
 class CompressionOptions : public wxPanel {
 public:
 	CompressionOptions(wxWindow *parent);
@@ -208,6 +245,7 @@
 	DECLARE_EVENT_TABLE()
 };
 
+/* Compression Panel (tab) */
 class CompressionPanel : public wxPanel {
 public:
 	CompressionPanel(wxWindow *parent);
@@ -231,6 +269,7 @@
 
 /* ----- Extraction ----- */
 
+/* Panel containing all the options for extracting */
 class ExtractionOptions : public wxPanel {
 public:
 	ExtractionOptions(wxWindow *parent);
@@ -242,6 +281,7 @@
 	wxCheckBox *_parallactionSmall;
 };
 
+/* Extraction Panel (tab) */
 class ExtractionPanel : public wxPanel {
 public:
 	ExtractionPanel(wxWindow *parent);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list