TASCheckBox.h 821 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2019 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <QCheckBox>
  5. #include "DolphinQt/TAS/TASControlState.h"
  6. class QMouseEvent;
  7. class TASInputWindow;
  8. class TASCheckBox : public QCheckBox
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit TASCheckBox(const QString& text, TASInputWindow* parent);
  13. // Can be called from the CPU thread
  14. bool GetValue() const;
  15. // Must be called from the CPU thread
  16. void OnControllerValueChanged(bool new_value);
  17. protected:
  18. void mousePressEvent(QMouseEvent* event) override;
  19. private slots:
  20. void OnUIValueChanged(int new_value);
  21. void ApplyControllerValueChange();
  22. private:
  23. const TASInputWindow* m_parent;
  24. TASControlState m_state;
  25. int m_frame_turbo_started = 0;
  26. int m_turbo_press_frames = 0;
  27. int m_turbo_total_frames = 0;
  28. };