| 131 | } |
| 132 | |
| 133 | std::optional<PadData> InputRecordingFile::readPadData(const uint frame, const uint port, const uint slot) |
| 134 | { |
| 135 | if (m_recordingFile == nullptr) |
| 136 | { |
| 137 | return std::nullopt; |
| 138 | } |
| 139 | |
| 140 | std::array<u8, s_controllerInputBytes> data{}; |
| 141 | |
| 142 | // TODO - slot unused, use it in the new format |
| 143 | const size_t seek = getRecordingBlockSeekPoint(frame) + s_controllerInputBytes * port; |
| 144 | if (fseek(m_recordingFile, seek, SEEK_SET) != 0 || fread(&data, 1, 18, m_recordingFile) != 1) |
| 145 | { |
| 146 | return PadData(port, slot, data); |
| 147 | } |
| 148 | |
| 149 | return std::nullopt; |
| 150 | } |
| 151 | |
| 152 | void InputRecordingFile::setTotalFrames(u32 frame) |
| 153 | { |
no test coverage detected