diff --git a/src/models.h b/src/models.h index df5c390..804bb21 100644 --- a/src/models.h +++ b/src/models.h @@ -1,172 +1,172 @@ /* Copyright 2014-2015 Harald Sitter Copyright 2016 David Rosca This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PULSEAUDIO_H #define PULSEAUDIO_H #include #include "kf5pulseaudioqt_export.h" namespace PulseAudioQt { class Context; class MapBaseQObject; class Sink; class Source; class AbstractModelPrivate; class SinkModelPrivate; class KF5PULSEAUDIOQT_EXPORT AbstractModel : public QAbstractListModel { Q_OBJECT public: enum ItemRole { PulseObjectRole = Qt::UserRole + 1 }; ~AbstractModel() override; - QHash roleNames() const Q_DECL_FINAL; - int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_FINAL; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; - bool setData(const QModelIndex &index, const QVariant &value, int role) Q_DECL_FINAL; + QHash roleNames() const final; + int rowCount(const QModelIndex &parent = QModelIndex()) const final; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + bool setData(const QModelIndex &index, const QVariant &value, int role) final; int role(const QByteArray &roleName) const; protected: AbstractModel(const MapBaseQObject *map, QObject *parent); void initRoleNames(const QMetaObject &qobjectMetaObject); Context *context() const; private Q_SLOTS: void propertyChanged(); private: void onDataAdded(int index); void onDataRemoved(int index); QMetaMethod propertyChangedMetaMethod() const; AbstractModelPrivate *d; // Prevent leaf-classes from default constructing as we want to enforce // them passing us a context or explicit nullptrs. AbstractModel() {} }; class KF5PULSEAUDIOQT_EXPORT CardModel : public AbstractModel { Q_OBJECT public: CardModel(QObject *parent = nullptr); private: void *d; }; class KF5PULSEAUDIOQT_EXPORT SinkModel : public AbstractModel { Q_OBJECT Q_PROPERTY(PulseAudioQt::Sink *defaultSink READ defaultSink NOTIFY defaultSinkChanged) Q_PROPERTY(PulseAudioQt::Sink *preferredSink READ preferredSink NOTIFY preferredSinkChanged) public: enum ItemRole { SortByDefaultRole = PulseObjectRole + 1 }; Q_ENUMS(ItemRole) SinkModel(QObject *parent = nullptr); virtual ~SinkModel(); Sink *defaultSink() const; Sink *preferredSink() const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; Q_SIGNALS: void defaultSinkChanged(); void preferredSinkChanged(); private: void sinkAdded(int index); void sinkRemoved(int index); void updatePreferredSink(); Sink *findPreferredSink() const; SinkModelPrivate *d; }; class KF5PULSEAUDIOQT_EXPORT SinkInputModel : public AbstractModel { Q_OBJECT public: SinkInputModel(QObject *parent = nullptr); private: void *d; }; class KF5PULSEAUDIOQT_EXPORT SourceModel : public AbstractModel { Q_OBJECT Q_PROPERTY(PulseAudioQt::Source *defaultSource READ defaultSource NOTIFY defaultSourceChanged) public: enum ItemRole { SortByDefaultRole = PulseObjectRole + 1 }; Q_ENUMS(ItemRole) SourceModel(QObject *parent = nullptr); Source *defaultSource() const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; Q_SIGNALS: void defaultSourceChanged(); private: void *d; }; class KF5PULSEAUDIOQT_EXPORT SourceOutputModel : public AbstractModel { Q_OBJECT public: SourceOutputModel(QObject *parent = nullptr); private: void *d; }; class KF5PULSEAUDIOQT_EXPORT StreamRestoreModel : public AbstractModel { Q_OBJECT public: StreamRestoreModel(QObject *parent = nullptr); private: void *d; }; class KF5PULSEAUDIOQT_EXPORT ModuleModel : public AbstractModel { Q_OBJECT public: ModuleModel(QObject *parent = nullptr); private: void *d; }; } // PulseAudioQt #endif // PULSEAUDIO_H diff --git a/src/sink.h b/src/sink.h index a842fe9..554917f 100644 --- a/src/sink.h +++ b/src/sink.h @@ -1,55 +1,55 @@ /* Copyright 2014-2015 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef SINK_H #define SINK_H #include "device.h" struct pa_sink_info; namespace PulseAudioQt { class KF5PULSEAUDIOQT_EXPORT Sink : public Device { Q_OBJECT public: ~Sink(); - void setVolume(qint64 volume) Q_DECL_OVERRIDE; - void setMuted(bool muted) Q_DECL_OVERRIDE; - void setActivePortIndex(quint32 port_index) Q_DECL_OVERRIDE; - void setChannelVolume(int channel, qint64 volume) Q_DECL_OVERRIDE; + void setVolume(qint64 volume) override; + void setMuted(bool muted) override; + void setActivePortIndex(quint32 port_index) override; + void setChannelVolume(int channel, qint64 volume) override; - bool isDefault() const Q_DECL_OVERRIDE; - void setDefault(bool enable) Q_DECL_OVERRIDE; + bool isDefault() const override; + void setDefault(bool enable) override; private: explicit Sink(QObject *parent); class SinkPrivate *const d; friend class MapBase; }; } // PulseAudioQt #endif // SINK_H diff --git a/src/sinkinput.h b/src/sinkinput.h index 22045f7..46c6cd4 100644 --- a/src/sinkinput.h +++ b/src/sinkinput.h @@ -1,54 +1,54 @@ /* Copyright 2014-2015 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef SINKINPUT_H #define SINKINPUT_H #include "stream.h" struct pa_sink_input_info; namespace PulseAudioQt { class SinkInput : public Stream { Q_OBJECT public: ~SinkInput(); void setSinkIndex(quint32 sinkIndex); - void setVolume(qint64 volume) Q_DECL_OVERRIDE; - void setMuted(bool muted) Q_DECL_OVERRIDE; - void setChannelVolume(int channel, qint64 volume) Q_DECL_OVERRIDE; - void setDeviceIndex(quint32 deviceIndex) Q_DECL_OVERRIDE; + void setVolume(qint64 volume) override; + void setMuted(bool muted) override; + void setChannelVolume(int channel, qint64 volume) override; + void setDeviceIndex(quint32 deviceIndex) override; private: SinkInput(QObject *parent); class SinkInputPrivate *const d; friend class MapBase; }; } // PulseAudioQt #endif // SINKINPUT_H diff --git a/src/source.h b/src/source.h index 616c00f..4c47b1d 100644 --- a/src/source.h +++ b/src/source.h @@ -1,55 +1,55 @@ /* Copyright 2014-2015 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef SOURCE_H #define SOURCE_H #include "device.h" struct pa_source_info; namespace PulseAudioQt { class KF5PULSEAUDIOQT_EXPORT Source : public Device { Q_OBJECT public: ~Source(); - void setVolume(qint64 volume) Q_DECL_OVERRIDE; - void setMuted(bool muted) Q_DECL_OVERRIDE; - void setActivePortIndex(quint32 port_index) Q_DECL_OVERRIDE; - void setChannelVolume(int channel, qint64 volume) Q_DECL_OVERRIDE; + void setVolume(qint64 volume) override; + void setMuted(bool muted) override; + void setActivePortIndex(quint32 port_index) override; + void setChannelVolume(int channel, qint64 volume) override; - bool isDefault() const Q_DECL_OVERRIDE; - void setDefault(bool enable) Q_DECL_OVERRIDE; + bool isDefault() const override; + void setDefault(bool enable) override; private: explicit Source(QObject *parent); class SourcePrivate *const d; friend class MapBase; }; } // PulseAudioQt #endif // SOURCE_H diff --git a/src/sourceoutput.h b/src/sourceoutput.h index ea7fbd7..3a16f0c 100644 --- a/src/sourceoutput.h +++ b/src/sourceoutput.h @@ -1,52 +1,52 @@ /* Copyright 2014-2015 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 6 of version 3 of the license. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef SOURCEOUTPUT_H #define SOURCEOUTPUT_H #include "stream.h" struct pa_source_output_info; namespace PulseAudioQt { class SourceOutput : public Stream { Q_OBJECT public: ~SourceOutput(); - void setVolume(qint64 volume) Q_DECL_OVERRIDE; - void setMuted(bool muted) Q_DECL_OVERRIDE; - void setChannelVolume(int channel, qint64 volume) Q_DECL_OVERRIDE; - void setDeviceIndex(quint32 deviceIndex) Q_DECL_OVERRIDE; + void setVolume(qint64 volume) override; + void setMuted(bool muted) override; + void setChannelVolume(int channel, qint64 volume) override; + void setDeviceIndex(quint32 deviceIndex) override; private: explicit SourceOutput(QObject *parent); class SourceOutputPrivate *const d; friend class MapBase; }; } // PulseAudioQt #endif // SOURCEOUTPUT_H