2019-03-31 02:49:57 +00:00
|
|
|
// Copyright 2019 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2019-03-31 02:49:57 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
2023-03-04 11:24:31 +00:00
|
|
|
#include "DolphinQt/TAS/TASControlState.h"
|
|
|
|
|
2019-03-31 02:49:57 +00:00
|
|
|
class QMouseEvent;
|
2020-06-30 19:07:25 +00:00
|
|
|
class TASInputWindow;
|
2019-03-31 02:49:57 +00:00
|
|
|
|
|
|
|
class TASCheckBox : public QCheckBox
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-06-30 19:07:25 +00:00
|
|
|
explicit TASCheckBox(const QString& text, TASInputWindow* parent);
|
2019-03-31 02:49:57 +00:00
|
|
|
|
2023-03-04 11:24:31 +00:00
|
|
|
// Can be called from the CPU thread
|
2020-01-27 02:41:28 +00:00
|
|
|
bool GetValue() const;
|
2023-03-04 11:24:31 +00:00
|
|
|
// Must be called from the CPU thread
|
|
|
|
void OnControllerValueChanged(bool new_value);
|
2019-03-31 02:49:57 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void mousePressEvent(QMouseEvent* event) override;
|
|
|
|
|
2023-03-04 11:24:31 +00:00
|
|
|
private slots:
|
|
|
|
void OnUIValueChanged(int new_value);
|
|
|
|
void ApplyControllerValueChange();
|
|
|
|
|
2019-03-31 02:49:57 +00:00
|
|
|
private:
|
2020-06-30 19:07:25 +00:00
|
|
|
const TASInputWindow* m_parent;
|
2023-03-04 11:24:31 +00:00
|
|
|
TASControlState m_state;
|
2021-09-04 04:43:19 +00:00
|
|
|
int m_frame_turbo_started = 0;
|
|
|
|
int m_turbo_press_frames = 0;
|
|
|
|
int m_turbo_total_frames = 0;
|
2019-03-31 02:49:57 +00:00
|
|
|
};
|