mxl_player_components/ui/player/
messages.rs1use gst_play::PlayMediaInfo;
2
3#[derive(Debug)]
4pub enum Track {
5 Enable,
6 Disable,
7 Stream(i32),
8}
9
10#[derive(Debug)]
11pub enum PlayerComponentInput {
12 UpdateUri(String),
13 ChangeState(PlaybackState),
14 SwitchAudioTrack(Track),
15 Seek(f64),
16 NextFrame,
17 SetVolume(f64),
18 SetSpeed(f64),
19 DumpPipeline(String),
20 SetZoomRelative(f64),
21 SetZoom(Option<f64>),
22 SetAudioVideoOffset(i64),
23 SetSubtitleVideoOffset(i64),
24 SetOverlayVisible(bool),
25 RequestOverlayRedraw,
26 ReloadPlayer,
27 PrivateMessage(internal::PrivateMsg),
28}
29
30#[derive(Debug, Clone, Copy, PartialEq, Eq)]
31pub enum PlaybackState {
32 Stopped,
33 Paused,
34 Playing,
35 Buffering,
36 Error,
37}
38
39#[derive(Debug)]
40pub enum PlayerComponentOutput {
41 PlayerInitialized(Option<anyhow::Error>),
42 MediaInfoUpdated(PlayMediaInfo),
43 DurationChanged(f64),
44 PositionUpdated(f64),
45 SeekDone,
46 EndOfStream(std::string::String),
47 StateChanged(Option<PlaybackState>, PlaybackState),
48 VolumeChanged(f64),
49 SpeedChanged(f64),
50 AudioVideoOffsetChanged(i64),
51 SubtitleVideoOffsetChanged(i64),
52 Warning(anyhow::Error),
53 Error(anyhow::Error),
54}
55
56#[derive(Debug)]
57pub enum PlayerComponentCommand {
58 MediaInfoUpdated(PlayMediaInfo),
59 PositionUpdated(f64),
60 DurationChanged(f64),
61 SeekDone,
62 EndOfStream(std::string::String),
63 StateChanged(Option<PlaybackState>, PlaybackState),
64 VideoDimensionsChanged(i32, i32),
65 VolumeChanged(f64),
66 AudioVideoOffsetChanged(i64),
67 SubtitleVideoOffsetChanged(i64),
68 Warning(anyhow::Error),
69 Error(anyhow::Error),
70}
71
72pub(super) mod internal {
73 #[derive(Debug)]
74 pub enum PrivateMsg {
75 DragBegin(f64, f64),
76 DragUpdate(f64, f64),
77 DragEnd(f64, f64),
78 MotionDetected(f64, f64),
79 }
80}