File indexing completed on 2024-06-23 11:14:50

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 SOURCE_H
0008 #define SOURCE_H
0009 
0010 #include "device.h"
0011 
0012 struct pa_source_info;
0013 
0014 namespace PulseAudioQt
0015 {
0016 /**
0017  * A PulseAudio source. This class is based on https://freedesktop.org/software/pulseaudio/doxygen/structpa__source__info.html.
0018  */
0019 class PULSEAUDIOQT_EXPORT Source : public Device
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     ~Source();
0025 
0026     void setVolume(qint64 volume) override;
0027     void setMuted(bool muted) override;
0028     void setActivePortIndex(quint32 port_index) override;
0029     void setChannelVolume(int channel, qint64 volume) override;
0030     void setChannelVolumes(const QVector<qint64> &volumes) override;
0031 
0032     bool isDefault() const override;
0033     void setDefault(bool enable) override;
0034 
0035     void switchStreams() override;
0036 
0037 private:
0038     explicit Source(QObject *parent);
0039 
0040     class SourcePrivate *const d;
0041     friend class MapBase<Source, pa_source_info>;
0042 };
0043 
0044 } // PulseAudioQt
0045 
0046 #endif // SOURCE_H