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
39{
40 return new PendingCall(d->setDBusProperty(QStringLiteral("Volume"), QVariant::fromValue(volume)), PendingCall::ReturnVoid, this);
41}
42
47
52
54{
55 return new TPendingCall<void>(d->m_dbusInterface.Release(), this);
56}
57
58} // namespace BluezQt
59
60#include "moc_mediatransport.cpp"
TPendingCall< QDBusUnixFileDescriptor, uint16_t, uint16_t > * tryAcquire()
Acquire transport file descriptor only if the transport is in "pending" state at the time the message...
TPendingCall< void > * release()
Releases file descriptor.
AudioConfiguration audioConfiguration() const
Returns the (audio) configuration of the transport.
PendingCall * setVolume(quint16 volume)
Sets the volume of the transport.
State
Indicates the state of the transport.
TPendingCall< QDBusUnixFileDescriptor, uint16_t, uint16_t > * acquire()
Acquire transport file descriptor and the MTU for read and write respectively.
Pending method call.
Definition pendingcall.h:35
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-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:56:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.