[Scummvm-cvs-logs] CVS: tools extract-common.c,1.7,1.8 extract.c,1.38,1.39 extract.h,1.10,1.11 simon2mp3.c,1.32,1.33
Max Horn
fingolfin at users.sourceforge.net
Fri Apr 9 17:51:02 CEST 2004
Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21261
Modified Files:
extract-common.c extract.c extract.h simon2mp3.c
Log Message:
A little cleanup - this code could stand more (copying a file byte-for-byte? Uh-oh)
Index: extract-common.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract-common.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- extract-common.c 28 Mar 2004 16:37:15 -0000 1.7
+++ extract-common.c 10 Apr 2004 00:37:21 -0000 1.8
@@ -51,14 +51,10 @@
int numArgs;
} flaccparams;
-FILE *input, *output_idx, *output_snd;
-
lameparams encparms = { minBitrDef, maxBitrDef, false, algqualDef, vbrqualDef, 0 };
oggencparams oggparms = { -1, -1, -1, oggqualDef, 0 };
flaccparams flacparms;
-CompressMode gCompMode = kMP3Mode;
-
const char *tempEncoded = TEMP_MP3;
@@ -150,7 +146,7 @@
}
}
-void get_wav(void) {
+void get_wav(FILE *input, CompressMode compMode) {
int length;
FILE *f;
char fbuf[2048];
@@ -173,10 +169,10 @@
fclose(f);
/* Convert the WAV temp file to OGG/MP3 */
- encodeAudio(TEMP_WAV, false, -1, tempEncoded, gCompMode);
+ encodeAudio(TEMP_WAV, false, -1, tempEncoded, compMode);
}
-void get_voc(void) {
+void get_voc(FILE *input, CompressMode compMode) {
int blocktype;
blocktype = fgetc(input);
@@ -225,7 +221,7 @@
fclose(f);
/* Convert the raw temp file to OGG/MP3 */
- encodeAudio(TEMP_RAW, true, real_samplerate, tempEncoded, gCompMode);
+ encodeAudio(TEMP_RAW, true, real_samplerate, tempEncoded, compMode);
break;
}
Index: extract.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- extract.c 22 Feb 2004 12:54:27 -0000 1.38
+++ extract.c 10 Apr 2004 00:37:21 -0000 1.39
@@ -22,28 +22,22 @@
#include "extract.h"
-char f_hdr[] = {
+static const char f_hdr[] = {
'S', 'O', 'U', ' ', 0, 0, 0, 0, 0
};
-byte v_hdr[] = {
- 'V', 'C', 'T', 'L', 0, 0, 0, 0xA, 0xF, 0xFF
-};
-
-char c_hdr[] = {
- 'C', 'r', 'e', 'a', 't', 'i', 'v', 'e', ' ', 'V', 'o', 'i', 'c', 'e',
- ' ', 'F', 'i', 'l', 'e', 0x1a, 0x1a, 0x00, 0x0A, 0x01, 0x29, 0x11
-};
-
#define OUTPUT_MP3 "monster.so3"
#define OUTPUT_OGG "monster.sog"
#define OUTPUT_FLAC "monster.sof"
-const char *outputName = OUTPUT_MP3;
+static const char *outputName = OUTPUT_MP3;
#define TEMP_DAT "tempfile.dat"
#define TEMP_IDX "tempfile.idx"
+static FILE *input, *output_idx, *output_snd;
+
+static CompressMode gCompMode = kMP3Mode;
void end_of_file(void)
@@ -135,7 +129,7 @@
printf("Voice file found (pos = %d) :", pos);
/* Conver the VOC data */
- get_voc();
+ get_voc(input, gCompMode);
/* Append the converted data to the master output file */
sprintf(outname, tempEncoded);
Index: extract.h
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- extract.h 22 Feb 2004 12:54:27 -0000 1.10
+++ extract.h 10 Apr 2004 00:37:21 -0000 1.11
@@ -45,19 +45,15 @@
/*
* Stuff which is in extract-common.c
*/
-extern FILE *input, *output_idx, *output_snd;
const extern char *tempEncoded;
-extern CompressMode gCompMode;
-
-
extern void process_mp3_parms(int argc, char *argv[], int i);
extern void process_ogg_parms(int argc, char *argv[], int i);
extern void process_flac_parms(int argc, char *argv[], int i);
-extern void get_voc(void);
-extern void get_wav(void);
+extern void get_voc(FILE *input, CompressMode compMode);
+extern void get_wav(FILE *input, CompressMode compMode);
/*
Index: simon2mp3.c
===================================================================
RCS file: /cvsroot/scummvm/tools/simon2mp3.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- simon2mp3.c 28 Mar 2004 21:11:15 -0000 1.32
+++ simon2mp3.c 10 Apr 2004 00:37:21 -0000 1.33
@@ -21,6 +21,10 @@
#include "extract.h"
+static FILE *input, *output_idx, *output_snd;
+
+static CompressMode gCompMode = kMP3Mode;
+
static char infile_base[256];
static void end(void)
@@ -121,10 +125,10 @@
if (!memcmp(buf, "Creative", 8)) {
printf("VOC found (pos = %d) :\n", offset);
fseek(input, 18, SEEK_CUR);
- get_voc();
+ get_voc(input, gCompMode);
} else if (!memcmp(buf, "RIFF", 4)) {
printf("WAV found (pos = %d) :\n", offset);
- get_wav();
+ get_wav(input, gCompMode);
} else {
error("Unexpected data at offset: %i", offset);
}
More information about the Scummvm-git-logs
mailing list