BluezQt

mediatransport.cpp
1/*
2 * BluezQt - Asynchronous Bluez wrapper library
3 *
4 * SPDX-FileCopyrightText: 2019 Manuel Weichselbaumer <mincequi@web.de>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#include "mediatransport.h"
10#include "mediatransport_p.h"
11#include "pendingcall.h"
12
13namespace BluezQt
14{
15MediaTransport::MediaTransport(const QString &path, const QVariantMap &properties)
16 : QObject()
17 , d(new MediaTransportPrivate(path, properties))
18{
19}
20
21MediaTransport::~MediaTransport() = default;
22
23AudioConfiguration MediaTransport::audioConfiguration() const
24{
25 return d->m_configuration;
26}
27
28MediaTransport::State MediaTransport::state() const
29{
30 return d->m_state;
31}
32
33quint16 MediaTransport::volume() const
34{
35 return d->m_volume;
36}
37
38PendingCall *MediaTransport::setVolume(quint16 volume)
39{
40 return new PendingCall(d->setDBusProperty(QStringLiteral("Volume"), QVariant::fromValue(volume)), PendingCall::ReturnVoid, this);
41}
42
44{
45 return new TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t>(d->m_dbusInterface.Acquire(), this);
46}
47
49{
50 return new TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t>(d->m_dbusInterface.TryAcquire(), this);
51}
52
53TPendingCall<void> *MediaTransport::release()
54{
55 return new TPendingCall<void>(d->m_dbusInterface.Release(), this);
56}
57
58} // namespace BluezQt
59
60#include "moc_mediatransport.cpp"
State
Indicates the state of the transport.
Pending method call.
Pending method call (template version).
QString path(const QString &relativePath)
KGuiItem properties()
QVariant fromValue(T &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.