dolphin/Source/Core/DolphinQt/TAS/TASCheckBox.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
821 B
C
Raw Normal View History

2019-03-30 20:49:57 -06:00
// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2019-03-30 20:49:57 -06:00
#pragma once
#include <QCheckBox>
#include "DolphinQt/TAS/TASControlState.h"
2019-03-30 20:49:57 -06:00
class QMouseEvent;
class TASInputWindow;
2019-03-30 20:49:57 -06:00
class TASCheckBox : public QCheckBox
{
Q_OBJECT
public:
explicit TASCheckBox(const QString& text, TASInputWindow* parent);
2019-03-30 20:49:57 -06:00
// Can be called from the CPU thread
bool GetValue() const;
// 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;
private slots:
void OnUIValueChanged(int new_value);
void ApplyControllerValueChange();
2019-03-30 20:49:57 -06:00
private:
const TASInputWindow* m_parent;
TASControlState m_state;
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
};