File indexing completed on 2024-04-21 13:11:11

0001 /*
0002     SPDX-FileCopyrightText: 2014-2015 Harald Sitter <sitter@kde.org>
0003     SPDX-FileCopyrightText: 2021 Nicolas Fella
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #pragma once
0009 
0010 #include "sink.h"
0011 
0012 #include <QObject>
0013 
0014 class SpeakerTest : public QObject
0015 {
0016     Q_OBJECT
0017     Q_PROPERTY(QPulseAudio::Sink *sink READ sink WRITE setSink NOTIFY sinkChanged)
0018     Q_PROPERTY(QStringList playingChannels READ playingChannels NOTIFY playingChannelsChanged)
0019 public:
0020     QPulseAudio::Sink *sink() const;
0021     void setSink(QPulseAudio::Sink *sink);
0022     Q_SIGNAL void sinkChanged();
0023 
0024     QStringList playingChannels() const;
0025     Q_SIGNAL void playingChannelsChanged();
0026     void playingFinished(const QString &name, int errorCode);
0027 
0028     Q_INVOKABLE void testChannel(const QString &name);
0029     Q_SIGNAL void showErrorMessage(const QString &message);
0030 
0031 private:
0032     QPulseAudio::Sink *m_sink;
0033     QStringList m_playingChannels;
0034 };