mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-07-24 10:56:59 +00:00
Initial commit.
This commit is contained in:
commit
c8394f6a8e
99 changed files with 8173 additions and 0 deletions
48
clients/terminal/src/models.rs
Normal file
48
clients/terminal/src/models.rs
Normal file
|
@ -0,0 +1,48 @@
|
|||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct PlayMessage {
|
||||
pub container: String,
|
||||
pub url: Option<String>,
|
||||
pub content: Option<String>,
|
||||
pub time: Option<u64>,
|
||||
}
|
||||
|
||||
impl PlayMessage {
|
||||
pub fn new(container: String, url: Option<String>, content: Option<String>, time: Option<u64>) -> Self {
|
||||
Self { container, url, content, time }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct SeekMessage {
|
||||
pub time: u64,
|
||||
}
|
||||
|
||||
impl SeekMessage {
|
||||
pub fn new(time: u64) -> Self {
|
||||
Self { time }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct PlaybackUpdateMessage {
|
||||
pub time: u64,
|
||||
pub state: u8 //0 = None, 1 = Playing, 2 = Paused
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct VolumeUpdateMessage {
|
||||
pub volume: f64 //(0-1)
|
||||
}
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct SetVolumeMessage {
|
||||
pub volume: f64,
|
||||
}
|
||||
|
||||
impl SetVolumeMessage {
|
||||
pub fn new(volume: f64) -> Self {
|
||||
Self { volume }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue