Changeset 792 for trunk/Utilities/EnumerateAudioDevices
- Timestamp:
- Dec 12, 2017, 5:26:03 AM (6 years ago)
- Location:
- trunk/Utilities/EnumerateAudioDevices
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/EnumerateAudioDevices
- Property svn:ignore
-
old new 4 4 *.user 5 5 ipch 6 .vs
-
- Property svn:ignore
-
trunk/Utilities/EnumerateAudioDevices/EnumerateAudioDevices.vcxproj
r619 r792 22 22 <ProjectGuid>{1AB74749-013C-4258-8B40-CB8B2E44F2B7}</ProjectGuid> 23 23 <RootNamespace>EnumerateAudioDevices</RootNamespace> 24 <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion> 24 25 </PropertyGroup> 25 26 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> … … 29 30 <CharacterSet>Unicode</CharacterSet> 30 31 <WholeProgramOptimization>true</WholeProgramOptimization> 31 <PlatformToolset>v1 20_xp</PlatformToolset>32 <PlatformToolset>v141</PlatformToolset> 32 33 </PropertyGroup> 33 34 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> 34 35 <ConfigurationType>Application</ConfigurationType> 35 36 <CharacterSet>Unicode</CharacterSet> 36 <PlatformToolset>v1 20_xp</PlatformToolset>37 <PlatformToolset>v141</PlatformToolset> 37 38 </PropertyGroup> 38 39 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> … … 41 42 <CharacterSet>Unicode</CharacterSet> 42 43 <WholeProgramOptimization>true</WholeProgramOptimization> 43 <PlatformToolset>v1 20_xp</PlatformToolset>44 <PlatformToolset>v141</PlatformToolset> 44 45 </PropertyGroup> 45 46 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> 46 47 <ConfigurationType>Application</ConfigurationType> 47 48 <CharacterSet>Unicode</CharacterSet> 48 <PlatformToolset>v1 20_xp</PlatformToolset>49 <PlatformToolset>v141</PlatformToolset> 49 50 </PropertyGroup> 50 51 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> … … 101 102 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(WindowsSdkDir)lib\x64;$(LibraryPath)</LibraryPath> 102 103 </PropertyGroup> 104 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 105 <PostBuildEventUseInBuild>false</PostBuildEventUseInBuild> 106 </PropertyGroup> 107 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 108 <PostBuildEventUseInBuild>false</PostBuildEventUseInBuild> 109 </PropertyGroup> 110 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> 111 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> 103 112 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 104 113 <Midl> … … 140 149 </DataExecutionPrevention> 141 150 <TargetMachine>MachineX86</TargetMachine> 142 <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>143 151 </Link> 144 152 <PostBuildEvent> 145 <Message>Performing registration...</Message> 146 <Command>"$(TargetPath)" /RegServer</Command> 153 <Message>COM Registration, Build Increment, Digital Signature</Message> 154 <Command>rem "$(TargetPath)" /RegServer 155 "$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)" 156 "$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)" 157 </Command> 147 158 </PostBuildEvent> 148 159 </ItemDefinitionGroup> … … 188 199 </Link> 189 200 <PostBuildEvent> 190 <Message>Performing registration...</Message> 191 <Command>"$(TargetPath)" /RegServer</Command> 201 <Message>COM Registration, Build Increment, Digital Signature</Message> 202 <Command>rem "$(TargetPath)" /RegServer 203 "$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)" 204 "$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)" 205 </Command> 192 206 </PostBuildEvent> 193 207 </ItemDefinitionGroup> … … 238 252 </DataExecutionPrevention> 239 253 <TargetMachine>MachineX86</TargetMachine> 240 <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>241 254 </Link> 242 255 <PostBuildEvent> 243 <Message>Performing registration...</Message> 244 <Command>"$(TargetPath)" /RegServer</Command> 256 <Message>COM Registration, Build Increment, Digital Signature</Message> 257 <Command>rem "$(TargetPath)" /RegServer 258 "$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)" 259 "$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)" 260 </Command> 245 261 </PostBuildEvent> 262 <Manifest> 263 <OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile> 264 </Manifest> 265 <ManifestResourceCompile> 266 <ResourceOutputFileName>$(IntDir)$(TargetName)$(TargetExt).embed.manifest.res</ResourceOutputFileName> 267 </ManifestResourceCompile> 246 268 </ItemDefinitionGroup> 247 269 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> … … 293 315 </Link> 294 316 <PostBuildEvent> 295 <Message>Performing registration...</Message> 296 <Command>"$(TargetPath)" /RegServer</Command> 317 <Message>COM Registration, Build Increment, Digital Signature</Message> 318 <Command>rem "$(TargetPath)" /RegServer 319 "$(AlaxInfo_Common)\..\Utilities\IncrementBuild\_Bin\IncrementBuild-$(PlatformName).exe" configuration "$(ProjectDir)Module.ini" binary "$(TargetPath)" string "ConfigurationName" "$(ConfigurationName)" 320 "$(WindowsSdkDir)bin\x64\signtool" sign /v /f "$(AlaxInfo_Common)\Certificate\PrivateSPC.pfx" /d "Alax.Info $(ProjectName) Application" /du http://alax.info /n "Roman Ryltsov" "$(TargetPath)" 321 </Command> 297 322 </PostBuildEvent> 323 <Manifest> 324 <OutputManifestFile>$(IntDir)$(TargetName)$(TargetExt).embed.manifest</OutputManifestFile> 325 </Manifest> 326 <ManifestResourceCompile> 327 <ResourceOutputFileName>$(IntDir)$(TargetName)$(TargetExt).embed.manifest.res</ResourceOutputFileName> 328 </ManifestResourceCompile> 298 329 </ItemDefinitionGroup> 299 330 <ItemGroup> … … 317 348 <ResourceCompile Include="Module.rc" /> 318 349 </ItemGroup> 350 <ItemGroup> 351 <Manifest Include="Application.manifest" /> 352 </ItemGroup> 319 353 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> 320 354 <ImportGroup Label="ExtensionTargets"> -
trunk/Utilities/EnumerateAudioDevices/EnumerateAudioDevices.vcxproj.filters
r619 r792 44 44 </ResourceCompile> 45 45 </ItemGroup> 46 <ItemGroup> 47 <Manifest Include="Application.manifest"> 48 <Filter>Resource Files</Filter> 49 </Manifest> 50 </ItemGroup> 46 51 </Project> -
trunk/Utilities/EnumerateAudioDevices/MainDialog.h
r619 r792 6 6 7 7 #include "rodshow.h" 8 #include "romf.h" 8 9 #include <mmdeviceapi.h> 9 10 #include <mmreg.h> … … 43 44 44 45 private: 46 CDpiAwareness m_DpiAwareness; 47 CFont m_TextFont; 45 48 CRoEdit m_TextEdit; 49 CFont m_ButtonFont; 50 CButton m_CloseButton; 46 51 47 52 public: … … 64 69 return FALSE; 65 70 } 71 static VOID FormatWaveFormatEx(const WAVEFORMATEX* pWaveFormatEx, SIZE_T nWaveFormatExSize, CRoArrayT<CString>& Array) 72 { 73 _A(nWaveFormatExSize >= sizeof (WAVEFORMATEX)); 74 Array.Add(AtlFormatString(_T("wFormatTag 0x%02X"), pWaveFormatEx->wFormatTag)); 75 Array.Add(AtlFormatString(_T("nChannels %d"), pWaveFormatEx->nChannels)); 76 Array.Add(AtlFormatString(_T("nSamplesPerSec %d"), pWaveFormatEx->nSamplesPerSec)); 77 Array.Add(AtlFormatString(_T("nAvgBytesPerSec %d"), pWaveFormatEx->nAvgBytesPerSec)); 78 Array.Add(AtlFormatString(_T("nBlockAlign %d"), pWaveFormatEx->nBlockAlign)); 79 Array.Add(AtlFormatString(_T("wBitsPerSample %d"), pWaveFormatEx->wBitsPerSample)); 80 Array.Add(AtlFormatString(_T("cbSize %d"), pWaveFormatEx->cbSize)); 81 if(nWaveFormatExSize < sizeof (WAVEFORMATEXTENSIBLE) || pWaveFormatEx->wFormatTag != WAVE_FORMAT_EXTENSIBLE) 82 return; 83 const WAVEFORMATEXTENSIBLE* pWaveFormatExtensible = (const WAVEFORMATEXTENSIBLE*) pWaveFormatEx; 84 Array.Add(AtlFormatString(_T("wValidBitsPerSample %d"), pWaveFormatExtensible->Samples.wValidBitsPerSample)); 85 Array.Add(AtlFormatString(_T("dwChannelMask 0x%02X"), pWaveFormatExtensible->dwChannelMask)); 86 Array.Add(AtlFormatString(_T("SubFormat %ls"), _PersistHelper::StringFromIdentifier(pWaveFormatExtensible->SubFormat))); 87 } 66 88 67 89 // Window Message Handler 68 90 LRESULT OnInitDialog(HWND, LPARAM) 69 91 { 70 SetIcon(AtlLoadIcon(IDI_MODULE), TRUE); 92 DlgResize_Init(); 93 SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)), TRUE); 71 94 SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)), FALSE); 72 95 CMenuHandle Menu = GetSystemMenu(FALSE); 73 96 _W(Menu.AppendMenu(MF_SEPARATOR)); 74 97 _W(Menu.AppendMenu(MF_STRING, ID_APP_ABOUT, _T("&About..."))); 75 DlgResize_Init();76 98 CAboutDialog::UpdateCaption(*this); 99 m_TextEdit = GetDlgItem(IDC_TEXT); 100 m_TextFont = m_DpiAwareness.ScaleFont(m_TextEdit.GetFont(), 11); 101 m_TextEdit.SetFont(m_TextFont); 102 m_CloseButton = GetDlgItem(IDOK); 103 m_ButtonFont = m_DpiAwareness.ScaleFont(GetFont(), 9); 104 m_CloseButton.SetFont(m_ButtonFont); 105 #pragma region Position 106 { 107 CRect Position; 108 _W(GetWindowRect(Position)); 109 const HMONITOR hMonitor = MonitorFromPoint(Position.CenterPoint(), MONITOR_DEFAULTTONEAREST); 110 MONITORINFO Information = { sizeof Information }; 111 if(GetMonitorInfo(hMonitor, &Information)) 112 { 113 CSize DefaultExtent = reinterpret_cast<const CRect&>(Information.rcWork).Size(); 114 DefaultExtent.cx = DefaultExtent.cx * 6 / 8; 115 DefaultExtent.cy = DefaultExtent.cy * 6 / 8; 116 BOOL bUpdate = FALSE; 117 CSize ExcessExtent(DefaultExtent.cx - Position.Width(), DefaultExtent.cy - Position.Height()); 118 if(ExcessExtent.cx > 0) 119 { 120 Position.left -= ExcessExtent.cx / 2; 121 Position.right = Position.left + DefaultExtent.cx; 122 bUpdate = TRUE; 123 } 124 if(ExcessExtent.cy > 0) 125 { 126 Position.top -= ExcessExtent.cy / 2; 127 Position.bottom = Position.top + DefaultExtent.cy; 128 bUpdate = TRUE; 129 } 130 if(bUpdate) 131 _W(MoveWindow(Position, FALSE)); 132 } 133 } 77 134 _W(CenterWindow()); 135 #pragma endregion 78 136 _ATLTRY 79 137 { … … 1301 1359 if(IsWaveFormatExKey(Key) && Value.vt == VT_BLOB && Value.blob.cbSize >= sizeof (WAVEFORMATEX)) 1302 1360 { 1303 const WAVEFORMATEX* pWaveFormatEx = (const WAVEFORMATEX*) Value.blob.pBlobData;1304 1361 CRoArrayT<CString> Array; 1305 Array.Add(AtlFormatString(_T("wFormatTag 0x%02X"), pWaveFormatEx->wFormatTag)); 1306 Array.Add(AtlFormatString(_T("nChannels %d"), pWaveFormatEx->nChannels)); 1307 Array.Add(AtlFormatString(_T("nSamplesPerSec %d"), pWaveFormatEx->nSamplesPerSec)); 1308 Array.Add(AtlFormatString(_T("nAvgBytesPerSec %d"), pWaveFormatEx->nAvgBytesPerSec)); 1309 Array.Add(AtlFormatString(_T("nBlockAlign %d"), pWaveFormatEx->nBlockAlign)); 1310 Array.Add(AtlFormatString(_T("wBitsPerSample %d"), pWaveFormatEx->wBitsPerSample)); 1311 Array.Add(AtlFormatString(_T("cbSize %d"), pWaveFormatEx->cbSize)); 1312 if(Value.blob.cbSize >= sizeof (WAVEFORMATEXTENSIBLE) && pWaveFormatEx->wFormatTag == WAVE_FORMAT_EXTENSIBLE) 1313 { 1314 const WAVEFORMATEXTENSIBLE* pWaveFormatExtensible = (const WAVEFORMATEXTENSIBLE*) pWaveFormatEx; 1315 Array.Add(AtlFormatString(_T("wValidBitsPerSample %d"), pWaveFormatExtensible->Samples.wValidBitsPerSample)); 1316 Array.Add(AtlFormatString(_T("dwChannelMask 0x%02X"), pWaveFormatExtensible->dwChannelMask)); 1317 Array.Add(AtlFormatString(_T("SubFormat %ls"), _PersistHelper::StringFromIdentifier(pWaveFormatExtensible->SubFormat))); 1318 } 1362 FormatWaveFormatEx((const WAVEFORMATEX*) Value.blob.pBlobData, Value.blob.cbSize, Array); 1319 1363 sDetail = _StringHelper::Join(Array, _T("; ")); 1320 1364 } … … 1411 1455 CComPtr<IUnknown> pUnknown; 1412 1456 const HRESULT nActivateResult = pMmDevice->Activate(Item.Value, CLSCTX_ALL, NULL, (VOID**) &pUnknown); 1413 sText.AppendFormat(_T("\t") _T("\t") _T("%hs") _T("\t") _T("0x%08X") _T("\r\n"), Item.pszName, nActivateResult); 1457 CRoArrayT<CString> ArrayA; 1458 ArrayA.Add(CString(Item.pszName)); 1459 ArrayA.Add(MF::FormatResult(nActivateResult)); 1460 sText.AppendFormat(_T("\t") _T("\t") _T("%s") _T("\r\n"), _StringHelper::Join(ArrayA, _T("\t"))); 1461 if(FAILED(nActivateResult)) 1462 continue; 1463 if(Item.Value == __uuidof(IAudioClient)) 1464 { 1465 const CComPtr<IAudioClient>& pAudioClient = reinterpret_cast<const CComPtr<IAudioClient>&>(pUnknown); 1466 WAVEFORMATEX* pWaveFormatEx; 1467 if(SUCCEEDED(pAudioClient->GetMixFormat(&pWaveFormatEx))) 1468 { 1469 ArrayA.RemoveAll(); 1470 ArrayA.Add(_T("Mix Format")); 1471 CRoArrayT<CString> ArrayB; 1472 FormatWaveFormatEx(pWaveFormatEx, sizeof *pWaveFormatEx + pWaveFormatEx->cbSize, ArrayB); 1473 ArrayA.Add(_StringHelper::Join(ArrayB, _T("; "))); 1474 sText.AppendFormat(_T("\t") _T("\t") _T("\t") _T("%s") _T("\r\n"), _StringHelper::Join(ArrayA, _T("\t"))); 1475 } 1476 // SUGG: Try explicitly well known formats like mono, stereo, 5.1, 7.1 at 48000 Hz, 16-bit, 24-bit and 32-bit IEEE float 1477 } 1414 1478 } 1415 1479 #pragma endregion … … 1427 1491 } 1428 1492 #pragma endregion 1429 m_TextEdit = GetDlgItem(IDC_TEXT);1430 1493 m_TextEdit.SetValue(sText); 1431 1494 } -
trunk/Utilities/EnumerateAudioDevices/Module.rc
r619 r792 116 116 117 117 VS_VERSION_INFO VERSIONINFO 118 FILEVERSION 1, 0, 0, 8 3118 FILEVERSION 1, 0, 0, 84 119 119 PRODUCTVERSION 1,0,0,1 120 120 FILEFLAGSMASK 0x3fL … … 135 135 VALUE "Created By", "Roman Ryltsov <roman@alax.info>" 136 136 VALUE "FileDescription", "Enumerate WASAPI Audio Devices Utility" 137 VALUE "FileVersion", "1, 0, 0, 8 3\0"137 VALUE "FileVersion", "1, 0, 0, 84\0" 138 138 VALUE "InternalName", "EnumerateAudioDevices" 139 139 VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2011" -
trunk/Utilities/EnumerateAudioDevices/stdafx.h
r619 r792 8 8 // Windows definitions 9 9 10 #include <SDKDDKVer.h> 10 #include <winsdkver.h> 11 #include <sdkddkver.h> 11 12 12 13 #define INLINE_HRESULT_FROM_WIN32
Note: See TracChangeset
for help on using the changeset viewer.