samp_sdk/omp/generated/player_recordings.rs
1//! `IPlayerRecordingData` — generated by `cargo xtask gen-omp` from `Server/Components/Recordings/recordings.hpp`.
2//! Implemented by `PlayerRecordingData` in the server's `Recordings`.
3//!
4//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
5//! regenerate. Slots are clang's layout of the header for each ABI, checked
6//! against the official binaries by `cargo xtask check-abi --generated`.
7
8#![allow(unused_imports)]
9
10use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
11use crate::omp::types::{
12 Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
13 UID, Vector2, Vector3, Vector4, WorldTimePoint,
14};
15use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
16use crate::omp::*;
17
18opaque! {
19 /// Opaque handle for `IPlayerRecordingData*`.
20 pub IPlayerRecordingData;
21}
22
23/// `RecordingData_UID` in `Server/Components/Recordings/recordings.hpp`.
24pub const PLAYER_RECORDINGS_UID: UID = 0x34db532857286482;
25
26/// The player's `IPlayerRecordingData`, or null when the component providing it is not loaded.
27///
28/// Found by walking the player's extension map for `PLAYER_RECORDINGS_UID` — the
29/// virtual `getExtension` does not consult that map. `IExtension`
30/// is `IPlayerRecordingData`'s first base, so the extension pointer is the interface pointer.
31///
32/// # Safety
33/// `player` must be a live `IPlayer`.
34#[must_use]
35pub unsafe fn player_recordings(player: *mut IPlayer) -> *mut IPlayerRecordingData {
36 unsafe { extension(player.cast::<u8>(), PLAYER_RECORDINGS_UID) }.cast::<IPlayerRecordingData>()
37}
38
39slots! {
40 /// `void IPlayerRecordingData::start(PlayerRecordingType, StringView)`
41 SLOT_START: usize = 3, 3;
42 /// `void IPlayerRecordingData::stop()`
43 SLOT_STOP: usize = 4, 4;
44}
45
46virtual_fns! {
47 /// `void IPlayerRecordingData::start(PlayerRecordingType, StringView)`.
48 ///
49 /// # Safety
50 /// `data` must be a live `IPlayerRecordingData`.
51 pub fn player_recordings_start(
52 data: IPlayerRecordingData,
53 type_value: i32,
54 file: StringView,
55 ) = [0, SLOT_START];
56
57 /// `void IPlayerRecordingData::stop()`.
58 ///
59 /// # Safety
60 /// `data` must be a live `IPlayerRecordingData`.
61 pub fn player_recordings_stop(data: IPlayerRecordingData) = [0, SLOT_STOP];
62}