Changeset 792 for trunk


Ignore:
Timestamp:
Dec 12, 2017, 5:26:03 AM (6 years ago)
Author:
roman
Message:

VS and Win SDK upgrade; MixFormat? in the output; minor improvements

Location:
trunk/Utilities/EnumerateAudioDevices
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/EnumerateAudioDevices

    • Property svn:ignore
      •  

        old new  
        44*.user
        55ipch
         6.vs
  • trunk/Utilities/EnumerateAudioDevices/EnumerateAudioDevices.vcxproj

    r619 r792  
    2222    <ProjectGuid>{1AB74749-013C-4258-8B40-CB8B2E44F2B7}</ProjectGuid>
    2323    <RootNamespace>EnumerateAudioDevices</RootNamespace>
     24    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
    2425  </PropertyGroup>
    2526  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
     
    2930    <CharacterSet>Unicode</CharacterSet>
    3031    <WholeProgramOptimization>true</WholeProgramOptimization>
    31     <PlatformToolset>v120_xp</PlatformToolset>
     32    <PlatformToolset>v141</PlatformToolset>
    3233  </PropertyGroup>
    3334  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    3435    <ConfigurationType>Application</ConfigurationType>
    3536    <CharacterSet>Unicode</CharacterSet>
    36     <PlatformToolset>v120_xp</PlatformToolset>
     37    <PlatformToolset>v141</PlatformToolset>
    3738  </PropertyGroup>
    3839  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     
    4142    <CharacterSet>Unicode</CharacterSet>
    4243    <WholeProgramOptimization>true</WholeProgramOptimization>
    43     <PlatformToolset>v120_xp</PlatformToolset>
     44    <PlatformToolset>v141</PlatformToolset>
    4445  </PropertyGroup>
    4546  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    4647    <ConfigurationType>Application</ConfigurationType>
    4748    <CharacterSet>Unicode</CharacterSet>
    48     <PlatformToolset>v120_xp</PlatformToolset>
     49    <PlatformToolset>v141</PlatformToolset>
    4950  </PropertyGroup>
    5051  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
     
    101102    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(WindowsSdkDir)lib\x64;$(LibraryPath)</LibraryPath>
    102103  </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'" />
    103112  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    104113    <Midl>
     
    140149      </DataExecutionPrevention>
    141150      <TargetMachine>MachineX86</TargetMachine>
    142       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
    143151    </Link>
    144152    <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>
    147158    </PostBuildEvent>
    148159  </ItemDefinitionGroup>
     
    188199    </Link>
    189200    <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>
    192206    </PostBuildEvent>
    193207  </ItemDefinitionGroup>
     
    238252      </DataExecutionPrevention>
    239253      <TargetMachine>MachineX86</TargetMachine>
    240       <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
    241254    </Link>
    242255    <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>
    245261    </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>
    246268  </ItemDefinitionGroup>
    247269  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     
    293315    </Link>
    294316    <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>
    297322    </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>
    298329  </ItemDefinitionGroup>
    299330  <ItemGroup>
     
    317348    <ResourceCompile Include="Module.rc" />
    318349  </ItemGroup>
     350  <ItemGroup>
     351    <Manifest Include="Application.manifest" />
     352  </ItemGroup>
    319353  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
    320354  <ImportGroup Label="ExtensionTargets">
  • trunk/Utilities/EnumerateAudioDevices/EnumerateAudioDevices.vcxproj.filters

    r619 r792  
    4444    </ResourceCompile>
    4545  </ItemGroup>
     46  <ItemGroup>
     47    <Manifest Include="Application.manifest">
     48      <Filter>Resource Files</Filter>
     49    </Manifest>
     50  </ItemGroup>
    4651</Project>
  • trunk/Utilities/EnumerateAudioDevices/MainDialog.h

    r619 r792  
    66
    77#include "rodshow.h"
     8#include "romf.h"
    89#include <mmdeviceapi.h>
    910#include <mmreg.h>
     
    4344
    4445private:
     46        CDpiAwareness m_DpiAwareness;
     47        CFont m_TextFont;
    4548        CRoEdit m_TextEdit;
     49        CFont m_ButtonFont;
     50        CButton m_CloseButton;
    4651
    4752public:
     
    6469                return FALSE;
    6570        }
     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        }
    6688
    6789// Window Message Handler
    6890        LRESULT OnInitDialog(HWND, LPARAM)
    6991        {
    70                 SetIcon(AtlLoadIcon(IDI_MODULE), TRUE);
     92                DlgResize_Init();
     93                SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)), TRUE);
    7194                SetIcon(AtlLoadIconImage(IDI_MODULE, LR_DEFAULTCOLOR, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)), FALSE);
    7295                CMenuHandle Menu = GetSystemMenu(FALSE);
    7396                _W(Menu.AppendMenu(MF_SEPARATOR));
    7497                _W(Menu.AppendMenu(MF_STRING, ID_APP_ABOUT, _T("&About...")));
    75                 DlgResize_Init();
    7698                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                }
    77134                _W(CenterWindow());
     135                #pragma endregion
    78136                _ATLTRY
    79137                {
     
    13011359                                                                        if(IsWaveFormatExKey(Key) && Value.vt == VT_BLOB && Value.blob.cbSize >= sizeof (WAVEFORMATEX))
    13021360                                                                        {
    1303                                                                                 const WAVEFORMATEX* pWaveFormatEx = (const WAVEFORMATEX*) Value.blob.pBlobData;
    13041361                                                                                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);
    13191363                                                                                sDetail = _StringHelper::Join(Array, _T("; "));
    13201364                                                                        }
     
    14111455                                                        CComPtr<IUnknown> pUnknown;
    14121456                                                        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                                                        }
    14141478                                                }
    14151479                                                #pragma endregion
     
    14271491                        }
    14281492                        #pragma endregion
    1429                         m_TextEdit = GetDlgItem(IDC_TEXT);
    14301493                        m_TextEdit.SetValue(sText);
    14311494                }
  • trunk/Utilities/EnumerateAudioDevices/Module.rc

    r619 r792  
    116116
    117117VS_VERSION_INFO VERSIONINFO
    118  FILEVERSION  1, 0, 0, 83
     118 FILEVERSION  1, 0, 0, 84
    119119 PRODUCTVERSION 1,0,0,1
    120120 FILEFLAGSMASK 0x3fL
     
    135135            VALUE "Created By", "Roman Ryltsov <roman@alax.info>"
    136136            VALUE "FileDescription", "Enumerate WASAPI Audio Devices Utility"
    137             VALUE "FileVersion",  "1, 0, 0, 83\0"
     137            VALUE "FileVersion",  "1, 0, 0, 84\0"
    138138            VALUE "InternalName", "EnumerateAudioDevices"
    139139            VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2011"
  • trunk/Utilities/EnumerateAudioDevices/stdafx.h

    r619 r792  
    88// Windows definitions
    99
    10 #include <SDKDDKVer.h>
     10#include <winsdkver.h>
     11#include <sdkddkver.h>
    1112
    1213#define INLINE_HRESULT_FROM_WIN32
Note: See TracChangeset for help on using the changeset viewer.