summaryrefslogtreecommitdiffstats
path: root/src/PulseAudioQt/source.h
blob: 17c4cb9ffa8a677f8ee0eecd34b19b91107b4414 (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
/*
    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 SOURCE_H
#define SOURCE_H

#include "device.h"

struct pa_source_info;

namespace PulseAudioQt
{
/**
 * A PulseAudio source. This class is based on https://freedesktop.org/software/pulseaudio/doxygen/structpa__source__info.html.
 */
class PULSEAUDIOQT_EXPORT Source : public Device
{
    Q_OBJECT

public:
    ~Source();

    void setVolume(qint64 volume) override;
    void setMuted(bool muted) override;
    void setActivePortIndex(quint32 port_index) override;
    void setChannelVolume(int channel, qint64 volume) override;
    void setChannelVolumes(const QVector<qint64> &volumes) override;

    bool isDefault() const override;
    void setDefault(bool enable) override;

private:
    explicit Source(QObject *parent);

    class SourcePrivate *const d;
    friend class MapBase<Source, pa_source_info>;
};

} // PulseAudioQt

#endif // SOURCE_H