Mercurial > hg > dmlib
comparison tools/ppl.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 |
comparison
equal
deleted
inserted
replaced
2407:c5a32812dd97 | 2408:60e119262c67 |
---|---|
66 size_t optPlayTime; | 66 size_t optPlayTime; |
67 | 67 |
68 | 68 |
69 static const DMOptArg optList[] = | 69 static const DMOptArg optList[] = |
70 { | 70 { |
71 { 0, '?', "help", "Show this help", OPT_NONE }, | 71 { 0, '?', "help" , "Show this help", OPT_NONE }, |
72 { 1, 'v', "verbose", "Be more verbose", OPT_NONE }, | 72 { 2, 'v', "verbose" , "Be more verbose", OPT_NONE }, |
73 { 2, 0, "fs", "Fullscreen", OPT_NONE }, | 73 |
74 { 12, 'C', "cli", "Do not open GUI window", OPT_NONE }, | 74 { 10, 0, "fs" , "Fullscreen", OPT_NONE }, |
75 { 3, 'w', "window", "Initial window size/resolution -w 640x480", OPT_ARGREQ }, | 75 { 12, 'C', "cli" , "Do not open GUI window", OPT_NONE }, |
76 | 76 { 14, 'w', "window" , "Initial window size/resolution -w 640x480", OPT_ARGREQ }, |
77 { 4, '1', "16bit", "16-bit output", OPT_NONE }, | 77 |
78 { 5, '8', "8bit", "8-bit output", OPT_NONE }, | 78 { 16, '1', "16bit" , "16-bit output", OPT_NONE }, |
79 { 6, 'm', "mono", "Mono output", OPT_NONE }, | 79 { 18, '8', "8bit" , "8-bit output", OPT_NONE }, |
80 { 7, 's', "stereo", "Stereo output", OPT_NONE }, | 80 { 20, 'm', "mono" , "Mono output", OPT_NONE }, |
81 { 8, 'f', "freq", "Output frequency", OPT_ARGREQ }, | 81 { 22, 's', "stereo" , "Stereo output", OPT_NONE }, |
82 | 82 { 24, 'f', "freq" , "Output frequency", OPT_ARGREQ }, |
83 { 9, 'M', "mute", "Mute other channels than #", OPT_ARGREQ }, | 83 |
84 { 10, 'o', "order", "Start from order #", OPT_ARGREQ }, | 84 { 28, 'M', "mute" , "Mute other channels than #", OPT_ARGREQ }, |
85 { 11, 't', "time", "Play for # seconds", OPT_ARGREQ }, | 85 { 30, 'o', "order" , "Start from order #", OPT_ARGREQ }, |
86 { 32, 't', "time" , "Play for # seconds", OPT_ARGREQ }, | |
86 }; | 87 }; |
87 | 88 |
88 const int optListN = sizeof(optList) / sizeof(optList[0]); | 89 const int optListN = sizeof(optList) / sizeof(optList[0]); |
89 | 90 |
90 | 91 |
95 } | 96 } |
96 | 97 |
97 | 98 |
98 BOOL argHandleOpt(const int optN, char *optArg, char *currArg) | 99 BOOL argHandleOpt(const int optN, char *optArg, char *currArg) |
99 { | 100 { |
100 switch (optN) { | 101 switch (optN) |
102 { | |
101 case 0: | 103 case 0: |
102 argShowHelp(); | 104 argShowHelp(); |
103 exit(0); | 105 exit(0); |
104 break; | 106 break; |
105 | 107 |
106 case 1: | 108 case 2: |
107 dmVerbosity++; | 109 dmVerbosity++; |
108 break; | 110 break; |
109 | 111 |
110 case 2: | 112 case 10: |
111 eng.optVFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; | 113 eng.optVFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; |
112 break; | 114 break; |
113 | 115 |
114 case 3: | 116 case 12: |
117 optUseGUI = FALSE; | |
118 break; | |
119 | |
120 case 14: | |
115 { | 121 { |
116 int w, h; | 122 int w, h; |
117 if (sscanf(optArg, "%dx%d", &w, &h) == 2) | 123 if (sscanf(optArg, "%dx%d", &w, &h) == 2) |
118 { | 124 { |
119 if (w < 320 || h < 200 || w > 3200 || h > 3200) | 125 if (w < 320 || h < 200 || w > 3200 || h > 3200) |
130 return FALSE; | 136 return FALSE; |
131 } | 137 } |
132 } | 138 } |
133 break; | 139 break; |
134 | 140 |
135 case 4: | 141 case 16: |
136 optOutFormat = JSS_AUDIO_S16; | 142 optOutFormat = JSS_AUDIO_S16; |
137 break; | 143 break; |
138 | 144 |
139 case 5: | 145 case 18: |
140 optOutFormat = JSS_AUDIO_U8; | 146 optOutFormat = JSS_AUDIO_U8; |
141 break; | 147 break; |
142 | 148 |
143 case 6: | 149 case 20: |
144 optOutChannels = JSS_AUDIO_MONO; | 150 optOutChannels = JSS_AUDIO_MONO; |
145 break; | 151 break; |
146 | 152 |
147 case 7: | 153 case 22: |
148 optOutChannels = JSS_AUDIO_STEREO; | 154 optOutChannels = JSS_AUDIO_STEREO; |
149 break; | 155 break; |
150 | 156 |
151 case 8: | 157 case 24: |
152 optOutFreq = atoi(optArg); | 158 optOutFreq = atoi(optArg); |
153 break; | 159 break; |
154 | 160 |
155 case 9: | 161 case 28: |
156 optMuteOChannels = atoi(optArg); | 162 optMuteOChannels = atoi(optArg); |
157 break; | 163 break; |
158 | 164 |
159 case 10: | 165 case 30: |
160 optStartOrder = atoi(optArg); | 166 optStartOrder = atoi(optArg); |
161 break; | 167 break; |
162 | 168 |
163 case 11: | 169 case 32: |
164 optPlayTime = atoi(optArg); | 170 optPlayTime = atoi(optArg); |
165 optUsePlayTime = TRUE; | 171 optUsePlayTime = TRUE; |
166 break; | |
167 | |
168 case 12: | |
169 optUseGUI = FALSE; | |
170 break; | 172 break; |
171 | 173 |
172 default: | 174 default: |
173 dmErrorMsg("Unimplemented option argument '%s'.\n", currArg); | 175 dmErrorMsg("Unimplemented option argument '%s'.\n", currArg); |
174 return FALSE; | 176 return FALSE; |