File indexing completed on 2025-01-19 06:44:37
0001 /* 0002 * BluezQt - Asynchronous BlueZ wrapper library 0003 * 0004 * SPDX-FileCopyrightText: 2018 Manuel Weichselbaumer <mincequi@web.de> 0005 * 0006 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef BLUEZQT_MEDIA_H 0010 #define BLUEZQT_MEDIA_H 0011 0012 #include <QObject> 0013 0014 #include "bluezqt_export.h" 0015 0016 #include <memory> 0017 0018 namespace BluezQt 0019 { 0020 class MediaEndpoint; 0021 class PendingCall; 0022 0023 /** 0024 * @class BluezQt::Media Media.h <BluezQt/Media> 0025 * 0026 * Bluetooth Media. 0027 * 0028 * This allows media endpoints to be established in accordance with the 0029 * capabilities of a specific media service profile. 0030 * 0031 * For example, an A2DP media endpoint could be created allowing data from a 0032 * remote device to be streamed to/from the sender. 0033 * 0034 * Each media endpoint is associated with a service object instance that 0035 * implements the required behaviours of the endpoint. The service object 0036 * must be created at a given path before it is registered. 0037 * 0038 * @see MediaEndpoint 0039 */ 0040 class BLUEZQT_EXPORT Media : public QObject 0041 { 0042 Q_OBJECT 0043 0044 public: 0045 /** 0046 * Destroys a Media object. 0047 */ 0048 ~Media() override; 0049 0050 /** 0051 * Registers endpoint. 0052 * 0053 * Register a local end point to sender, the sender can register as many end points as it likes. 0054 * 0055 * Note: If the sender disconnects the end points are automatically unregistered. 0056 * 0057 * Possible errors: PendingCall::InvalidArguments, PendingCall::NotSupported 0058 * 0059 * @param endpoint endpoint to be registered 0060 * @return void pending call 0061 */ 0062 PendingCall *registerEndpoint(MediaEndpoint *endpoint); 0063 0064 /** 0065 * Unregisters endpoint. 0066 * 0067 * @param endpoint endpoint to be unregistered 0068 * @return void pending call 0069 */ 0070 PendingCall *unregisterEndpoint(MediaEndpoint *endpoint); 0071 0072 private: 0073 BLUEZQT_NO_EXPORT explicit Media(const QString &path, QObject *parent = nullptr); 0074 0075 std::unique_ptr<class MediaPrivate> const d; 0076 0077 friend class AdapterPrivate; 0078 }; 0079 0080 } // namespace BluezQt 0081 0082 #endif // BLUEZQT_MEDIA_H