use crate::playlist::Playlist;
use crate::track::Track;
use serde::Deserialize;
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ApplicationData {
pub airplay_enabled: Option<bool>,
pub converting: Option<bool>,
pub current_airplay_devices: Vec<AirplayDevice>,
pub current_encoder: Encoder,
pub current_playlist: Option<Playlist>,
pub current_stream_title: Option<String>,
pub current_stream_url: Option<String>,
pub current_visual: Visual,
pub eq_enabled: bool,
pub fixed_indexing: bool,
pub frontmost: bool,
pub full_screen: bool,
pub name: Option<String>,
pub mute: bool,
pub player_position: Option<f64>,
pub player_state: Option<PlayerState>,
pub playlists: Option<Vec<Playlist>>,
pub selection: Option<Vec<Track>>,
pub shuffle_enabled: bool,
pub shuffle_mode: ShuffleMode,
pub song_repeat: SongRepeat,
pub sound_volume: i8,
pub version: Option<String>,
pub visuals: Vec<Visual>,
pub visuals_enabled: bool,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct AirplayDevice {
pub class: String,
pub id: i32,
pub index: i32,
pub name: String,
#[serde(rename = "persistentID")]
pub persistent_id: String,
pub active: Option<bool>,
pub available: Option<bool>,
pub kind: AirplayDeviceKind,
pub network_address: Option<String>,
pub protected: Option<bool>,
pub selected: bool,
pub supports_audio: Option<bool>,
pub supports_video: Option<bool>,
pub sound_volume: i8,
}
#[derive(Deserialize, Debug)]
pub struct Encoder {
pub class: String,
pub id: i32,
pub index: i32,
pub name: String,
pub format: Option<String>,
}
#[derive(Deserialize, Debug)]
pub struct EqPreset {
pub class: String,
pub id: i32,
pub index: i32,
pub name: String,
pub band1: f32,
pub band2: f32,
pub band3: f32,
pub band4: f32,
pub band5: f32,
pub band6: f32,
pub band7: f32,
pub band8: f32,
pub band9: f32,
pub band10: f32,
pub modifiable: Option<bool>,
pub preamp: f32,
pub update_tracks: bool,
}
#[derive(Deserialize, Debug)]
pub struct Visual {
pub class: String,
pub id: i32,
pub index: i32,
pub name: String,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum PlayerState {
Stopped,
Playing,
Paused,
FastForwarding,
Rewinding,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum ShuffleMode {
Songs,
Albums,
Groupings,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum SongRepeat {
Off,
On,
All,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum AirplayDeviceKind {
Computer,
AirportExpress,
AppleTV,
AirplayDevice,
BluetoothDevice,
HomePod,
Unknown,
}