mirror of
https://github.com/scummvm/scummvm-tools.git
synced 2026-05-21 05:40:44 +00:00
Update help message to reflect addition of libvorbis and libflac to compress.c.
svn-id: r27908
This commit is contained in:
+12
-8
@@ -74,11 +74,11 @@ static void end(void)
|
||||
unlink(TEMP_RAW);
|
||||
unlink(tempEncoded);
|
||||
unlink(TEMP_WAV);
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int get_offsets(uint32 filenums[], uint32 offsets[])
|
||||
{
|
||||
int i;
|
||||
@@ -148,7 +148,7 @@ static uint32 get_sound(uint32 offset)
|
||||
|
||||
void showhelp(char *exename)
|
||||
{
|
||||
printf("\nUsage: %s <params> [<file> | mac]\n", exename);
|
||||
printf("\nUsage: %s [params] (<file> | mac)\n", exename);
|
||||
|
||||
printf("\nParams:\n");
|
||||
printf(" --mp3 encode to MP3 format (default)\n");
|
||||
@@ -173,8 +173,12 @@ void showhelp(char *exename)
|
||||
printf(" --silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf(" [params] optional arguments passed directly to the encoder\n");
|
||||
printf(" recommended is: --best -b 1152\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n --help this help message\n");
|
||||
|
||||
@@ -253,7 +257,7 @@ static void convert_mac(void)
|
||||
char tmp[256];
|
||||
uint32 filenums[32768];
|
||||
uint32 offsets[32768];
|
||||
|
||||
|
||||
sprintf(infile_base, "simon2");
|
||||
|
||||
input = fopen("voices.idx", "rb");
|
||||
@@ -295,7 +299,7 @@ static void convert_mac(void)
|
||||
sprintf(tmp, "voices%d.dat", filenums[i]);
|
||||
if (input)
|
||||
fclose(input);
|
||||
input = fopen(tmp, "rb");
|
||||
input = fopen(tmp, "rb");
|
||||
if (!input) {
|
||||
printf("Cannot open file: %s\n", tmp);
|
||||
exit(-1);
|
||||
@@ -311,7 +315,7 @@ static void convert_mac(void)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (argc < 2)
|
||||
showhelp(argv[0]);
|
||||
|
||||
|
||||
+23
-19
@@ -19,7 +19,7 @@
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "compress.h"
|
||||
@@ -194,7 +194,7 @@ uint32 copyFile(const char *fromFileName, FILE* outputFile) {
|
||||
uint32 size;
|
||||
char fbuf[2048];
|
||||
FILE * tempf;
|
||||
|
||||
|
||||
tempf = fopen(fromFileName, "rb");
|
||||
if (tempf == NULL)
|
||||
error("Unable to open %s", fromFileName);
|
||||
@@ -211,7 +211,7 @@ void copyFile(FILE* inputFile, uint32 inputSize, const char* toFileName) {
|
||||
uint32 size;
|
||||
char fbuf[2048];
|
||||
FILE * tempf;
|
||||
|
||||
|
||||
tempf = fopen(toFileName, "wb");
|
||||
if (tempf == NULL)
|
||||
error("Unable to open %s", toFileName);
|
||||
@@ -228,7 +228,7 @@ void copyFile(FILE* inputFile, uint32 inputSize, const char* toFileName) {
|
||||
|
||||
void writeBufferToFile(uint8* data, uint32 inputSize, const char* toFileName) {
|
||||
FILE * tempf;
|
||||
|
||||
|
||||
tempf = fopen(toFileName, "wb");
|
||||
if (tempf == NULL)
|
||||
error("Unable to open %s", toFileName);
|
||||
@@ -248,7 +248,7 @@ uint32 encodeEntry(FILE* inputFile, uint32 inputSize, FILE* outputFile) {
|
||||
Common::File inputFileStream(inputFile);
|
||||
int rate, size;
|
||||
byte flags;
|
||||
|
||||
|
||||
if (currentFileDescription->resourceType == kSoundVOC) {
|
||||
inputData = Audio::loadVOCFromStream(inputFileStream, size, rate);
|
||||
sampleSize = size;
|
||||
@@ -259,7 +259,7 @@ uint32 encodeEntry(FILE* inputFile, uint32 inputSize, FILE* outputFile) {
|
||||
free(inputData);
|
||||
writeHeader(outputFile);
|
||||
|
||||
setRawAudioType( true, false, !isSigned, 8);
|
||||
setRawAudioType( true, false, 8);
|
||||
encodeAudio(TEMP_RAW, true, sampleRate, tempEncoded, gCompMode);
|
||||
return copyFile(tempEncoded, outputFile) + HEADER_SIZE;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ uint32 encodeEntry(FILE* inputFile, uint32 inputSize, FILE* outputFile) {
|
||||
sampleStereo = currentFileDescription->stereo;
|
||||
writeHeader(outputFile);
|
||||
|
||||
setRawAudioType( !currentFileDescription->swapEndian, currentFileDescription->stereo, !isSigned, sampleBits);
|
||||
setRawAudioType( !currentFileDescription->swapEndian, currentFileDescription->stereo, sampleBits);
|
||||
encodeAudio(TEMP_RAW, true, currentFileDescription->frequency, tempEncoded, gCompMode);
|
||||
return copyFile(tempEncoded, outputFile) + HEADER_SIZE;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ uint32 encodeEntry(FILE* inputFile, uint32 inputSize, FILE* outputFile) {
|
||||
|
||||
copyFile(inputFile, size, TEMP_RAW);
|
||||
|
||||
setRawAudioType( true, sampleStereo != 0, !isSigned, sampleBits);
|
||||
setRawAudioType( true, sampleStereo != 0, sampleBits);
|
||||
encodeAudio(TEMP_RAW, true, sampleRate, tempEncoded, gCompMode);
|
||||
return copyFile(tempEncoded, outputFile) + HEADER_SIZE;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ uint32 encodeEntry(FILE* inputFile, uint32 inputSize, FILE* outputFile) {
|
||||
sampleStereo = currentFileDescription->stereo;
|
||||
writeHeader(outputFile);
|
||||
|
||||
setRawAudioType( !currentFileDescription->swapEndian, currentFileDescription->stereo, !isSigned, sampleBits);
|
||||
setRawAudioType( !currentFileDescription->swapEndian, currentFileDescription->stereo, sampleBits);
|
||||
encodeAudio(TEMP_RAW, true, currentFileDescription->frequency, tempEncoded, gCompMode);
|
||||
return copyFile(tempEncoded, outputFile) + HEADER_SIZE;
|
||||
*/
|
||||
@@ -348,12 +348,12 @@ void sagaEncode(const char *inputFileName) {
|
||||
error("Something's wrong with your resource file");
|
||||
}
|
||||
|
||||
// Go to beginning of the table
|
||||
// Go to beginning of the table
|
||||
fseek(inputFile, resTableOffset, SEEK_SET);
|
||||
|
||||
inputTable = (Record*)malloc(resTableCount * sizeof(Record));
|
||||
|
||||
// Put offsets of all the records in a table
|
||||
// Put offsets of all the records in a table
|
||||
for (i = 0; i < resTableCount; i++) {
|
||||
|
||||
if (!currentFileDescription->swapEndian) {
|
||||
@@ -365,7 +365,7 @@ void sagaEncode(const char *inputFileName) {
|
||||
}
|
||||
|
||||
printf("Record: %ul, offset: %ul, size: %ul\n", i, inputTable[i].offset, inputTable[i].size);
|
||||
|
||||
|
||||
if ((inputTable[i].offset > inputFileSize) ||
|
||||
(inputTable[i].offset + inputTable[i].size > inputFileSize)) {
|
||||
error("The offset points outside the file");
|
||||
@@ -374,13 +374,13 @@ void sagaEncode(const char *inputFileName) {
|
||||
}
|
||||
outputTable = (Record*)malloc(resTableCount * sizeof(Record));
|
||||
|
||||
sprintf(outputFileNameWithExt, "%s.cmp", inputFileName);
|
||||
sprintf(outputFileNameWithExt, "%s.cmp", inputFileName);
|
||||
outputFile = fopen(outputFileNameWithExt, "wb");
|
||||
|
||||
for (i = 0; i < resTableCount; i++) {
|
||||
fseek(inputFile, inputTable[i].offset, SEEK_SET);
|
||||
outputTable[i].offset = ftell(outputFile);
|
||||
|
||||
|
||||
outputTable[i].size = encodeEntry(inputFile, inputTable[i].size, outputFile);
|
||||
}
|
||||
fclose(inputFile);
|
||||
@@ -391,13 +391,13 @@ void sagaEncode(const char *inputFileName) {
|
||||
writeUint32LE(outputFile, outputTable[i].size);
|
||||
}
|
||||
writeUint32LE(outputFile, resTableOffset);
|
||||
writeUint32LE(outputFile, resTableCount); // Should be the same number of entries
|
||||
writeUint32LE(outputFile, resTableCount); // Should be the same number of entries
|
||||
|
||||
fclose(outputFile);
|
||||
|
||||
free(inputTable);
|
||||
free(outputTable);
|
||||
|
||||
|
||||
// Cleanup
|
||||
unlink(TEMP_RAW);
|
||||
unlink(tempEncoded);
|
||||
@@ -406,7 +406,7 @@ void sagaEncode(const char *inputFileName) {
|
||||
}
|
||||
|
||||
void showhelp(char *exename) {
|
||||
printf("\nUsage: %s <params> [<file> | mac]\n", exename);
|
||||
printf("\nUsage: %s [params] <file>\n", exename);
|
||||
|
||||
printf("\nParams:\n");
|
||||
|
||||
@@ -432,8 +432,12 @@ void showhelp(char *exename) {
|
||||
printf("--silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf("[params] optional Arguments passed to the Encoder\n");
|
||||
printf(" recommended is: --best -b 1152\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n--help this help message\n");
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void end_of_file(void)
|
||||
unlink(TEMP_DAT);
|
||||
unlink(TEMP_RAW);
|
||||
unlink(tempEncoded);
|
||||
|
||||
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void get_part(void)
|
||||
|
||||
/* Conver the VOC data */
|
||||
extractAndEncodeVOC(TEMP_RAW, input, gCompMode);
|
||||
|
||||
|
||||
/* Append the converted data to the master output file */
|
||||
sprintf(outname, tempEncoded);
|
||||
f = fopen(outname, "rb");
|
||||
@@ -171,8 +171,12 @@ void showhelp(char *exename)
|
||||
printf(" --silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf(" [params] optional arguments passed directly to the encoder\n");
|
||||
printf(" recommended is: --best -b 1152\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n --help this help message\n");
|
||||
|
||||
@@ -242,7 +246,7 @@ int main(int argc, char *argv[])
|
||||
printf("Can't open file " TEMP_DAT " for write!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
/* Get the 'SOU ....' header */
|
||||
fread(buf, 1, 8, input);
|
||||
if (strncmp(buf, f_hdr, 8)) {
|
||||
|
||||
+16
-8
@@ -116,7 +116,7 @@ MusicFile musicNames[TOTAL_TUNES] = {
|
||||
{ "2M26", false },
|
||||
{ "3M7", false },
|
||||
{ "3M8", false },
|
||||
{ "3M9", true },
|
||||
{ "3M9", true },
|
||||
{ "3M10", false },
|
||||
{ "2M13", false },
|
||||
{ "3M12", false },
|
||||
@@ -163,7 +163,7 @@ MusicFile musicNames[TOTAL_TUNES] = {
|
||||
{ "4M31", false },
|
||||
{ "4M32", false },
|
||||
{ "5M1", false },
|
||||
{ "5M2", true },
|
||||
{ "5M2", true },
|
||||
{ "5M3", false },
|
||||
{ "5M4", false },
|
||||
{ "5M5", false },
|
||||
@@ -275,7 +275,7 @@ MusicFile musicNames[TOTAL_TUNES] = {
|
||||
{ "11M4", false },
|
||||
{ "11M7", false },
|
||||
{ "11M8", false },
|
||||
{ "11M9", true },
|
||||
{ "11M9", true },
|
||||
{ "12M1", false },
|
||||
{ "11M2", false },
|
||||
{ "SPM2", false },
|
||||
@@ -308,7 +308,7 @@ MusicFile musicNames[TOTAL_TUNES] = {
|
||||
};
|
||||
|
||||
void showhelp(char *exename) {
|
||||
printf("\nUsage: %s <params>\n", exename);
|
||||
printf("\nUsage: %s [params]\n", exename);
|
||||
|
||||
printf("\nParams:\n");
|
||||
printf(" --mp3 encode to MP3 format (default)\n");
|
||||
@@ -337,6 +337,14 @@ void showhelp(char *exename) {
|
||||
printf(" (default:%d)\n", oggqualDef);
|
||||
printf(" --silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n --help this help message\n");
|
||||
|
||||
printf("\nIf a parameter is not given the default value is used\n");
|
||||
@@ -438,7 +446,7 @@ void convertClu(FILE *clu, FILE *cl3, CompressMode compMode) {
|
||||
}
|
||||
cl3Index = (uint32*)malloc(numSamples * 8);
|
||||
memset(cl3Index, 0, numSamples * 8);
|
||||
|
||||
|
||||
sampleIndex = cowHeader + numRooms + 1;
|
||||
/* This points to the sample index table. 8 bytes each (4 bytes size and then 4 bytes file index) */
|
||||
|
||||
@@ -446,7 +454,7 @@ void convertClu(FILE *clu, FILE *cl3, CompressMode compMode) {
|
||||
|
||||
for (cnt = 0; cnt < numSamples; cnt++) {
|
||||
if (sampleIndex[cnt << 1] | sampleIndex[(cnt << 1) | 1]) {
|
||||
printf("sample %5d: ", cnt);
|
||||
printf("sample %5d: \n", cnt);
|
||||
smpData = (uint8*)uncompressSpeech(clu, sampleIndex[cnt << 1] + headerSize, sampleIndex[(cnt << 1) | 1], &smpSize);
|
||||
if ((!smpData) || (!smpSize))
|
||||
error("unable to handle speech sample %d!\n", cnt);
|
||||
@@ -475,7 +483,7 @@ void compressSpeech(CompressMode compMode) {
|
||||
int i;
|
||||
char cluName[256], outName[256];
|
||||
|
||||
setRawAudioType(true, false, false, 16);
|
||||
setRawAudioType(true, false, 16);
|
||||
for (i = 1; i <= 2; i++) {
|
||||
sprintf(cluName, "SPEECH/SPEECH%d.CLU", i);
|
||||
clu = fopen(cluName, "rb");
|
||||
@@ -670,7 +678,7 @@ int main(int argc, char *argv[]) {
|
||||
compressSpeech(compMode);
|
||||
if (compMusic)
|
||||
compressMusic(compMode);
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
+8
-4
@@ -31,7 +31,7 @@ static CompressMode gCompMode = kMP3Mode;
|
||||
|
||||
void showhelp(char *exename)
|
||||
{
|
||||
printf("\nUsage: %s <params> file.clu\n", exename);
|
||||
printf("\nUsage: %s [params] <file>\n", exename);
|
||||
|
||||
printf("\nParams:\n");
|
||||
printf(" --mp3 encode to MP3 format (default)\n");
|
||||
@@ -56,8 +56,12 @@ void showhelp(char *exename)
|
||||
printf(" --silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf(" [params] optional arguments passed directly to the encoder\n");
|
||||
printf(" recommended is: --best -b 1152\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n --help this help message\n");
|
||||
|
||||
@@ -104,7 +108,7 @@ int main(int argc, char *argv[]) {
|
||||
uint32 indexSize;
|
||||
uint32 totalSize;
|
||||
uint32 length;
|
||||
|
||||
|
||||
if (argc < 2)
|
||||
showhelp(argv[0]);
|
||||
i = 1;
|
||||
|
||||
+8
-3
@@ -158,9 +158,10 @@ static void compress_sound_data() {
|
||||
}
|
||||
|
||||
static void showhelp(const char *exename) {
|
||||
printf("\nUsage: %s <params> input_directory\n", exename);
|
||||
printf("\nUsage: %s [params] <inputdir>\n", exename);
|
||||
|
||||
printf("\nParams:\n");
|
||||
|
||||
printf(" --mp3 encode to MP3 format (default)\n");
|
||||
printf(" --vorbis encode to Vorbis format\n");
|
||||
printf(" --flac encode to Flac format\n");
|
||||
@@ -183,8 +184,12 @@ static void showhelp(const char *exename) {
|
||||
printf(" --silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf(" [params] optional arguments passed directly to the encoder\n");
|
||||
printf(" recommended is: --best -b 1152\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n --help this help message\n");
|
||||
|
||||
|
||||
+7
-4
@@ -699,7 +699,7 @@ void convertWAV(char *wavName, char *prefix) {
|
||||
}
|
||||
|
||||
void showhelp(char *exename) {
|
||||
printf("\nUsage: %s <inputfile> \n", exename);
|
||||
printf("\nUsage: %s <params> <file>\n", exename);
|
||||
|
||||
printf("\nParams:\n");
|
||||
printf(" --mp3 encode to MP3 format (default)\n");
|
||||
@@ -724,14 +724,17 @@ void showhelp(char *exename) {
|
||||
printf(" --silent the output of oggenc is hidden (default:disabled)\n");
|
||||
|
||||
printf("\nFlac mode params:\n");
|
||||
printf(" [params] optional arguments passed directly to the encoder\n");
|
||||
printf(" recommended is: --best -b 1152\n");
|
||||
printf(" --fast FLAC uses compresion level 0\n");
|
||||
printf(" --best FLAC uses compresion level 8\n");
|
||||
printf(" -<value> specifies the value (0 - 8) of compresion (8=best)(default:%d)\n", flacCompressDef);
|
||||
printf(" -b <value> specifies a blocksize of <value> samples (default:%d)\n", flacBlocksizeDef);
|
||||
printf(" --verify files are encoded and then decoded to check accuracy\n");
|
||||
printf(" --silent the output of FLAC is hidden (default:disabled)\n");
|
||||
|
||||
printf("\n --help this help message\n");
|
||||
|
||||
printf("\n\nIf a parameter is not given the default value is used\n");
|
||||
printf("If using VBR mode for MP3 -b and -B must be multiples of 8; the maximum is 160!\n");
|
||||
printf("Use the `mac' option instead of a filename if converting simon2mac sounds\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user