enum-wasapi.hpp 836 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #define WIN32_MEAN_AND_LEAN
  3. #include <windows.h>
  4. #include <initguid.h>
  5. #include <mmdeviceapi.h>
  6. #include <audioclient.h>
  7. #include <propsys.h>
  8. #ifdef __MINGW32__
  9. #ifdef DEFINE_PROPERTYKEY
  10. #undef DEFINE_PROPERTYKEY
  11. #endif
  12. /* clang-format off */
  13. #define DEFINE_PROPERTYKEY(id, a, b, c, d, e, f, g, h, i, j, k, l) \
  14. const PROPERTYKEY id = { { a,b,c, { d,e,f,g,h,i,j,k, } }, l };
  15. DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, \
  16. 0xa45c254e, 0xdf1c, 0x4efd, 0x80, \
  17. 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
  18. /* clang-format on */
  19. #else
  20. #include <functiondiscoverykeys_devpkey.h>
  21. #endif
  22. #include <vector>
  23. #include <string>
  24. struct AudioDeviceInfo {
  25. std::string name;
  26. std::string id;
  27. };
  28. std::string GetDeviceName(IMMDevice *device);
  29. void GetWASAPIAudioDevices(std::vector<AudioDeviceInfo> &devices, bool input);