Debut d'un contrôle point

This commit is contained in:
2025-11-29 17:51:53 +01:00
parent 0a03f72467
commit 6cbf4791cd
10 changed files with 682 additions and 2 deletions

66
pmocontrol/src/model.rs Normal file
View File

@@ -0,0 +1,66 @@
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct RendererId(pub String);
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct MediaServerId(pub String);
#[derive(Clone, Debug)]
pub enum RendererProtocol {
UpnpAvOnly,
OpenHomeOnly,
Hybrid,
}
#[derive(Clone, Debug, Default)]
pub struct RendererCapabilities {
pub has_avtransport: bool,
pub has_rendering_control: bool,
pub has_connection_manager: bool,
pub has_oh_playlist: bool,
pub has_oh_volume: bool,
pub has_oh_info: bool,
pub has_oh_time: bool,
pub has_oh_radio: bool,
}
#[derive(Clone, Debug)]
pub struct RendererInfo {
pub id: RendererId,
pub udn: String,
pub friendly_name: String,
pub model_name: String,
pub manufacturer: String,
pub protocol: RendererProtocol,
pub capabilities: RendererCapabilities,
pub location: String,
pub server_header: String,
pub online: bool,
pub last_seen: std::time::SystemTime,
pub max_age: u32,
}
#[derive(Clone, Debug, Default)]
pub struct MediaServerCapabilities {
pub has_content_directory: bool,
pub has_connection_manager: bool,
}
#[derive(Clone, Debug)]
pub struct MediaServerInfo {
pub id: MediaServerId,
pub udn: String,
pub friendly_name: String,
pub model_name: String,
pub manufacturer: String,
pub capabilities: MediaServerCapabilities,
pub location: String,
pub server_header: String,
pub online: bool,
pub last_seen: std::time::SystemTime,
pub max_age: u32,
}