Changeset 88216 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 20, 2021 1:50:05 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143381
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r88211 r88216 3599 3599 HRESULT hrc; 3600 3600 3601 Utf8Str strTmp;3602 GetExtraDataBoth(pVirtualBox, pMachine, "VBoxInternal2/Audio/Debug/Enabled", &strTmp);3603 const uint64_t fDebugEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1");3604 3605 3601 BOOL fAudioEnabledIn = FALSE; 3606 3602 hrc = pAudioAdapter->COMGETTER(EnabledIn)(&fAudioEnabledIn); H(); … … 3616 3612 InsertConfigInteger(pCfg, "OutputEnabled", fAudioEnabledOut); 3617 3613 3614 Utf8Str strTmp; 3615 GetExtraDataBoth(pVirtualBox, pMachine, "VBoxInternal2/Audio/Debug/Enabled", &strTmp); 3616 const uint64_t fDebugEnabled = strTmp.equalsIgnoreCase("true") || strTmp.equalsIgnoreCase("1"); 3618 3617 if (fDebugEnabled) 3619 3618 { … … 3630 3629 * And global ones for all host drivers: VBoxInternal2/Audio/<Value> 3631 3630 */ 3632 static const struct3631 for (unsigned iDir = 0; iDir < 2; iDir++) 3633 3632 { 3634 const char *pszExtraName; 3635 const char *pszCfgmName; 3636 uint32_t uDefault; 3637 } s_aToCopy[] 3638 { 3639 #define AUDIO_DRV_TO_COPY_ENTRIES(a_szDir) \ 3640 /* PCM parameters: */ \ 3641 { "PCMSampleBit" a_szDir, "PCMSampleBit" a_szDir, 0 }, \ 3642 { "PCMSampleHz" a_szDir, "PCMSampleHz" a_szDir, 0 }, \ 3643 { "PCMSampleSigned" a_szDir, "PCMSampleSigned" a_szDir, UINT8_MAX }, \ 3644 { "PCMSampleSwapEndian" a_szDir, "PCMSampleSwapEndian" a_szDir, UINT8_MAX }, \ 3645 { "PCMSampleChannels" a_szDir, "PCMSampleChannels" a_szDir, 0 }, \ 3646 /* Buffering stuff: */ \ 3647 { "PeriodSizeMs" a_szDir, "PeriodSizeMs" a_szDir, 0 }, \ 3648 { "BufferSizeMs" a_szDir, "BufferSizeMs" a_szDir, 0 }, \ 3649 { "PreBufferSizeMs" a_szDir, "PreBufferSizeMs" a_szDir, UINT32_MAX } 3650 AUDIO_DRV_TO_COPY_ENTRIES("In"), 3651 AUDIO_DRV_TO_COPY_ENTRIES("Out") 3652 #undef AUDIO_DRV_TO_COPY_ENTRIES 3653 }; 3654 for (size_t i = 0; i < RT_ELEMENTS(s_aToCopy); i++) 3655 { 3656 char szExtra[128]; 3657 RTStrPrintf(szExtra, sizeof(szExtra), "VBoxInternal2/Audio/%s/%s", pszDrvName, s_aToCopy[i].pszExtraName); 3658 GetExtraDataBoth(pVirtualBox, pMachine, szExtra, &strTmp); /* throws hrc */ 3659 if (strTmp.isEmpty()) 3660 { 3661 RTStrPrintf(szExtra, sizeof(szExtra), "VBoxInternal2/Audio/%s", s_aToCopy[i].pszExtraName); 3662 GetExtraDataBoth(pVirtualBox, pMachine, szExtra, &strTmp); 3633 static const struct 3634 { 3635 const char *pszExtraName; 3636 const char *pszCfgmName; 3637 } s_aToCopy[] = 3638 { /* PCM parameters: */ 3639 { "PCMSampleBit", "PCMSampleBit" }, 3640 { "PCMSampleHz", "PCMSampleHz" }, 3641 { "PCMSampleSigned", "PCMSampleSigned" }, 3642 { "PCMSampleSwapEndian", "PCMSampleSwapEndian" }, 3643 { "PCMSampleChannels", "PCMSampleChannels" }, 3644 /* Buffering stuff: */ 3645 { "PeriodSizeMs", "PeriodSizeMs" }, 3646 { "BufferSizeMs", "BufferSizeMs" }, 3647 { "PreBufferSizeMs", "PreBufferSizeMs" }, 3648 }; 3649 3650 PCFGMNODE pDirNode = NULL; 3651 const char *pszDir = iDir == 0 ? "In" : "Out"; 3652 for (size_t i = 0; i < RT_ELEMENTS(s_aToCopy); i++) 3653 { 3654 char szExtra[128]; 3655 RTStrPrintf(szExtra, sizeof(szExtra), "VBoxInternal2/Audio/%s/%s%s", pszDrvName, s_aToCopy[i].pszExtraName, pszDir); 3656 GetExtraDataBoth(pVirtualBox, pMachine, szExtra, &strTmp); /* throws hrc */ 3663 3657 if (strTmp.isEmpty()) 3664 continue; 3665 } 3666 3667 uint32_t uValue; 3668 int vrc = RTStrToUInt32Full(strTmp.c_str(), 0, &uValue); 3669 if (RT_SUCCESS(vrc)) 3670 InsertConfigInteger(pCfg, s_aToCopy[i].pszCfgmName, uValue); 3671 else 3672 LogRel(("Ignoring malformed 32-bit unsigned integer config value '%s' = '%s': %Rrc\n", szExtra, strTmp.c_str(), vrc)); 3658 { 3659 RTStrPrintf(szExtra, sizeof(szExtra), "VBoxInternal2/Audio/%s%s", s_aToCopy[i].pszExtraName, pszDir); 3660 GetExtraDataBoth(pVirtualBox, pMachine, szExtra, &strTmp); 3661 if (strTmp.isEmpty()) 3662 continue; 3663 } 3664 3665 uint32_t uValue; 3666 int vrc = RTStrToUInt32Full(strTmp.c_str(), 0, &uValue); 3667 if (RT_SUCCESS(vrc)) 3668 { 3669 if (!pDirNode) 3670 InsertConfigNode(pCfg, pszDir, &pDirNode); 3671 InsertConfigInteger(pDirNode, s_aToCopy[i].pszCfgmName, uValue); 3672 } 3673 else 3674 LogRel(("Ignoring malformed 32-bit unsigned integer config value '%s' = '%s': %Rrc\n", szExtra, strTmp.c_str(), vrc)); 3675 } 3673 3676 } 3674 3677
Note:
See TracChangeset
for help on using the changeset viewer.