Mercurial > hg > dmlib
diff tools/mod2wav.c @ 2408:60e119262c67
Option index re-ordering cleanup work.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 13 Jan 2020 21:21:25 +0200 |
parents | b7cd5dd0b82e |
children | bc05bcfc4598 |
line wrap: on
line diff
--- a/tools/mod2wav.c Mon Jan 13 21:16:57 2020 +0200 +++ b/tools/mod2wav.c Mon Jan 13 21:21:25 2020 +0200 @@ -64,22 +64,30 @@ static const DMOptArg optList[] = { - { 0, '?', "help", "Show this help", OPT_NONE }, - { 2, 'v', "verbose", "Be more verbose", OPT_NONE }, - { 3, '1', "16bit", "16-bit output", OPT_NONE }, - { 4, '8', "8bit", "8-bit output", OPT_NONE }, - { 5, 'm', "mono", "Mono output", OPT_NONE }, - { 6, 's', "stereo", "Stereo output", OPT_NONE }, - { 7, 'f', "freq", "Output frequency", OPT_ARGREQ }, - { 8, 'M', "mute", "Mute other channels than #", OPT_ARGREQ }, - { 9, 'o', "order", "Start from order #", OPT_ARGREQ }, - { 10, 't', "time", "Play for # seconds", OPT_ARGREQ }, -// {10, 'l', "loop", "Loop for # times", OPT_ARGREQ }, + { 0, '?', "help" , "Show this help", OPT_NONE }, + { 2, 'v', "verbose" , "Be more verbose", OPT_NONE }, + + { 10, '1', "16bit" , "16-bit output", OPT_NONE }, + { 12, '8', "8bit" , "8-bit output", OPT_NONE }, + { 14, 'm', "mono" , "Mono output", OPT_NONE }, + { 16, 's', "stereo" , "Stereo output", OPT_NONE }, + { 18, 'f', "freq" , "Output frequency", OPT_ARGREQ }, + { 20, 'M', "mute" , "Mute other channels than #", OPT_ARGREQ }, + { 22, 'o', "order" , "Start from order #", OPT_ARGREQ }, + { 24, 't', "time" , "Play for # seconds", OPT_ARGREQ }, +// { 26, 'l', "loop" , "Loop for # times", OPT_ARGREQ }, }; const int optListN = sizeof(optList) / sizeof(optList[0]); +void argShowHelp() +{ + dmPrintBanner(stdout, dmProgName, "[options] [sourcefile] [destfile.wav]"); + dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2); +} + + BOOL argHandleOpt(const int optN, char *optArg, char *currArg) { (void) optArg; @@ -87,10 +95,7 @@ switch (optN) { case 0: - dmPrintBanner(stdout, dmProgName, - "[options] [sourcefile] [destfile.wav]"); - - dmArgsPrintHelp(stdout, optList, optListN, 0, 80 - 2); + argShowHelp(); exit(0); break; @@ -98,35 +103,35 @@ dmVerbosity++; break; - case 3: + case 10: optOutFormat = JSS_AUDIO_S16; break; - case 4: + case 12: optOutFormat = JSS_AUDIO_U8; break; - case 5: + case 14: optOutChannels = JSS_AUDIO_MONO; break; - case 6: + case 16: optOutChannels = JSS_AUDIO_STEREO; break; - case 7: + case 18: optOutFreq = atoi(optArg); break; - case 8: + case 20: optMuteOChannels = atoi(optArg); break; - case 9: + case 22: optStartOrder = atoi(optArg); break; - case 10: + case 24: optPlayTime = atoi(optArg); optUsePlayTime = TRUE; break;