summaryrefslogtreecommitdiffstats
path: root/src/input_common/tas/tas_input.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-06-19 21:38:49 +0200
committerMonsterDruide1 <5958456@gmail.com>2021-09-18 23:22:30 +0200
commitc01a872c8efa90065b6ba1a74079ddf6ec12058f (patch)
treed441117b0d133bff32b39f5060b31db57bc0413f /src/input_common/tas/tas_input.h
parentcore: Hacky TAS syncing & load pausing (diff)
downloadyuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.tar
yuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.tar.gz
yuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.tar.bz2
yuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.tar.lz
yuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.tar.xz
yuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.tar.zst
yuzu-c01a872c8efa90065b6ba1a74079ddf6ec12058f.zip
Diffstat (limited to '')
-rw-r--r--src/input_common/tas/tas_input.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/input_common/tas/tas_input.h b/src/input_common/tas/tas_input.h
index 8ee70bcaf..49ef10ff9 100644
--- a/src/input_common/tas/tas_input.h
+++ b/src/input_common/tas/tas_input.h
@@ -14,14 +14,14 @@
namespace TasInput {
-constexpr int PLAYER_NUMBER = 8;
+constexpr size_t PLAYER_NUMBER = 8;
using TasAnalog = std::pair<float, float>;
enum class TasState {
- RUNNING,
- RECORDING,
- STOPPED,
+ Running,
+ Recording,
+ Stopped,
};
enum class TasButton : u32 {
@@ -114,8 +114,19 @@ public:
void LoadTasFiles();
void RecordInput(u32 buttons, const std::array<std::pair<float, float>, 2>& axes);
void UpdateThread();
- std::tuple<TasState, size_t, size_t> GetStatus();
+ void StartStop();
+ void Reset();
+ void Record();
+
+ /**
+ * Returns the current status values of TAS playback/recording
+ * @return Tuple of
+ * TasState indicating the current state out of Running, Recording or Stopped ;
+ * Current playback progress or amount of frames (so far) for Recording ;
+ * Total length of script file currently loaded or amount of frames (so far) for Recording
+ */
+ std::tuple<TasState, size_t, size_t> GetStatus() const;
InputCommon::ButtonMapping GetButtonMappingForDevice(const Common::ParamPackage& params) const;
InputCommon::AnalogMapping GetAnalogMappingForDevice(const Common::ParamPackage& params) const;
[[nodiscard]] const TasData& GetTasState(std::size_t pad) const;
@@ -137,9 +148,12 @@ private:
std::array<TasData, PLAYER_NUMBER> tas_data;
bool update_thread_running{true};
bool refresh_tas_fle{false};
+ bool is_recording{false};
+ bool is_running{false};
+ bool needs_reset{false};
std::array<std::vector<TASCommand>, PLAYER_NUMBER> commands{};
std::vector<TASCommand> record_commands{};
- std::size_t current_command{0};
+ size_t current_command{0};
TASCommand last_input{}; // only used for recording
};
} // namespace TasInput