TaskbarComponentWin.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef TASKBARCOMPONENTWIN_H
  2. #define TASKBARCOMPONENTWIN_H
  3. #include <QWinTaskbarButton>
  4. #include <QWinTaskbarProgress>
  5. #include <QWinThumbnailToolBar>
  6. #include <QWinThumbnailToolButton>
  7. #include <wrl.h>
  8. #include <Windows.Media.h>
  9. #include "TaskbarComponent.h"
  10. class TaskbarComponentWin : public TaskbarComponent
  11. {
  12. public:
  13. TaskbarComponentWin(): TaskbarComponent(nullptr) {}
  14. ~TaskbarComponentWin() override;
  15. virtual void setWindow(QQuickWindow* window) override;
  16. private:
  17. void onPauseClicked();
  18. void onPrevClicked();
  19. void onNextClicked();
  20. void setProgress(quint64 value);
  21. void setControlsVisible(bool value);
  22. void setPaused(bool value);
  23. void initializeMediaTransport(HWND hwnd);
  24. void onMetaData(const QVariantMap &meta, QUrl baseUrl);
  25. void setAudioMeta(const QVariantMap &meta);
  26. void setVideoMeta(const QVariantMap &meta);
  27. void setThumbnail(const QVariantMap &meta, QUrl baseUrl);
  28. void playing();
  29. void stopped();
  30. void paused();
  31. HRESULT buttonPressed(ABI::Windows::Media::ISystemMediaTransportControls* sender,
  32. ABI::Windows::Media::ISystemMediaTransportControlsButtonPressedEventArgs* args);
  33. QWinTaskbarButton* m_button;
  34. QWinThumbnailToolBar* m_toolbar;
  35. QWinThumbnailToolButton* m_pause;
  36. QWinThumbnailToolButton* m_prev;
  37. QWinThumbnailToolButton* m_next;
  38. bool m_initialized;
  39. EventRegistrationToken m_buttonPressedToken;
  40. Microsoft::WRL::ComPtr<ABI::Windows::Media::ISystemMediaTransportControls> m_systemControls;
  41. Microsoft::WRL::ComPtr<ABI::Windows::Media::ISystemMediaTransportControlsDisplayUpdater> m_displayUpdater;
  42. Microsoft::WRL::ComPtr<ABI::Windows::Storage::Streams::IRandomAccessStreamReference> m_thumbnail;
  43. };
  44. #endif // TASKBARCOMPONENTWIN_H