Changeset 89091 in vbox for trunk/src/VBox/ValidationKit/utils/audio
- Timestamp:
- May 17, 2021 11:11:09 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp
r89086 r89091 71 71 *********************************************************************************************************************************/ 72 72 /** For use in the option switch to handle common options. */ 73 #define AUDIO_TEST_COMMON_OPTION_CASES( ) \73 #define AUDIO_TEST_COMMON_OPTION_CASES(a_ValueUnion) \ 74 74 case 'q': \ 75 75 g_uVerbosity = 0; \ … … 84 84 \ 85 85 case 'h': \ 86 return audioTestUsage(g_pStdOut) 87 86 return audioTestUsage(g_pStdOut); \ 87 \ 88 case AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_ENABLE: \ 89 g_fDrvAudioDebug = true; \ 90 break; \ 91 \ 92 case AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_PATH: \ 93 g_pszDrvAudioDebug = (a_ValueUnion).psz; \ 94 break 88 95 89 96 … … 219 226 *********************************************************************************************************************************/ 220 227 /** 221 * Enumeration of test ("test") command line parameters. 228 * Common long options values. 229 */ 230 enum 231 { 232 AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_ENABLE = 256, 233 AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_PATH 234 }; 235 236 /** 237 * Long option values for the 'test' command. 222 238 */ 223 239 enum … … 237 253 238 254 /** 239 * Enumeration of verification ("verify") command line parameters.255 * Long option values for the 'verify' command. 240 256 */ 241 257 enum … … 249 265 static const RTGETOPTDEF g_aCmdCommonOptions[] = 250 266 { 251 { "--quiet", 'q', RTGETOPT_REQ_NOTHING }, 252 { "--verbose", 'v', RTGETOPT_REQ_NOTHING }, 267 { "--quiet", 'q', RTGETOPT_REQ_NOTHING }, 268 { "--verbose", 'v', RTGETOPT_REQ_NOTHING }, 269 { "--debug-audio", AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_ENABLE, RTGETOPT_REQ_NOTHING }, 270 { "--debug-audio-path", AUDIO_TEST_OPT_CMN_DEBUG_AUDIO_PATH, RTGETOPT_REQ_STRING }, 253 271 }; 254 272 … … 327 345 /** The current verbosity level. */ 328 346 static unsigned g_uVerbosity = 0; 347 /** DrvAudio: Enable debug (or not). */ 348 static bool g_fDrvAudioDebug = 0; 349 /** DrvAudio: The debug output path. */ 350 static const char *g_pszDrvAudioDebug = NULL; 329 351 330 352 … … 382 404 VMMR3DECL(int) CFGMR3QueryStringDef(PCFGMNODE pNode, const char *pszName, char *pszString, size_t cchString, const char *pszDef) 383 405 { 406 PCPDMDRVREG pDrvReg = (PCPDMDRVREG)pNode; 407 if (RT_VALID_PTR(pDrvReg)) 408 { 409 const char *pszRet = pszDef; 410 if ( strcmp(pDrvReg->szName, "AUDIO") == 0 411 && strcmp(pszName, "DebugPathOut") == 0) 412 pszRet = g_pszDrvAudioDebug; 413 414 int rc = RTStrCopy(pszString, cchString, pszRet); 415 416 if (g_uVerbosity > 2) 417 RTPrintf("debug: CFGMR3QueryStringDef([%s], %s, %p, %#x, %s) -> '%s' + %Rrc\n", 418 pDrvReg->szName, pszName, pszString, cchString, pszDef, pszRet, rc); 419 return rc; 420 } 421 384 422 if (g_uVerbosity > 2) 385 423 RTPrintf("debug: CFGMR3QueryStringDef(%p, %s, %p, %#x, %s)\n", pNode, pszName, pszString, cchString, pszDef); … … 389 427 VMMR3DECL(int) CFGMR3QueryBoolDef(PCFGMNODE pNode, const char *pszName, bool *pf, bool fDef) 390 428 { 391 RT_NOREF(pNode, pszName, pf); 392 return fDef; 429 PCPDMDRVREG pDrvReg = (PCPDMDRVREG)pNode; 430 if (RT_VALID_PTR(pDrvReg)) 431 { 432 *pf = fDef; 433 if ( strcmp(pDrvReg->szName, "AUDIO") == 0 434 && strcmp(pszName, "DebugEnabled") == 0) 435 *pf = g_fDrvAudioDebug; 436 437 if (g_uVerbosity > 2) 438 RTPrintf("debug: CFGMR3QueryBoolDef([%s], %s, %p, %RTbool) -> %RTbool\n", pDrvReg->szName, pszName, pf, fDef, *pf); 439 return VINF_SUCCESS; 440 } 441 *pf = fDef; 442 return VINF_SUCCESS; 393 443 } 394 444 … … 1792 1842 break; 1793 1843 1794 AUDIO_TEST_COMMON_OPTION_CASES( );1844 AUDIO_TEST_COMMON_OPTION_CASES(ValueUnion); 1795 1845 1796 1846 default: … … 1929 1979 break; 1930 1980 1931 AUDIO_TEST_COMMON_OPTION_CASES( );1981 AUDIO_TEST_COMMON_OPTION_CASES(ValueUnion); 1932 1982 1933 1983 default: … … 2163 2213 } 2164 2214 2165 AUDIO_TEST_COMMON_OPTION_CASES( );2215 AUDIO_TEST_COMMON_OPTION_CASES(ValueUnion); 2166 2216 2167 2217 default: … … 2220 2270 "\n" 2221 2271 "Global Options:\n" 2272 " --debug-audio\n" 2273 " Enables DrvAudio debugging.\n" 2274 " --debug-audio-path=<path>\n" 2275 " Tells DrvAudio where to put its debug output (wav-files).\n" 2222 2276 " -q, --quiet\n" 2223 2277 " Sets verbosity to zero.\n"
Note:
See TracChangeset
for help on using the changeset viewer.