InputAppleMediaKeys.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Created by Tobias Hieta on 21/08/15.
  3. //
  4. #ifndef KONVERGO_INPUTAPPLEMEDIAKEYS_H
  5. #define KONVERGO_INPUTAPPLEMEDIAKEYS_H
  6. #include "input/InputComponent.h"
  7. #include "player/PlayerComponent.h"
  8. class InputAppleMediaKeys : public InputBase
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit InputAppleMediaKeys(QObject* parent = nullptr) : InputBase(parent) { }
  13. bool initInput() override;
  14. const char* inputName() override { return "AppleMediaKeys"; }
  15. private:
  16. void* m_delegate;
  17. void handleStateChanged(PlayerComponent::State newState, PlayerComponent::State oldState);
  18. void handlePositionUpdate(quint64 position);
  19. void handleUpdateDuration(qint64 duration);
  20. typedef void (*SetNowPlayingVisibilityFunc)(void* origin, int visibility);
  21. typedef void* (*GetLocalOriginFunc)(void);
  22. typedef void (*SetCanBeNowPlayingApplicationFunc)(int);
  23. SetNowPlayingVisibilityFunc SetNowPlayingVisibility;
  24. GetLocalOriginFunc GetLocalOrigin;
  25. SetCanBeNowPlayingApplicationFunc SetCanBeNowPlayingApplication;
  26. bool m_pendingUpdate;
  27. quint64 m_currentTime;
  28. };
  29. #endif //KONVERGO_INPUTAPPLEMEDIAKEYS_H