#[allow(unused_imports)]
use dbus::arg;
use dbus::nonblock;
pub trait OrgBluezMedia1 {
fn register_endpoint(
&self,
endpoint: dbus::Path,
properties: arg::PropMap,
) -> nonblock::MethodReply<()>;
fn unregister_endpoint(&self, endpoint: dbus::Path) -> nonblock::MethodReply<()>;
fn register_player(
&self,
player: dbus::Path,
properties: arg::PropMap,
) -> nonblock::MethodReply<()>;
fn unregister_player(&self, player: dbus::Path) -> nonblock::MethodReply<()>;
fn register_application(
&self,
application: dbus::Path,
options: arg::PropMap,
) -> nonblock::MethodReply<()>;
fn unregister_application(&self, application: dbus::Path) -> nonblock::MethodReply<()>;
fn supported_uuids(&self) -> nonblock::MethodReply<Vec<String>>;
}
pub const ORG_BLUEZ_MEDIA1_NAME: &str = "org.bluez.Media1";
#[derive(Copy, Clone, Debug)]
pub struct OrgBluezMedia1Properties<'a>(pub &'a arg::PropMap);
impl<'a> OrgBluezMedia1Properties<'a> {
pub fn from_interfaces(
interfaces: &'a ::std::collections::HashMap<String, arg::PropMap>,
) -> Option<Self> {
interfaces.get("org.bluez.Media1").map(Self)
}
pub fn supported_uuids(&self) -> Option<&Vec<String>> {
arg::prop_cast(self.0, "SupportedUUIDs")
}
}
impl<'a, T: nonblock::NonblockReply, C: ::std::ops::Deref<Target = T>> OrgBluezMedia1
for nonblock::Proxy<'a, C>
{
fn register_endpoint(
&self,
endpoint: dbus::Path,
properties: arg::PropMap,
) -> nonblock::MethodReply<()> {
self.method_call(
"org.bluez.Media1",
"RegisterEndpoint",
(endpoint, properties),
)
}
fn unregister_endpoint(&self, endpoint: dbus::Path) -> nonblock::MethodReply<()> {
self.method_call("org.bluez.Media1", "UnregisterEndpoint", (endpoint,))
}
fn register_player(
&self,
player: dbus::Path,
properties: arg::PropMap,
) -> nonblock::MethodReply<()> {
self.method_call("org.bluez.Media1", "RegisterPlayer", (player, properties))
}
fn unregister_player(&self, player: dbus::Path) -> nonblock::MethodReply<()> {
self.method_call("org.bluez.Media1", "UnregisterPlayer", (player,))
}
fn register_application(
&self,
application: dbus::Path,
options: arg::PropMap,
) -> nonblock::MethodReply<()> {
self.method_call(
"org.bluez.Media1",
"RegisterApplication",
(application, options),
)
}
fn unregister_application(&self, application: dbus::Path) -> nonblock::MethodReply<()> {
self.method_call("org.bluez.Media1", "UnregisterApplication", (application,))
}
fn supported_uuids(&self) -> nonblock::MethodReply<Vec<String>> {
<Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(
&self,
"org.bluez.Media1",
"SupportedUUIDs",
)
}
}