File indexing completed on 2024-04-21 04:43:26

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef PROFILE_H
0008 #define PROFILE_H
0009 
0010 #include "pulseaudioqt_export.h"
0011 #include "pulseobject.h"
0012 #include <QObject>
0013 #include <QString>
0014 
0015 namespace PulseAudioQt
0016 {
0017 /**
0018  * A PulseAudio profile.
0019  */
0020 class PULSEAUDIOQT_EXPORT Profile : public PulseObject
0021 {
0022     Q_OBJECT
0023     Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
0024     Q_PROPERTY(quint32 priority READ priority NOTIFY priorityChanged)
0025     Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)
0026     Q_PROPERTY(quint32 sinkCount READ sinkCount NOTIFY sinkCountChanged)
0027     Q_PROPERTY(quint32 sourceCount READ sourceCount NOTIFY sourceCountChanged)
0028 
0029 public:
0030     enum Availability { Unknown, Available, Unavailable };
0031     Q_ENUM(Availability)
0032 
0033     ~Profile();
0034 
0035     /**
0036      * A human readable description.
0037      */
0038     QString description() const;
0039 
0040     /**
0041      * This object's priority. A higher number means higher priority.
0042      */
0043     quint32 priority() const;
0044 
0045     /**
0046      * Whether this object is available.
0047      */
0048     Availability availability() const;
0049 
0050     /**
0051      * Number of sinks this profile would create.
0052      */
0053     quint32 sinkCount() const;
0054 
0055     /**
0056      * Number of sources this profile would create.
0057      */
0058     quint32 sourceCount() const;
0059 
0060 Q_SIGNALS:
0061     /**
0062      * Emitted when the description changed.
0063      */
0064     void descriptionChanged();
0065 
0066     /**
0067      * Emitted when the priority changed.
0068      */
0069     void priorityChanged();
0070 
0071     /**
0072      * Emitted when the availability changed.
0073      */
0074     void availabilityChanged();
0075 
0076     /**
0077      * Emitted when sink count is changed.
0078      */
0079     void sinkCountChanged();
0080 
0081     /**
0082      * Emitted when source count is changed.
0083      */
0084     void sourceCountChanged();
0085 
0086 protected:
0087     /** @private */
0088     explicit Profile(QObject *parent);
0089     /** @private */
0090     class ProfilePrivate *const d;
0091 
0092     friend class Device;
0093     friend class CardPrivate;
0094     friend class PortPrivate;
0095 };
0096 
0097 } // PulseAudioQt
0098 
0099 #endif // PROFILE_H