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