File indexing completed on 2024-12-01 12:29:50

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2019 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 #include "mediatransport.h"
0010 #include "mediatransport_p.h"
0011 
0012 namespace BluezQt
0013 {
0014 MediaTransport::MediaTransport(const QString &path, const QVariantMap &properties)
0015     : QObject()
0016     , d(new MediaTransportPrivate(path, properties))
0017 {
0018 }
0019 
0020 MediaTransport::~MediaTransport()
0021 {
0022     delete d;
0023 }
0024 
0025 AudioConfiguration MediaTransport::audioConfiguration() const
0026 {
0027     return d->m_configuration;
0028 }
0029 
0030 MediaTransport::State MediaTransport::state() const
0031 {
0032     return d->m_state;
0033 }
0034 
0035 quint16 MediaTransport::volume() const
0036 {
0037     return d->m_volume;
0038 }
0039 
0040 TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t> *MediaTransport::acquire()
0041 {
0042     return new TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t>(d->m_dbusInterface.Acquire(), this);
0043 }
0044 
0045 TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t> *MediaTransport::tryAcquire()
0046 {
0047     return new TPendingCall<QDBusUnixFileDescriptor, uint16_t, uint16_t>(d->m_dbusInterface.TryAcquire(), this);
0048 }
0049 
0050 TPendingCall<void> *MediaTransport::release()
0051 {
0052     return new TPendingCall<void>(d->m_dbusInterface.Release(), this);
0053 }
0054 
0055 } // namespace BluezQt
0056 
0057 #include "moc_mediatransport.cpp"