diff --git a/utils/mpris/mpris.rs b/utils/mpris/mpris.rs deleted file mode 100644 index d08b6941691fe1928aad5f1fb555f2af789769da..0000000000000000000000000000000000000000 --- a/utils/mpris/mpris.rs +++ /dev/null @@ -1,193 +0,0 @@ -//! # DBus interface proxies for: `org.mpris.MediaPlayer2`, `org.mpris.MediaPlayer2.Player` -//! -//! This code was generated by `zbus-xmlgen` `3.1.0` from DBus introspection data. -//! Source: `mpris.xml`. -//! -//! You may prefer to adapt it, instead of using it verbatim. -//! -//! More information can be found in the -//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html) -//! section of the zbus documentation. - -use zbus::dbus_proxy; - -enum MediaPlayerLoopStatus { - None, - Track, - Playlist, -} - -enum MediaPlayerPlaybackStatus { - Playing, - Paused, - Stopped, -} - -struct µs(i32); - -/// A valid path must be prefiexed by `/baka/lektor/`. After that we have the -/// variant name in lower case, then a `/`, then the ascii only value. For -/// example we can have: -/// - `/baka/lektor/id/42` -enum MediaPlayerObjectPath { - Id(i64), -} - -impl From<String> for MediaPlayerLoopStatus {} -impl From<&str> for MediaPlayerLoopStatus {} - -impl From<String> for MediaPlayerPlaybackStatus {} -impl From<&str> for MediaPlayerPlaybackStatus {} - -impl<'a> From<zbus::zvariant::ObjectPath<'a>> for MediaPlayerObjectPath {} - -impl From<i32> for µs {} - -#[dbus_proxy(interface = "org.mpris.MediaPlayer2", assume_defaults = true)] -trait MediaPlayer2 { - /// Quit method - fn quit(&self) -> zbus::Result<()>; - - /// Raise method - fn raise(&self) -> zbus::Result<()>; - - /// CanQuit property - #[dbus_proxy(property)] - fn can_quit(&self) -> zbus::Result<bool>; - - /// CanRaise property - #[dbus_proxy(property)] - fn can_raise(&self) -> zbus::Result<bool>; - - /// CanSetFullscreen property - #[dbus_proxy(property)] - fn can_set_fullscreen(&self) -> zbus::Result<bool>; - - /// DesktopEntry property - #[dbus_proxy(property)] - fn desktop_entry(&self) -> zbus::Result<String>; - - /// Fullscreen property - #[dbus_proxy(property)] - fn fullscreen(&self) -> zbus::Result<bool>; - fn set_fullscreen(&self, value: bool) -> zbus::Result<()>; - - /// HasTrackList property - #[dbus_proxy(property)] - fn has_track_list(&self) -> zbus::Result<bool>; - - /// Identity property - #[dbus_proxy(property)] - fn identity(&self) -> zbus::Result<String>; - - /// SupportedMimeTypes property - #[dbus_proxy(property)] - fn supported_mime_types(&self) -> zbus::Result<Vec<String>>; - - /// SupportedUriSchemes property. It should be `id://` and `file://` for - /// lektord. Here we support `file://` for only files in the database to - /// enable the user to search the kara folder and drop the files to play - /// them imediatly. - #[dbus_proxy(property)] - fn supported_uri_schemes(&self) -> zbus::Result<Vec<String>>; -} - -#[dbus_proxy(interface = "org.mpris.MediaPlayer2.Player", assume_defaults = true)] -trait Player { - /// Next method - fn next(&self) -> zbus::Result<()>; - - /// OpenUri method - fn open_uri(&self, id_uri: &str) -> zbus::Result<()>; - - /// Pause method - fn pause(&self) -> zbus::Result<()>; - - /// Play method - fn play(&self) -> zbus::Result<()>; - - /// PlayPause method - fn play_pause(&self) -> zbus::Result<()>; - - /// Previous method - fn previous(&self) -> zbus::Result<()>; - - /// Seek method - fn seek(&self, time_µs: i64) -> zbus::Result<()>; - - /// SetPosition method - fn set_position(&self, track_id: &MediaPlayerObjectPath, time_µs: µs) -> zbus::Result<()>; - - /// Stop method - fn stop(&self) -> zbus::Result<()>; - - /// CanControl property - #[dbus_proxy(property)] - fn can_control(&self) -> zbus::Result<bool>; - - /// CanPause property - #[dbus_proxy(property)] - fn can_pause(&self) -> zbus::Result<bool>; - - /// CanPlay property - #[dbus_proxy(property)] - fn can_play(&self) -> zbus::Result<bool>; - - /// CanSeek property - #[dbus_proxy(property)] - fn can_seek(&self) -> zbus::Result<bool>; - - /// LoopStatus property - #[dbus_proxy(property)] - fn loop_status(&self) -> zbus::Result<MediaPlayerObjectPath>; - fn set_loop_status(&self, value: &MediaPlayerObjectPath) -> zbus::Result<()>; - - /// MaximumRate property. We will only set it to `1.0` here... - #[dbus_proxy(property)] - fn maximum_rate(&self) -> zbus::Result<f64> { - Ok(1.0) - } - fn set_maximum_rate(&self, _: f64) -> zbus::Result<()> { - Ok(()) - } - - /// Metadata property. If there is a current kara playing, there must be at - /// least a `mpris:trackid` value of type `o` which is the object path of - /// the current kara id. - #[dbus_proxy(property)] - fn metadata( - &self, - ) -> zbus::Result<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>; - - /// MinimumRate property. We will only set it to `1.0` here... - #[dbus_proxy(property)] - fn minimum_rate(&self) -> zbus::Result<f64> { - Ok(1.0) - } - fn set_minimum_rate(&self, _: f64) -> zbus::Result<()> { - Ok(()) - } - - /// PlaybackStatus property - #[dbus_proxy(property)] - fn playback_status(&self) -> zbus::Result<MediaPlayerPlaybackStatus>; - - /// Position property - #[dbus_proxy(property)] - fn position(&self) -> zbus::Result<µs>; - - /// Rate property - #[dbus_proxy(property)] - fn rate(&self) -> zbus::Result<f64>; - fn set_rate(&self, value: f64) -> zbus::Result<()>; - - /// Shuffle property - #[dbus_proxy(property)] - fn shuffle(&self) -> zbus::Result<bool>; - fn set_shuffle(&self, value: bool) -> zbus::Result<()>; - - /// Volume property - #[dbus_proxy(property)] - fn volume(&self) -> zbus::Result<f64>; - fn set_volume(&self, value: f64) -> zbus::Result<()>; -} diff --git a/utils/mpris/mpris.xml b/utils/mpris/mpris.xml deleted file mode 100644 index efec5efcefb0507f119654023433c7a30fe507a3..0000000000000000000000000000000000000000 --- a/utils/mpris/mpris.xml +++ /dev/null @@ -1,47 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.mpris.MediaPlayer2"> - <property name="Identity" type="s" access="read" /> - <property name="DesktopEntry" type="s" access="read" /> - <property name="SupportedMimeTypes" type="as" access="read" /> - <property name="SupportedUriSchemes" type="as" access="read" /> - <property name="HasTrackList" type="b" access="read" /> - <property name="CanQuit" type="b" access="read" /> - <property name="CanSetFullscreen" type="b" access="read" /> - <property name="Fullscreen" type="b" access="readwrite" /> - <property name="CanRaise" type="b" access="read" /> - <method name="Quit" /> - <method name="Raise" /> - </interface> - <interface name="org.mpris.MediaPlayer2.Player"> - <property name="Metadata" type="a{sv}" access="read" /> - <property name="PlaybackStatus" type="s" access="read" /> - <property name="LoopStatus" type="s" access="readwrite" /> - <property name="Volume" type="d" access="readwrite" /> - <property name="Shuffle" type="b" access="readwrite" /> - <property name="Position" type="i" access="read" /> - <property name="Rate" type="d" access="readwrite" /> - <property name="MinimumRate" type="d" access="readwrite" /> - <property name="MaximumRate" type="d" access="readwrite" /> - <property name="CanControl" type="b" access="read" /> - <property name="CanPlay" type="b" access="read" /> - <property name="CanPause" type="b" access="read" /> - <property name="CanSeek" type="b" access="read" /> - <method name="Previous" /> - <method name="Next" /> - <method name="Stop" /> - <method name="Play" /> - <method name="Pause" /> - <method name="PlayPause" /> - <method name="Seek"> - <arg type="x" direction="in" /> - </method> - <method name="OpenUri"> - <arg type="s" direction="in" /> - </method> - <method name="SetPosition"> - <arg type="o" direction="in" /> - <arg type="x" direction="in" /> - </method> - </interface> -</node> \ No newline at end of file