winampApi.h 839 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef NULLSOFT_WINAMP_API_WINAMP_IMPLEMENTATION_HEADER
  2. #define NULLSOFT_WINAMP_API_WINAMP_IMPLEMENTATION_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <atomic>
  7. #include "./api_winamp.h"
  8. class WinampApi : public api_winamp
  9. {
  10. public:
  11. WinampApi();
  12. ~WinampApi();
  13. public:
  14. static HRESULT CreateInstance(WinampApi **instance);
  15. static const char *getServiceName();
  16. static const GUID getServiceGuid();
  17. public:
  18. /* Dispatchable */
  19. size_t AddRef();
  20. size_t Release();
  21. int QueryInterface(GUID interface_guid, void **object);
  22. /* api_winamp */
  23. HWND GetMainWindow(void);
  24. HWND GetDlgParent(void);
  25. HRESULT OpenUrl(HWND hwnd, const wchar_t *url);
  26. int GetRegVer();
  27. protected:
  28. std::atomic<std::size_t> _ref = 1;
  29. protected:
  30. RECVS_DISPATCH;
  31. };
  32. #endif //NULLSOFT_WINAMP_API_WINAMP_IMPLEMENTATION_HEADER