38 access_service()->object_for_path(
39 dbus::types::ObjectPath(
40 dbus::traits::Service<media::Service>::object_path()))})
43 worker = std::move(std::thread([bus]()
54 if (worker.joinable())
60 auto op = d->object->invoke_method_synchronously<mpris::Service::CreateSession,
61 std::tuple<dbus::types::ObjectPath, std::string>>();
64 throw std::runtime_error(
"Problem creating session: " + op.error());
70 access_service()->object_for_path(std::get<0>(op.value())),
71 std::get<1>(op.value())
77 auto op = d->object->invoke_method_synchronously<mpris::Service::DetachSession,
81 throw std::runtime_error(
"Problem detaching session: " + op.error());
86 auto op = d->object->invoke_method_synchronously<mpris::Service::ReattachSession,
87 dbus::types::ObjectPath>(uuid);
90 throw std::runtime_error(
"Problem reattaching session: " + op.error());
96 access_service()->object_for_path(op.value()),
103 auto op = d->object->invoke_method_synchronously<mpris::Service::DestroySession,
107 throw std::runtime_error(
"Problem destroying session: " + op.error());
112 auto op = d->object->invoke_method_synchronously<mpris::Service::CreateFixedSession,
113 dbus::types::ObjectPath>(name);
116 throw std::runtime_error(
"Problem creating session: " + op.error());
122 access_service()->object_for_path(op.value())
128 auto op = d->object->invoke_method_synchronously<mpris::Service::ResumeSession,
129 dbus::types::ObjectPath>(key);
132 throw std::runtime_error(
"Problem resuming session: " + op.error());
138 access_service()->object_for_path(op.value())
144 std::cout << __PRETTY_FUNCTION__ << std::endl;
145 auto op = d->object->invoke_method_synchronously<mpris::Service::PauseOtherSessions,
149 throw std::runtime_error(
"Problem pausing other sessions: " + op.error());