summaryrefslogtreecommitdiffstats
path: root/src/dbus/playlists.rs
blob: 597394a7d97ea52f2e54b9bf9241f5b89233e9fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! # D-Bus interface proxy for: `org.mpris.MediaPlayer2.Playlists`
//!
//! This code was generated by `zbus-xmlgen` `4.1.0` from D-Bus introspection data.
//! Source: `Interface '/org/mpris/MediaPlayer2' from service 'org.mpris.MediaPlayer2.playerctld' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the [Writing a client proxy] section of the zbus
//! documentation.
//!
//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
//! following zbus API can be used:
//!
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PeerProxy`]
//!
//! Consequently `zbus-xmlgen` did not generate code for the above interfaces.
//!
//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html
//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
use zbus::proxy;
#[proxy(
    interface = "org.mpris.MediaPlayer2.Playlists",
    default_service = "org.mpris.MediaPlayer2.playerctld",
    default_path = "/org/mpris/MediaPlayer2"
)]
trait Playlists {
    /// ActivatePlaylist method
    fn activate_playlist(&self, playlist_id: &zbus::zvariant::ObjectPath<'_>) -> zbus::Result<()>;

    /// GetPlaylists method
    fn get_playlists(
        &self,
        index: u32,
        max_count: u32,
        order: &str,
        reverse_order: bool,
    ) -> zbus::Result<Vec<(zbus::zvariant::OwnedObjectPath, String, String)>>;

    /// PlaylistChanged signal
    #[zbus(signal)]
    fn playlist_changed(
        &self,
        playlist: (zbus::zvariant::ObjectPath<'_>, &str, &str),
    ) -> zbus::Result<()>;

    /// ActivePlaylist property
    #[zbus(property)]
    fn active_playlist(
        &self,
    ) -> zbus::Result<(bool, (zbus::zvariant::OwnedObjectPath, String, String))>;

    /// Orderings property
    #[zbus(property)]
    fn orderings(&self) -> zbus::Result<Vec<String>>;

    /// PlaylistCount property
    #[zbus(property)]
    fn playlist_count(&self) -> zbus::Result<u32>;
}