Changeset 590


Ignore:
Timestamp:
Feb 25, 2016, 4:24:06 AM (8 years ago)
Author:
roman
Message:
 
Location:
trunk/Utilities/EnumerateAudioDevices
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/EnumerateAudioDevices/EnumerateAudioDevices.rc

    r522 r590  
    116116
    117117VS_VERSION_INFO VERSIONINFO
    118  FILEVERSION  1, 0, 0, 62
     118 FILEVERSION  1, 0, 0, 65
    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, 62\0"
     137            VALUE "FileVersion",  "1, 0, 0, 65\0"
    138138            VALUE "InternalName", "EnumerateAudioDevices"
    139139            VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2011"
  • trunk/Utilities/EnumerateAudioDevices/MainDialog.h

    r522 r590  
    1010#include <propkey.h>
    1111#include <devpkey.h>
     12#include <devicetopology.h>
    1213#include "AboutDialog.h"
    1314
     
    13351336                                                        }
    13361337                                                #pragma endregion
     1338                                                #pragma region IDeviceTopology
     1339                                                _ATLTRY
     1340                                                {
     1341                                                        // TODO: Make it nice
     1342                                                        // NOTE: http://stackoverflow.com/questions/34025791/how-to-get-jack-information-of-audio-device-in-ms-windows-7
     1343                                                        CComPtr<IDeviceTopology> pDeviceTopology;
     1344                                                        __C(pMmDevice->Activate(__uuidof(IDeviceTopology), CLSCTX_ALL, NULL, (VOID**) &pDeviceTopology));
     1345                                                        HRESULT hr;
     1346                                                        CComPtr<IConnector> pConnector;
     1347                                                        hr = pDeviceTopology->GetConnector(0, &pConnector);
     1348                                                        if(SUCCEEDED(hr))
     1349                                                        {
     1350                                                                CComPtr<IConnector> connectedTo;
     1351                                                                hr = pConnector->GetConnectedTo(&connectedTo);
     1352                                                                if(SUCCEEDED(hr))
     1353                                                                {
     1354                                                                        CComPtr<IPart> part;
     1355                                                                        hr = connectedTo->QueryInterface(&part);
     1356                                                                        if (SUCCEEDED(hr))
     1357                                                                        {
     1358                                                                                CComPtr<IKsJackDescription> jack;
     1359                                                                                hr = part->Activate(CLSCTX_ALL, IID_PPV_ARGS(&jack));
     1360                                                                                if (SUCCEEDED(hr))
     1361                                                                                {
     1362                                                                                        UINT jackCount = 0;
     1363                                                                                        jack->GetJackCount(&jackCount);
     1364                                                                                        for (int j = 0; j < jackCount; j++)
     1365                                                                                        {
     1366                                                                                                KSJACK_DESCRIPTION desc = { 0 };
     1367                                                                                                jack->GetJackDescription(j, &desc);
     1368                                                                                                sText.AppendFormat(_T("\t") _T("\t") _T("ChannelMapping\t%i\r\n"), desc.ChannelMapping);
     1369                                                                                                sText.AppendFormat(_T("\t") _T("\t") _T("ConnectionType\t%i\r\n"), desc.ConnectionType);
     1370                                                                                                sText.AppendFormat(_T("\t") _T("\t") _T("IsConnected\t%i\r\n"), desc.IsConnected);
     1371                                                                                                sText.AppendFormat(_T("\t") _T("\t") _T("Color\t0x%08X\r\n"), desc.Color);
     1372                                                                                        }
     1373                                                                                }
     1374                                                                        }
     1375                                                                }
     1376                                                        }
     1377                                                }
     1378                                                _ATLCATCHALL()
     1379                                                {
     1380                                                        _Z_EXCEPTION();
     1381                                                }
     1382                                                #pragma endregion
    13371383                                        }
    13381384                                        _ATLCATCH(Exception)
Note: See TracChangeset for help on using the changeset viewer.