dolphin/Source/Core/DolphinQt/TAS/TASCheckBox.h
JosJuice 1c4088e203 DolphinQt: Allow customizing TAS input turbo interval
As a side effect of 9c5c3c0, Dolphin's frame counter was changed
to run at 60/50 Hz even if the game is running at a lower framerate
such as 30 fps. Since the TAS input turbo button functionality
toggled the state of a button every other frame as reported by
the frame counter, this change made the turbo button functionality
not work with 30/25 fps games.

I believe it would be hard to change the frame counter back to
how it used to work without undermining the point of 9c5c3c0,
and I'm not sure if doing so would be desireable or not anyway,
so what I'm doing instead is letting the user determine how long
turbo button presses should last. This lets users avoid the 30/25
fps game problem while also granting additional flexibility.
Perhaps there is some game where it is useful to mash at a speed
which is slower than frame perfect.
2020-07-02 16:58:29 +02:00

28 lines
540 B
C++

// Copyright 2019 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <QCheckBox>
class QMouseEvent;
class TASInputWindow;
class TASCheckBox : public QCheckBox
{
Q_OBJECT
public:
explicit TASCheckBox(const QString& text, TASInputWindow* parent);
bool GetValue() const;
protected:
void mousePressEvent(QMouseEvent* event) override;
private:
const TASInputWindow* m_parent;
int m_frame_turbo_started;
int m_turbo_press_frames;
int m_turbo_total_frames;
};