BluezQt 5.109.0
mediatransport.h
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#ifndef BLUEZQT_MEDIATRANSPORT_H
10#define BLUEZQT_MEDIATRANSPORT_H
11
12#include <QObject>
13
14#include "bluezqt_export.h"
15#include "mediatypes.h"
16#include "tpendingcall.h"
17
18namespace BluezQt
19{
20class PendingCall;
21
29class BLUEZQT_EXPORT MediaTransport : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY(State state READ state NOTIFY stateChanged)
33 Q_PROPERTY(quint16 volume READ volume NOTIFY volumeChanged)
34
35public:
37 enum class State {
38 Idle,
39 Pending,
40 Active,
41 };
42 Q_ENUM(State)
43
44
47 ~MediaTransport() override;
48
54 AudioConfiguration audioConfiguration() const;
55
61 State state() const;
62
75 quint16 volume() const;
76
77public Q_SLOTS:
87
100
107
108Q_SIGNALS:
112 void stateChanged(State state);
113
117 void volumeChanged(quint16 volume);
118
119private:
120 BLUEZQT_NO_EXPORT explicit MediaTransport(const QString &path, const QVariantMap &properties);
121
122 class MediaTransportPrivate *const d;
123
124 friend class MediaTransportPrivate;
125 friend class DevicePrivate;
126};
127
128} // namespace BluezQt
129
130#endif
Media transport.
Definition mediatransport.h:30
TPendingCall< QDBusUnixFileDescriptor, uint16_t, uint16_t > * tryAcquire()
Acquire transport file descriptor only if the transport is in "pending" state at the time the message...
quint16 volume() const
Returns the volume of the transport.
TPendingCall< void > * release()
Releases file descriptor.
AudioConfiguration audioConfiguration() const
Returns the (audio) configuration of the transport.
~MediaTransport() override
Destroys a MediaTransport object.
State state() const
Returns the state of the transport.
void volumeChanged(quint16 volume)
Indicates that transport's volume have changed.
void stateChanged(State state)
Indicates that transport's state have changed.
State
Indicates the state of the transport.
Definition mediatransport.h:37
TPendingCall< QDBusUnixFileDescriptor, uint16_t, uint16_t > * acquire()
Acquire transport file descriptor and the MTU for read and write respectively.
Pending method call (template version).
Definition tpendingcall.h:34