src/responses/media_inputs.rs
Line | Count | Source (jump to first uncovered line) |
1 | | //! Responses related to media inputs. |
2 | | |
3 | | use serde::Deserialize; |
4 | | use time::Duration; |
5 | | |
6 | | /// Response value for [`crate::client::MediaInputs::status`]. |
7 | 9 | #[derive(Debug0 , D6 eserialize)] Unexecuted instantiation: <obws::responses::media_inputs::MediaStatus as core::fmt::Debug>::fmt Unexecuted instantiation: <obws::responses::media_inputs::MediaStatus as core::fmt::Debug>::fmt <obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::<serde_json::value::Value> Line | Count | Source | 7 | 1 | #[derive(Debug, Deserialize)] |
Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer> <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<&mut serde_json::value::de::MapDeserializer> Line | Count | Source | 7 | 4 | #[derive(Debug, D1 eserialize)] |
<<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::__DeserializeWith as serde::de::Deserialize>::deserialize::<serde_json::value::Value> Line | Count | Source | 7 | 1 | #[derive(Debug, Deserialize)] |
<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde_json::value::de::MapKeyDeserializer> Line | Count | Source | 7 | 3 | #[derive(Debug, Deserialize)] |
Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::__DeserializeWith as serde::de::Deserialize>::deserialize::<serde_json::value::Value> <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error> Line | Count | Source | 7 | 3 | #[derive(Debug, Deserialize)] |
Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>::{closure#0} Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<&mut serde_json::value::de::SeqDeserializer>::{closure#1} Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::__DeserializeWith as serde::de::Deserialize>::deserialize::<serde_json::value::Value> <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::__DeserializeWith as serde::de::Deserialize>::deserialize::<serde_json::value::Value> Line | Count | Source | 7 | 1 | #[derive(Debug, Deserialize)] |
Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>::{closure#0} Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_> Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>::{closure#1} Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>::{closure#0} Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_> Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::<_> Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_> Unexecuted instantiation: <obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_seq::<_>::{closure#1} Unexecuted instantiation: <<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_> Unexecuted instantiation: <<<obws::responses::media_inputs::MediaStatus as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_map::__DeserializeWith as serde::de::Deserialize>::deserialize::<_> |
8 | | pub struct MediaStatus { |
9 | | /// State of the media input. |
10 | | #[serde(rename = "mediaState")] |
11 | | pub state: MediaState, |
12 | | /// Total duration of the playing media. [`None`] if not playing. |
13 | | #[serde( |
14 | | rename = "mediaDuration", |
15 | | with = "crate::serde::duration_millis::option" |
16 | | )] |
17 | | pub duration: Option<Duration>, |
18 | | /// Position of the cursor. [`None`] if not playing. |
19 | | #[serde(rename = "mediaCursor", with = "crate::serde::duration_millis::option")] |
20 | | pub cursor: Option<Duration>, |
21 | | } |
22 | | |
23 | | /// Response value for [`crate::client::MediaInputs::status`] as part of [`MediaStatus`]. |
24 | 2 | #[derive(Copy, Clone0 , D0 ebug0 , Deserialize)] Unexecuted instantiation: <obws::responses::media_inputs::MediaState as core::clone::Clone>::clone Unexecuted instantiation: <obws::responses::media_inputs::MediaState as core::clone::Clone>::clone Unexecuted instantiation: <obws::responses::media_inputs::MediaState as core::fmt::Debug>::fmt Unexecuted instantiation: <obws::responses::media_inputs::MediaState as core::fmt::Debug>::fmt Unexecuted instantiation: <obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::<serde::__private::de::missing_field::MissingFieldDeserializer<serde_json::error::Error>> <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<serde::de::value::StringDeserializer<serde_json::error::Error>> Line | Count | Source | 24 | 1 | #[derive(Copy, Clone, Debug, Deserialize)] |
<<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::<serde_json::value::de::EnumDeserializer> Line | Count | Source | 24 | 1 | #[derive(Copy, Clone, Debug, Deserialize)] |
<<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<serde_json::error::Error> Line | Count | Source | 24 | 1 | #[derive(Copy, Clone, Debug, Deserialize)] |
<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::<serde_json::value::Value> Line | Count | Source | 24 | 1 | #[derive(Copy, Clone, Debug, Deserialize)] |
Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_> Unexecuted instantiation: <obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::visit_enum::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::expecting Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Field as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_str::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_u64::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__Visitor as serde::de::Visitor>::expecting Unexecuted instantiation: <obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::<_> Unexecuted instantiation: <<obws::responses::media_inputs::MediaState as serde::de::Deserialize>::deserialize::__FieldVisitor as serde::de::Visitor>::visit_bytes::<_> |
25 | | pub enum MediaState { |
26 | | /// No state. |
27 | | #[serde(rename = "OBS_MEDIA_STATE_NONE")] |
28 | | None, |
29 | | /// Media is playing. |
30 | | #[serde(rename = "OBS_MEDIA_STATE_PLAYING")] |
31 | | Playing, |
32 | | /// Opening file for replay. |
33 | | #[serde(rename = "OBS_MEDIA_STATE_OPENING")] |
34 | | Opening, |
35 | | /// Buffering data for replay. |
36 | | #[serde(rename = "OBS_MEDIA_STATE_BUFFERING")] |
37 | | Buffering, |
38 | | /// Media is paused. |
39 | | #[serde(rename = "OBS_MEDIA_STATE_PAUSED")] |
40 | | Paused, |
41 | | /// Media stopped. |
42 | | #[serde(rename = "OBS_MEDIA_STATE_STOPPED")] |
43 | | Stopped, |
44 | | /// All media in the play-list played. |
45 | | #[serde(rename = "OBS_MEDIA_STATE_ENDED")] |
46 | | Ended, |
47 | | /// Error occurred while trying to play the media. |
48 | | #[serde(rename = "OBS_MEDIA_STATE_ERROR")] |
49 | | Error, |
50 | | /// Unknown state. |
51 | | #[serde(other)] |
52 | | Unknown, |
53 | | } |