use std::future; use mpris_server::{ zbus::{fdo, Result}, LocalPlayerInterface, LocalPlaylistsInterface, LocalRootInterface, LocalServer, LocalTrackListInterface, LoopStatus, Metadata, PlaybackRate, PlaybackStatus, Playlist, PlaylistId, PlaylistOrdering, Property, Signal, Time, TrackId, Uri, Volume, }; pub struct Player; impl LocalRootInterface for Player { async fn raise(&self) -> fdo::Result<()> { println!("Raise"); Ok(()) } async fn quit(&self) -> fdo::Result<()> { println!("Quit"); Ok(()) } async fn can_quit(&self) -> fdo::Result { println!("CanQuit"); Ok(true) } async fn fullscreen(&self) -> fdo::Result { println!("Fullscreen"); Ok(false) } async fn set_fullscreen(&self, fullscreen: bool) -> Result<()> { println!("SetFullscreen({})", fullscreen); Ok(()) } async fn can_set_fullscreen(&self) -> fdo::Result { println!("CanSetFullscreen"); Ok(false) } async fn can_raise(&self) -> fdo::Result { println!("CanRaise"); Ok(true) } async fn has_track_list(&self) -> fdo::Result { println!("HasTrackList"); Ok(false) } async fn identity(&self) -> fdo::Result { println!("Identity"); Ok("TestApplication".to_string()) } async fn desktop_entry(&self) -> fdo::Result { println!("DesktopEntry"); Ok("Test.Application".to_string()) } async fn supported_uri_schemes(&self) -> fdo::Result> { println!("SupportedUriSchemes"); Ok(vec![]) } async fn supported_mime_types(&self) -> fdo::Result> { println!("SupportedMimeTypes"); Ok(vec![]) } } impl LocalPlayerInterface for Player { async fn next(&self) -> fdo::Result<()> { println!("Next"); Ok(()) } async fn previous(&self) -> fdo::Result<()> { println!("Previous"); Ok(()) } async fn pause(&self) -> fdo::Result<()> { println!("Pause"); Ok(()) } async fn play_pause(&self) -> fdo::Result<()> { println!("PlayPause"); Ok(()) } async fn stop(&self) -> fdo::Result<()> { println!("Stop"); Ok(()) } async fn play(&self) -> fdo::Result<()> { println!("Play"); Ok(()) } async fn seek(&self, offset: Time) -> fdo::Result<()> { println!("Seek({:?})", offset); Ok(()) } async fn set_position(&self, track_id: TrackId, position: Time) -> fdo::Result<()> { println!("SetPosition({}, {:?})", track_id, position); Ok(()) } async fn open_uri(&self, uri: String) -> fdo::Result<()> { println!("OpenUri({})", uri); Ok(()) } async fn playback_status(&self) -> fdo::Result { println!("PlaybackStatus"); Ok(PlaybackStatus::Playing) } async fn loop_status(&self) -> fdo::Result { println!("LoopStatus"); Ok(LoopStatus::None) } async fn set_loop_status(&self, loop_status: LoopStatus) -> Result<()> { println!("SetLoopStatus({})", loop_status); Ok(()) } async fn rate(&self) -> fdo::Result { println!("Rate"); Ok(PlaybackRate::default()) } async fn set_rate(&self, rate: PlaybackRate) -> Result<()> { println!("SetRate({})", rate); Ok(()) } async fn shuffle(&self) -> fdo::Result { println!("Shuffle"); Ok(false) } async fn set_shuffle(&self, shuffle: bool) -> Result<()> { println!("SetShuffle({})", shuffle); Ok(()) } async fn metadata(&self) -> fdo::Result { println!("Metadata"); Ok(Metadata::default()) } async fn volume(&self) -> fdo::Result { println!("Volume"); Ok(Volume::default()) } async fn set_volume(&self, volume: Volume) -> Result<()> { println!("SetVolume({})", volume); Ok(()) } async fn position(&self) -> fdo::Result