Changeset 91453 in vbox for trunk/src/VBox
- Timestamp:
- Sep 29, 2021 9:43:40 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/audio/vkatCmdGeneric.cpp
r91452 r91453 536 536 enum 537 537 { 538 VKAT_PLAY_OPT_VOL = 900 538 VKAT_PLAY_OPT_TONE_DUR = 900, 539 VKAT_PLAY_OPT_TONE_FREQ, 540 VKAT_PLAY_OPT_VOL 539 541 }; 540 542 … … 551 553 { "--sample-size", 'z', RTGETOPT_REQ_UINT8 }, 552 554 { "--test-tone", 't', RTGETOPT_REQ_NOTHING }, 555 { "--tone-dur", VKAT_PLAY_OPT_TONE_DUR, RTGETOPT_REQ_UINT32 }, 556 { "--tone-freq", VKAT_PLAY_OPT_TONE_FREQ, RTGETOPT_REQ_UINT32 }, 553 557 { "--output-device", 'o', RTGETOPT_REQ_STRING }, 554 558 { "--with-drv-audio", 'd', RTGETOPT_REQ_NOTHING }, 555 559 { "--with-mixer", 'm', RTGETOPT_REQ_NOTHING }, 556 { "--vol", VKAT_PLAY_OPT_VOL, RTGETOPT_REQ_UINT8 } ,560 { "--vol", VKAT_PLAY_OPT_VOL, RTGETOPT_REQ_UINT8 } 557 561 }; 558 562 … … 563 567 switch (pOpt->iShort) 564 568 { 565 case 'b': return "The audio backend to use"; 566 case 'c': return "Number of backend output channels"; 567 case 'd': return "Go via DrvAudio instead of directly interfacing with the backend"; 568 case 'f': return "Output frequency (Hz)"; 569 case 'z': return "Output sample size (bits)"; 570 case 't': return "Plays a test tone. Can be specified multiple times"; 571 case 'm': return "Go via the mixer"; 572 case 'o': return "The ID of the output device to use"; 573 case VKAT_PLAY_OPT_VOL: return "Volume (in percent, 0-100) to use"; 574 default: return NULL; 569 case 'b': return "The audio backend to use"; 570 case 'c': return "Number of backend output channels"; 571 case 'd': return "Go via DrvAudio instead of directly interfacing with the backend"; 572 case 'f': return "Output frequency (Hz)"; 573 case 'z': return "Output sample size (bits)"; 574 case 't': return "Plays a test tone. Can be specified multiple times"; 575 case 'm': return "Go via the mixer"; 576 case 'o': return "The ID of the output device to use"; 577 case VKAT_PLAY_OPT_TONE_DUR: return "Test tone duration (ms)"; 578 case VKAT_PLAY_OPT_TONE_FREQ: return "Test tone frequency (Hz)"; 579 case VKAT_PLAY_OPT_VOL: return "Volume (in percent, 0-100) to use"; 580 default: return NULL; 575 581 } 576 582 } … … 598 604 PlayOpts.uVolumePercent = 100; /* Use maximum volume by default. */ 599 605 606 AUDIOTESTTONEPARMS ToneParms; 607 RT_ZERO(ToneParms); 608 609 ToneParms.dbFreqHz = AudioTestToneGetRandomFreq(); 610 ToneParms.msDuration = RTRandU32Ex(0, RT_MS_10SEC); /** @todo Probably a bit too long, but let's see. */ 611 600 612 /* Argument processing loop: */ 601 613 int ch; … … 639 651 break; 640 652 653 case VKAT_PLAY_OPT_TONE_DUR: 654 ToneParms.msDuration = ValueUnion.u32; 655 break; 656 657 case VKAT_PLAY_OPT_TONE_FREQ: 658 ToneParms.dbFreqHz = ValueUnion.u32; 659 break; 660 641 661 case VKAT_PLAY_OPT_VOL: 642 662 PlayOpts.uVolumePercent = ValueUnion.u8; … … 670 690 while (cTestTones--) 671 691 { 672 AUDIOTESTTONEPARMS ToneParms;673 RT_ZERO(ToneParms);674 675 692 /* Use some sane defaults if no PCM props are set by the user. */ 676 693 PDMAudioPropsInit(&ToneParms.Props, … … 678 695 cChannels ? cChannels : 2 /* Stereo */, uHz ? uHz : 44100); 679 696 680 ToneParms.dbFreqHz = AudioTestToneGetRandomFreq();681 ToneParms.msPrequel = 0; /** @todo Implement analyzing this first! */682 #ifdef DEBUG_andy683 ToneParms.msDuration = RTRandU32Ex(50, 2500);684 #else685 ToneParms.msDuration = RTRandU32Ex(0, RT_MS_10SEC); /** @todo Probably a bit too long, but let's see. */686 #endif687 ToneParms.msSequel = 0; /** @todo Implement analyzing this first! */688 697 ToneParms.uVolumePercent = PlayOpts.uVolumePercent; 689 698
Note:
See TracChangeset
for help on using the changeset viewer.