1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2018 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_MEDIA_H
10#define BLUEZQT_MEDIA_H
11
12#include <QObject>
13
14#include "bluezqt_export.h"
15
16#include <memory>
17
18namespace BluezQt
19{
20class MediaEndpoint;
21class PendingCall;
22
23/**
24 * @class BluezQt::Media Media.h <BluezQt/Media>
25 *
26 * Bluetooth Media.
27 *
28 * This allows media endpoints to be established in accordance with the
29 * capabilities of a specific media service profile.
30 *
31 * For example, an A2DP media endpoint could be created allowing data from a
32 * remote device to be streamed to/from the sender.
33 *
34 * Each media endpoint is associated with a service object instance that
35 * implements the required behaviours of the endpoint. The service object
36 * must be created at a given path before it is registered.
37 *
38 * @see MediaEndpoint
39 */
40class BLUEZQT_EXPORT Media : public QObject
41{
42 Q_OBJECT
43
44public:
45 /**
46 * Destroys a Media object.
47 */
48 ~Media() override;
49
50 /**
51 * Registers endpoint.
52 *
53 * Register a local end point to sender, the sender can register as many end points as it likes.
54 *
55 * Note: If the sender disconnects the end points are automatically unregistered.
56 *
57 * Possible errors: PendingCall::InvalidArguments, PendingCall::NotSupported
58 *
59 * @param endpoint endpoint to be registered
60 * @return void pending call
61 */
62 PendingCall *registerEndpoint(MediaEndpoint *endpoint);
63
64 /**
65 * Unregisters endpoint.
66 *
67 * @param endpoint endpoint to be unregistered
68 * @return void pending call
69 */
70 PendingCall *unregisterEndpoint(MediaEndpoint *endpoint);
71
72private:
73 BLUEZQT_NO_EXPORT explicit Media(const QString &path, QObject *parent = nullptr);
74
75 std::unique_ptr<class MediaPrivate> const d;
76
77 friend class AdapterPrivate;
78};
79
80} // namespace BluezQt
81
82#endif // BLUEZQT_MEDIA_H
83

source code of bluez-qt/src/media.h