summaryrefslogtreecommitdiffstats
path: root/src/PulseAudioQt/profile.h
blob: 79fe26f2a1ced33c54ac5e6a600f07f82e5df56c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
    SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>

    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/

#ifndef PROFILE_H
#define PROFILE_H

#include "pulseaudioqt_export.h"
#include "pulseobject.h"
#include <QObject>
#include <QString>

namespace PulseAudioQt
{
/**
 * A PulseAudio profile.
 */
class PULSEAUDIOQT_EXPORT Profile : public PulseObject
{
    Q_OBJECT
    Q_PROPERTY(QString description READ description NOTIFY descriptionChanged)
    Q_PROPERTY(quint32 priority READ priority NOTIFY priorityChanged)
    Q_PROPERTY(Availability availability READ availability NOTIFY availabilityChanged)

public:
    enum Availability { Unknown, Available, Unavailable };
    Q_ENUM(Availability)

    ~Profile();

    /**
     * A human readable description.
     */
    QString description() const;

    /**
     * This object's priority. A higher number means higher priority.
     */
    quint32 priority() const;

    /**
     * Whether this object is available.
     */
    Availability availability() const;

    quint32 sources() const;

    quint32 sinks() const;

Q_SIGNALS:
    /**
     * Emitted when the description changed.
     */
    void descriptionChanged();

    /**
     * Emitted when the priority changed.
     */
    void priorityChanged();

    /**
     * Emitted when the availability changed.
     */
    void availabilityChanged();

protected:
    /** @private */
    explicit Profile(QObject *parent);
    /** @private */
    class ProfilePrivate *const d;

    friend class Device;
    friend class CardPrivate;
    friend class PortPrivate;
};

} // PulseAudioQt

#endif // PROFILE_H