Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pulseaudio-qt for openSUSE:Factory checked in at 2024-05-28 17:28:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pulseaudio-qt (Old) and /work/SRC/openSUSE:Factory/.pulseaudio-qt.new.24587 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pulseaudio-qt" Tue May 28 17:28:37 2024 rev:6 rq:1177093 version:1.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/pulseaudio-qt/pulseaudio-qt.changes 2024-03-11 15:29:49.789348460 +0100 +++ /work/SRC/openSUSE:Factory/.pulseaudio-qt.new.24587/pulseaudio-qt.changes 2024-05-28 17:29:20.681162742 +0200 @@ -1,0 +2,28 @@ +Sat May 25 11:52:29 UTC 2024 - Fabian Vogt <fab...@ritter-vogt.de> + +- Update to 1.5.0: + * Add git blame ignore file + * Use QStringList instead of QList<QString> + * Stream: Fix client (kde#485455) + * Require C++17 + * Port away from qAsConst + * Replace QVector with QList + * override++ + * bump version to 1.5.0 + * streamrestore: workaround for notification volume (kde#473013) + * context: explicitly create operation + * Make setGenericVolume keep balance between channels (kde#435840) + * server: register q_properties + * models: retract defaultSink, preferredSink, and defaultSource + * device: add virtualDevice property + * Add portal.app_id to iconName lookup in pulseobject.cpp for flatpak + * device: document switchStreams + * sink, source: refine the implementation of switchStreams + * Add command to switch all applications to the selected device + * server: emit updated signal after updates + * context: remove refcounting remnants + * device: add property pulseProperties + * foreach-- + * operation: mark explicit + +------------------------------------------------------------------- Old: ---- pulseaudio-qt-1.4.0.tar.xz pulseaudio-qt-1.4.0.tar.xz.sig New: ---- pulseaudio-qt-1.5.0.tar.xz pulseaudio-qt-1.5.0.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pulseaudio-qt.spec ++++++ --- /var/tmp/diff_new_pack.Cb0Qfe/_old 2024-05-28 17:29:21.757202090 +0200 +++ /var/tmp/diff_new_pack.Cb0Qfe/_new 2024-05-28 17:29:21.757202090 +0200 @@ -22,24 +22,24 @@ %define qt6 1 %define kf6_version 5.246.0 %define qt6_version 6.6.0 -%define library_name libKF6PulseAudioQt4 +%define library_name libKF6PulseAudioQt5 %else %define kf5_version 5.90 %define qt5_version 5.15.2 -%define library_name libKF5PulseAudioQt4 +%define library_name libKF5PulseAudioQt5 %endif %define rname pulseaudio-qt %bcond_without released Name: pulseaudio-qt%{?pkg_suffix} -Version: 1.4.0 +Version: 1.5.0 Release: 0 Summary: Qt bindings for PulseAudio License: LGPL-2.1-or-later URL: https://www.kde.org -Source: https://download.kde.org/stable/%{name}/%{rname}-%{version}.tar.xz +Source: https://download.kde.org/stable/pulseaudio-qt/%{rname}-%{version}.tar.xz %if %{with released} -Source1: https://download.kde.org/stable/%{name}/%{rname}-%{version}.tar.xz.sig +Source1: https://download.kde.org/stable/pulseaudio-qt/%{rname}-%{version}.tar.xz.sig Source2: pulseaudio-qt.keyring %endif BuildRequires: pkgconfig ++++++ pulseaudio-qt-1.4.0.tar.xz -> pulseaudio-qt-1.5.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/.git-blame-ignore-revs new/pulseaudio-qt-1.5.0/.git-blame-ignore-revs --- old/pulseaudio-qt-1.4.0/.git-blame-ignore-revs 1970-01-01 01:00:00.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/.git-blame-ignore-revs 2024-05-24 19:11:26.000000000 +0200 @@ -0,0 +1 @@ +f9511e23cfaf5da3b3e19f18ca02f08f376800e3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/CMakeLists.txt new/pulseaudio-qt-1.5.0/CMakeLists.txt --- old/pulseaudio-qt-1.4.0/CMakeLists.txt 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/CMakeLists.txt 2024-05-24 19:11:26.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -set(PROJECT_VERSION 1.4.0) +set(PROJECT_VERSION 1.5.0) project(PulseAudioQt VERSION ${PROJECT_VERSION}) @@ -11,6 +11,8 @@ feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) include(GenerateExportHeader) include(CMakePackageConfigHelpers) @@ -34,7 +36,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX PULSEAUDIOQT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/pulseaudioqt_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF${QT_MAJOR_VERSION}PulseAudioQtConfigVersion.cmake" - SOVERSION 4) + SOVERSION 5) set(REQUIRED_QT_VERSION 5.15.0) find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Gui DBus) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/card.cpp new/pulseaudio-qt-1.5.0/src/card.cpp --- old/pulseaudio-qt-1.4.0/src/card.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/card.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -48,7 +48,7 @@ QStringList newProfiles; QStringList existingProfiles; - for (const Profile *profile : qAsConst(m_profiles)) { + for (const Profile *profile : std::as_const(m_profiles)) { existingProfiles << profile->name(); } @@ -75,7 +75,7 @@ } } - for (Profile *profile : qAsConst(m_profiles)) { + for (Profile *profile : std::as_const(m_profiles)) { if (info->active_profile2->name == profile->name()) { m_activeProfileIndex = m_profiles.indexOf(profile); } @@ -87,7 +87,7 @@ QStringList newPorts; QStringList existingPorts; - for (const Port *port : qAsConst(m_ports)) { + for (const Port *port : std::as_const(m_ports)) { existingPorts << port->name(); } for (auto **it = info->ports; it && *it != nullptr; ++it) { @@ -103,7 +103,7 @@ port->d->setInfo(*it); } - for (CardPort *port : qAsConst(m_ports)) { + for (CardPort *port : std::as_const(m_ports)) { if (!newPorts.contains(port->name())) { m_ports.removeOne(port); delete port; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/card_p.h new/pulseaudio-qt-1.5.0/src/card_p.h --- old/pulseaudio-qt-1.4.0/src/card_p.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/card_p.h 2024-05-24 19:11:26.000000000 +0200 @@ -10,7 +10,7 @@ #include "cardport.h" #include "profile.h" #include <QHash> -#include <QVector> +#include <QList> #include <pulse/introspect.h> namespace PulseAudioQt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/cardport.h new/pulseaudio-qt-1.5.0/src/cardport.h --- old/pulseaudio-qt-1.4.0/src/cardport.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/cardport.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,7 +21,7 @@ Q_OBJECT public: - ~CardPort(); + ~CardPort() override; void update(const pa_card_port_info *info); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/client.h new/pulseaudio-qt-1.5.0/src/client.h --- old/pulseaudio-qt-1.4.0/src/client.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/client.h 2024-05-24 19:11:26.000000000 +0200 @@ -18,7 +18,7 @@ { Q_OBJECT public: - ~Client(); + ~Client() override; private: explicit Client(QObject *parent); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/context.cpp new/pulseaudio-qt-1.5.0/src/context.cpp --- old/pulseaudio-qt-1.4.0/src/context.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/context.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -252,7 +252,6 @@ d->m_server = new Server(this); d->m_context = nullptr; d->m_mainloop = nullptr; - d->m_references = 0; d->connectToDaemon(); @@ -715,42 +714,42 @@ return d->m_context && d->m_mainloop; } -QVector<Sink *> Context::sinks() const +QList<Sink *> Context::sinks() const { return d->m_sinks.data(); } -QVector<SinkInput *> Context::sinkInputs() const +QList<SinkInput *> Context::sinkInputs() const { return d->m_sinkInputs.data(); } -QVector<Source *> Context::sources() const +QList<Source *> Context::sources() const { return d->m_sources.data(); } -QVector<SourceOutput *> Context::sourceOutputs() const +QList<SourceOutput *> Context::sourceOutputs() const { return d->m_sourceOutputs.data(); } -QVector<Client *> Context::clients() const +QList<Client *> Context::clients() const { return d->m_clients.data(); } -QVector<Card *> Context::cards() const +QList<Card *> Context::cards() const { return d->m_cards.data(); } -QVector<Module *> Context::modules() const +QList<Module *> Context::modules() const { return d->m_modules.data(); } -QVector<StreamRestore *> Context::streamRestores() const +QList<StreamRestore *> Context::streamRestores() const { return d->m_streamRestores.data(); } @@ -773,15 +772,18 @@ newVolume = qBound<qint64>(0, newVolume, PA_VOLUME_MAX); pa_cvolume newCVolume = cVolume; if (channel == -1) { // -1 all channels - const qint64 diff = newVolume - pa_cvolume_max(&cVolume); + const qint64 orig = pa_cvolume_max(&cVolume); + const qint64 diff = newVolume - orig; for (int i = 0; i < newCVolume.channels; ++i) { - newCVolume.values[i] = qBound<qint64>(0, newCVolume.values[i] + diff, PA_VOLUME_MAX); + const qint64 channel = newCVolume.values[i]; + const qint64 channelDiff = orig == 0 ? diff : diff * channel / orig; + newCVolume.values[i] = qBound<qint64>(0, newCVolume.values[i] + channelDiff, PA_VOLUME_MAX); } } else { Q_ASSERT(newCVolume.channels > channel); newCVolume.values[channel] = newVolume; } - if (!pa_set_volume(m_context, index, &newCVolume, nullptr, nullptr)) { + if (!PAOperation(pa_set_volume(m_context, index, &newCVolume, nullptr, nullptr))) { qCWarning(PULSEAUDIOQT) << "pa_set_volume failed"; return; } @@ -829,7 +831,7 @@ void ContextPrivate::setGenericVolumes( quint32 index, - QVector<qint64> channelVolumes, + QList<qint64> channelVolumes, pa_cvolume cVolume, const std::function<pa_operation *(pa_context *, uint32_t, const pa_cvolume *, pa_context_success_cb_t, void *)> &pa_set_volume) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/context.h new/pulseaudio-qt-1.5.0/src/context.h --- old/pulseaudio-qt-1.4.0/src/context.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/context.h 2024-05-24 19:11:26.000000000 +0200 @@ -51,7 +51,7 @@ Q_OBJECT public: - ~Context(); + ~Context() override; static Context *instance(); @@ -69,56 +69,56 @@ * * @return list of sinks */ - QVector<Sink *> sinks() const; + QList<Sink *> sinks() const; /** * Returns a list of all sink inputs. * * @return list of sink inputs */ - QVector<SinkInput *> sinkInputs() const; + QList<SinkInput *> sinkInputs() const; /** * Returns a list of all sources. * * @return list of sources */ - QVector<Source *> sources() const; + QList<Source *> sources() const; /** * Returns a list of all source outputs. * * @return list of source outputs */ - QVector<SourceOutput *> sourceOutputs() const; + QList<SourceOutput *> sourceOutputs() const; /** * Returns a list of all clients. * * @return list of clients */ - QVector<Client *> clients() const; + QList<Client *> clients() const; /** * Returns a list of all cards. * * @return list of cards */ - QVector<Card *> cards() const; + QList<Card *> cards() const; /** * Returns a list of all modules. * * @return list of modules */ - QVector<Module *> modules() const; + QList<Module *> modules() const; /** * Returns a list of all stream restores. * * @return list of stream restores */ - QVector<StreamRestore *> streamRestores() const; + QList<StreamRestore *> streamRestores() const; Server *server() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/context_p.h new/pulseaudio-qt-1.5.0/src/context_p.h --- old/pulseaudio-qt-1.4.0/src/context_p.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/context_p.h 2024-05-24 19:11:26.000000000 +0200 @@ -43,8 +43,6 @@ QString m_newDefaultSink; QString m_newDefaultSource; - int m_references; - QTimer m_connectTimer; int m_connectTries; @@ -75,7 +73,7 @@ quint32 deviceIndex, const std::function<pa_operation *(pa_context *, uint32_t, uint32_t, pa_context_success_cb_t, void *)> &); void setGenericVolumes(quint32 index, - QVector<qint64> channelVolumes, + QList<qint64> channelVolumes, pa_cvolume cVolume, const std::function<pa_operation *(pa_context *, uint32_t, const pa_cvolume *, pa_context_success_cb_t, void *)> &); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/device.cpp new/pulseaudio-qt-1.5.0/src/device.cpp --- old/pulseaudio-qt-1.4.0/src/device.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/device.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -39,12 +39,21 @@ return d->m_activePortIndex; } - qint64 Device::baseVolume() const { return d->m_baseVolume; } +QVariantMap Device::pulseProperties() const +{ + return d->m_pulseProperties; +} + +bool Device::isVirtualDevice() const +{ + return d->m_virtualDevice; +} + Device::Device(QObject *parent) : VolumeObject(parent) , d(new DevicePrivate(this)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/device.h new/pulseaudio-qt-1.5.0/src/device.h --- old/pulseaudio-qt-1.4.0/src/device.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/device.h 2024-05-24 19:11:26.000000000 +0200 @@ -8,6 +8,7 @@ #define PA_DEVICE_H #include <QString> +#include <QVariantMap> #include "port.h" #include "volumeobject.h" @@ -31,6 +32,8 @@ Q_PROPERTY(quint32 activePortIndex READ activePortIndex WRITE setActivePortIndex NOTIFY activePortIndexChanged) Q_PROPERTY(bool default READ isDefault WRITE setDefault NOTIFY defaultChanged) Q_PROPERTY(qint64 baseVolume READ baseVolume NOTIFY baseVolumeChanged) + Q_PROPERTY(QVariantMap pulseProperties READ pulseProperties NOTIFY pulsePropertiesChanged) + Q_PROPERTY(bool virtualDevice READ isVirtualDevice NOTIFY virtualDeviceChanged) public: enum State { @@ -46,7 +49,7 @@ }; Q_ENUM(State); - ~Device(); + ~Device() override; /** * The state of this device. @@ -100,6 +103,24 @@ */ qint64 baseVolume() const; + /** + * @return QVariantMap the pulseaudio properties of this device (e.g. media.class, device.api, ...) + */ + [[nodiscard]] QVariantMap pulseProperties() const; + + /** + * @brief Switch all streams onto this Device + * Iterates through all relevant streams for the Device type and assigns them to this Device. + * For example for a Sink device all SinkInputs known to the daemon will be explicitly switched + * onto this Sink. Useful for mass-rerouting of streams from different devices onto a specific target device. + */ + virtual Q_INVOKABLE void switchStreams() = 0; + + /** + * @returns true when the device is a virtual device (e.g. a software-only sink) + */ + bool isVirtualDevice() const; + Q_SIGNALS: void stateChanged(); void descriptionChanged(); @@ -109,6 +130,8 @@ void activePortIndexChanged(); void defaultChanged(); void baseVolumeChanged(); + void pulsePropertiesChanged(); + void virtualDeviceChanged(); protected: /** @private */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/device_p.h new/pulseaudio-qt-1.5.0/src/device_p.h --- old/pulseaudio-qt-1.4.0/src/device_p.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/device_p.h 2024-05-24 19:11:26.000000000 +0200 @@ -9,7 +9,7 @@ #include <pulse/proplist.h> #include <QHash> -#include <QVector> +#include <QList> #include "device.h" #include "port.h" @@ -32,10 +32,27 @@ quint32 m_activePortIndex = -1; Device::State m_state = Device::UnknownState; qint64 m_baseVolume = -1; + QVariantMap m_pulseProperties; + bool m_virtualDevice = false; Device::State stateFromPaState(int value) const; template<typename PAInfo> + void updatePulseProperties(const PAInfo *info) + { + QVariantMap pulseProperties; + void *state = nullptr; + while (auto key = pa_proplist_iterate(info->proplist, &state)) { + const auto value = pa_proplist_gets(info->proplist, key); + pulseProperties.insert(key, QString::fromUtf8(value)); + } + if (pulseProperties != m_pulseProperties) { + m_pulseProperties = pulseProperties; + Q_EMIT q->pulsePropertiesChanged(); + } + } + + template<typename PAInfo> void updateDevice(const PAInfo *info) { q->VolumeObject::d->updateVolumeObject(info); @@ -56,11 +73,13 @@ m_cardIndex = info->card; Q_EMIT q->cardIndexChanged(); + updatePulseProperties(info); + QStringList newPorts; QStringList existingPorts; // Build list of existing ports - for (const Port *port : qAsConst(m_ports)) { + for (const Port *port : std::as_const(m_ports)) { existingPorts << port->name(); } @@ -82,7 +101,7 @@ } // Remove ports that are not in the updated port list - for (Port *port : qAsConst(m_ports)) { + for (Port *port : std::as_const(m_ports)) { if (!newPorts.contains(port->name())) { m_ports.removeOne(port); delete port; @@ -90,7 +109,7 @@ } // Set active port - for (Port *port : qAsConst(m_ports)) { + for (Port *port : std::as_const(m_ports)) { if (info->active_port->name == port->name()) { m_activePortIndex = m_ports.indexOf(port); } @@ -109,6 +128,12 @@ m_baseVolume = info->base_volume; Q_EMIT q->baseVolumeChanged(); } + + const bool isVirtual = !(info->flags & 4); // PA_X_HARDWARE + if (m_virtualDevice != isVirtual) { + m_virtualDevice = isVirtual; + Q_EMIT q->virtualDeviceChanged(); + } } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/indexedpulseobject.h new/pulseaudio-qt-1.5.0/src/indexedpulseobject.h --- old/pulseaudio-qt-1.4.0/src/indexedpulseobject.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/indexedpulseobject.h 2024-05-24 19:11:26.000000000 +0200 @@ -20,7 +20,7 @@ Q_PROPERTY(quint32 index READ index CONSTANT) public: - ~IndexedPulseObject(); + ~IndexedPulseObject() override; /** * Index of this object. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/maps.h new/pulseaudio-qt-1.5.0/src/maps.h --- old/pulseaudio-qt-1.4.0/src/maps.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/maps.h 2024-05-24 19:11:26.000000000 +0200 @@ -8,9 +8,9 @@ #pragma once #include <QHash> +#include <QList> #include <QObject> #include <QSet> -#include <QVector> #include <pulse/ext-stream-restore.h> #include <pulse/pulseaudio.h> @@ -67,11 +67,9 @@ class MapBase : public MapBaseQObject { public: - virtual ~MapBase() - { - } + ~MapBase() override = default; - const QVector<Type *> &data() const + const QList<Type *> &data() const { return m_data; } @@ -148,7 +146,7 @@ } protected: - QVector<Type *> m_data; + QList<Type *> m_data; QHash<quint32, Type *> m_hash; QSet<quint32> m_pendingRemovals; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/models.cpp new/pulseaudio-qt-1.5.0/src/models.cpp --- old/pulseaudio-qt-1.4.0/src/models.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/models.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -196,8 +196,8 @@ QObject *data = d->m_map->objectAt(index); const QMetaObject *mo = data->metaObject(); // We have all the data changed notify signals already stored - auto keys = d->m_signalIndexToProperties.keys(); - foreach (int index, keys) { + const auto keys = d->m_signalIndexToProperties.keys(); + for (const auto &index : keys) { QMetaMethod meth = mo->method(index); connect(data, meth, this, propertyChangedMetaMethod()); } @@ -215,46 +215,8 @@ SinkModel::SinkModel(QObject *parent) : AbstractModel(&context()->d->m_sinks, parent) - , d(new SinkModelPrivate(this)) { initRoleNames(Sink::staticMetaObject); - - for (int i = 0; i < context()->d->m_sinks.count(); ++i) { - sinkAdded(i); - } - - connect(&context()->d->m_sinks, &MapBaseQObject::added, this, &SinkModel::sinkAdded); - connect(&context()->d->m_sinks, &MapBaseQObject::removed, this, &SinkModel::sinkRemoved); - - connect(context()->server(), &Server::defaultSinkChanged, this, [this]() { - updatePreferredSink(); - Q_EMIT defaultSinkChanged(); - }); -} - -SinkModel::~SinkModel() -{ - delete d; -} - -SinkModelPrivate::SinkModelPrivate(SinkModel *q) - : q(q) - , m_preferredSink(nullptr) -{ -} - -SinkModelPrivate::~SinkModelPrivate() -{ -} - -Sink *SinkModel::defaultSink() const -{ - return context()->server()->defaultSink(); -} - -Sink *SinkModel::preferredSink() const -{ - return d->m_preferredSink; } QVariant SinkModel::data(const QModelIndex &index, int role) const @@ -268,88 +230,10 @@ return AbstractModel::data(index, role); } -void SinkModel::sinkAdded(int index) -{ - Q_ASSERT(qobject_cast<Sink *>(context()->d->m_sinks.objectAt(index))); - Sink *sink = static_cast<Sink *>(context()->d->m_sinks.objectAt(index)); - connect(sink, &Sink::stateChanged, this, &SinkModel::updatePreferredSink); - - updatePreferredSink(); -} - -void SinkModel::sinkRemoved(int index) -{ - Q_UNUSED(index); - - updatePreferredSink(); -} - -void SinkModel::updatePreferredSink() -{ - Sink *sink = findPreferredSink(); - - if (sink != d->m_preferredSink) { - qCDebug(PULSEAUDIOQT) << "Changing preferred sink to" << sink << (sink ? sink->name() : ""); - d->m_preferredSink = sink; - Q_EMIT preferredSinkChanged(); - } -} - -Sink *SinkModel::findPreferredSink() const -{ - const auto &sinks = context()->d->m_sinks; - - // Only one sink is the preferred one - if (sinks.count() == 1) { - return static_cast<Sink *>(sinks.objectAt(0)); - } - - auto lookForState = [&](Device::State state) { - Sink *ret = nullptr; - const auto data = sinks.data(); - for (Sink *sink : data) { - if (sink->state() != state) { - continue; - } - if (!ret) { - ret = sink; - } else if (sink == defaultSink()) { - ret = sink; - break; - } - } - return ret; - }; - - Sink *preferred = nullptr; - - // Look for playing sinks + prefer default sink - preferred = lookForState(Device::RunningState); - if (preferred) { - return preferred; - } - - // Look for idle sinks + prefer default sink - preferred = lookForState(Device::IdleState); - if (preferred) { - return preferred; - } - - // Fallback to default sink - return defaultSink(); -} - SourceModel::SourceModel(QObject *parent) : AbstractModel(&context()->d->m_sources, parent) { initRoleNames(Source::staticMetaObject); - - connect(context()->server(), &Server::defaultSourceChanged, this, &SourceModel::defaultSourceChanged); -} - -Source *SourceModel::defaultSource() const -{ - return context()->server()->defaultSource(); } QVariant SourceModel::data(const QModelIndex &index, int role) const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/models.h new/pulseaudio-qt-1.5.0/src/models.h --- old/pulseaudio-qt-1.4.0/src/models.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/models.h 2024-05-24 19:11:26.000000000 +0200 @@ -75,28 +75,15 @@ class PULSEAUDIOQT_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_ENUM(ItemRole) SinkModel(QObject *parent = nullptr); - virtual ~SinkModel(); - Sink *defaultSink() const; - Sink *preferredSink() const; 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; + void *d; }; class PULSEAUDIOQT_EXPORT SinkInputModel : public AbstractModel @@ -112,18 +99,13 @@ class PULSEAUDIOQT_EXPORT SourceModel : public AbstractModel { Q_OBJECT - Q_PROPERTY(PulseAudioQt::Source *defaultSource READ defaultSource NOTIFY defaultSourceChanged) public: enum ItemRole { SortByDefaultRole = PulseObjectRole + 1 }; Q_ENUM(ItemRole) SourceModel(QObject *parent = nullptr); - Source *defaultSource() const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; -Q_SIGNALS: - void defaultSourceChanged(); - private: void *d; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/models_p.h new/pulseaudio-qt-1.5.0/src/models_p.h --- old/pulseaudio-qt-1.4.0/src/models_p.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/models_p.h 2024-05-24 19:11:26.000000000 +0200 @@ -20,14 +20,4 @@ QHash<int, int> m_objectProperties; QHash<int, int> m_signalIndexToProperties; }; - -class SinkModelPrivate -{ -public: - explicit SinkModelPrivate(SinkModel *q); - virtual ~SinkModelPrivate(); - - SinkModel *q; - Sink *m_preferredSink; -}; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/module.h new/pulseaudio-qt-1.5.0/src/module.h --- old/pulseaudio-qt-1.4.0/src/module.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/module.h 2024-05-24 19:11:26.000000000 +0200 @@ -20,7 +20,7 @@ Q_PROPERTY(QString argument READ argument NOTIFY argumentChanged) public: - ~Module(); + ~Module() override; QString argument() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/operation.h new/pulseaudio-qt-1.5.0/src/operation.h --- old/pulseaudio-qt-1.4.0/src/operation.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/operation.h 2024-05-24 19:11:26.000000000 +0200 @@ -25,7 +25,7 @@ * @brief PAOperation * @param operation operation to manage the scope of */ - PAOperation(pa_operation *operation = nullptr); + explicit PAOperation(pa_operation *operation = nullptr); ~PAOperation(); PAOperation &operator=(pa_operation *operation); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/port.h new/pulseaudio-qt-1.5.0/src/port.h --- old/pulseaudio-qt-1.4.0/src/port.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/port.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,7 +21,7 @@ Q_PROPERTY(Type type READ type NOTIFY typeChanged) public: - ~Port(); + ~Port() override; enum Type { Unknown, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/profile.h new/pulseaudio-qt-1.5.0/src/profile.h --- old/pulseaudio-qt-1.4.0/src/profile.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/profile.h 2024-05-24 19:11:26.000000000 +0200 @@ -30,7 +30,7 @@ enum Availability { Unknown, Available, Unavailable }; Q_ENUM(Availability) - ~Profile(); + ~Profile() override; /** * A human readable description. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/pulseobject.cpp new/pulseaudio-qt-1.5.0/src/pulseobject.cpp --- old/pulseaudio-qt-1.4.0/src/pulseobject.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/pulseobject.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -70,6 +70,11 @@ return name; } + name = d->m_properties.value(QStringLiteral("pipewire.access.portal.app_id")).toString(); + if (!name.isEmpty() && QIcon::hasThemeIcon(name)) { + return name; + } + name = property("name").toString(); if (!name.isEmpty() && QIcon::hasThemeIcon(name)) { return name; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/pulseobject.h new/pulseaudio-qt-1.5.0/src/pulseobject.h --- old/pulseaudio-qt-1.4.0/src/pulseobject.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/pulseobject.h 2024-05-24 19:11:26.000000000 +0200 @@ -29,7 +29,7 @@ Q_PROPERTY(QVariantMap properties READ properties NOTIFY propertiesChanged) public: - ~PulseObject(); + ~PulseObject() override; QString name() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/server.cpp new/pulseaudio-qt-1.5.0/src/server.cpp --- old/pulseaudio-qt-1.4.0/src/server.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/server.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -91,6 +91,8 @@ } q->updateDefaultDevices(); + + Q_EMIT q->updated(); } /** @private */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/server.h new/pulseaudio-qt-1.5.0/src/server.h --- old/pulseaudio-qt-1.4.0/src/server.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/server.h 2024-05-24 19:11:26.000000000 +0200 @@ -1,5 +1,6 @@ /* SPDX-FileCopyrightText: 2016 David Rosca <now...@gmail.com> + SPDX-FileCopyrightText: 2024 Harald Sitter <sit...@kde.org> SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ @@ -19,9 +20,14 @@ class PULSEAUDIOQT_EXPORT Server : public QObject { Q_OBJECT - + /// The default Sink (SinkInputs that aren't otherwise assigned explicitly will use this Sink) + Q_PROPERTY(Sink *defaultSink READ defaultSink NOTIFY defaultSinkChanged) + /// The default Source (SourceOutputs that aren't otherwise assigned explicitly will use this Source) + Q_PROPERTY(Source *defaultSource READ defaultSource NOTIFY defaultSourceChanged) + /// Whether the connected Server is PipeWire (rather than PulseAudio) + Q_PROPERTY(bool isPipeWire READ isPipeWire NOTIFY isPipeWireChanged) public: - ~Server(); + ~Server() override; Sink *defaultSink() const; void setDefaultSink(Sink *sink); @@ -38,6 +44,7 @@ void defaultSinkChanged(PulseAudioQt::Sink *sink); void defaultSourceChanged(PulseAudioQt::Source *source); void isPipeWireChanged(); + void updated(); private: explicit Server(Context *context); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/sink.cpp new/pulseaudio-qt-1.5.0/src/sink.cpp --- old/pulseaudio-qt-1.4.0/src/sink.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/sink.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -10,6 +10,7 @@ #include "context.h" #include "context_p.h" #include "server.h" +#include "sinkinput.h" #include "device_p.h" #include "volumeobject_p.h" @@ -85,9 +86,17 @@ return d->m_monitorIndex; } -void Sink::setChannelVolumes(const QVector<qint64> &channelVolumes) +void Sink::setChannelVolumes(const QList<qint64> &channelVolumes) { Context::instance()->d->setGenericVolumes(index(), channelVolumes, VolumeObject::d->m_volume, &pa_context_set_sink_volume_by_index); } +void Sink::switchStreams() +{ + const auto sinkInputs = Context::instance()->sinkInputs(); + for (const auto &sinkInput : sinkInputs) { + sinkInput->setDeviceIndex(index()); + } +} + } // PulseAudioQt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/sink.h new/pulseaudio-qt-1.5.0/src/sink.h --- old/pulseaudio-qt-1.4.0/src/sink.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/sink.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,7 +21,7 @@ Q_OBJECT public: - ~Sink(); + ~Sink() override; void setVolume(qint64 volume) override; @@ -35,8 +35,10 @@ void setDefault(bool enable) override; - void setChannelVolumes(const QVector<qint64> &channelVolumes) override; + void setChannelVolumes(const QList<qint64> &channelVolumes) override; + void switchStreams() override; + /** * Index of the monitor source for this sink. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/sinkinput.cpp new/pulseaudio-qt-1.5.0/src/sinkinput.cpp --- old/pulseaudio-qt-1.4.0/src/sinkinput.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/sinkinput.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -58,7 +58,7 @@ Context::instance()->d->setGenericVolume(index(), channel, volume, VolumeObject::d->cvolume(), &pa_context_set_sink_input_volume); } -void SinkInput::setChannelVolumes(const QVector<qint64> &channelVolumes) +void SinkInput::setChannelVolumes(const QList<qint64> &channelVolumes) { Context::instance()->d->setGenericVolumes(index(), channelVolumes, VolumeObject::d->m_volume, &pa_context_set_sink_input_volume); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/sinkinput.h new/pulseaudio-qt-1.5.0/src/sinkinput.h --- old/pulseaudio-qt-1.4.0/src/sinkinput.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/sinkinput.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,13 +21,13 @@ Q_OBJECT public: - ~SinkInput(); + ~SinkInput() override; void setVolume(qint64 volume) override; void setMuted(bool muted) override; void setChannelVolume(int channel, qint64 volume) override; void setDeviceIndex(quint32 deviceIndex) override; - void setChannelVolumes(const QVector<qint64> &channelVolumes) override; + void setChannelVolumes(const QList<qint64> &channelVolumes) override; private: SinkInput(QObject *parent); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/source.cpp new/pulseaudio-qt-1.5.0/src/source.cpp --- old/pulseaudio-qt-1.4.0/src/source.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/source.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -69,7 +69,15 @@ } } -void Source::setChannelVolumes(const QVector<qint64> &volumes) +void Source::switchStreams() +{ + const auto sourceOutputs = Context::instance()->sourceOutputs(); + for (const auto &sourceOutput : sourceOutputs) { + sourceOutput->setDeviceIndex(index()); + } +} + +void Source::setChannelVolumes(const QList<qint64> &volumes) { Context::instance()->d->setGenericVolumes(index(), volumes, VolumeObject::d->m_volume, &pa_context_set_source_volume_by_index); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/source.h new/pulseaudio-qt-1.5.0/src/source.h --- old/pulseaudio-qt-1.4.0/src/source.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/source.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,17 +21,19 @@ Q_OBJECT public: - ~Source(); + ~Source() override; 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; + void setChannelVolumes(const QList<qint64> &volumes) override; bool isDefault() const override; void setDefault(bool enable) override; + void switchStreams() override; + private: explicit Source(QObject *parent); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/sourceoutput.cpp new/pulseaudio-qt-1.5.0/src/sourceoutput.cpp --- old/pulseaudio-qt-1.4.0/src/sourceoutput.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/sourceoutput.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -58,7 +58,7 @@ Context::instance()->d->setGenericVolume(index(), channel, volume, VolumeObject::d->cvolume(), &pa_context_set_source_output_volume); } -void SourceOutput::setChannelVolumes(const QVector<qint64> &channelVolumes) +void SourceOutput::setChannelVolumes(const QList<qint64> &channelVolumes) { Context::instance()->d->setGenericVolumes(index(), channelVolumes, VolumeObject::d->m_volume, &pa_context_set_source_output_volume); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/sourceoutput.h new/pulseaudio-qt-1.5.0/src/sourceoutput.h --- old/pulseaudio-qt-1.4.0/src/sourceoutput.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/sourceoutput.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,13 +21,13 @@ Q_OBJECT public: - ~SourceOutput(); + ~SourceOutput() override; void setVolume(qint64 volume) override; void setMuted(bool muted) override; void setChannelVolume(int channel, qint64 volume) override; void setDeviceIndex(quint32 deviceIndex) override; - void setChannelVolumes(const QVector<qint64> &channelVolumes) override; + void setChannelVolumes(const QList<qint64> &channelVolumes) override; private: explicit SourceOutput(QObject *parent); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/stream.cpp new/pulseaudio-qt-1.5.0/src/stream.cpp --- old/pulseaudio-qt-1.4.0/src/stream.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/stream.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -34,7 +34,14 @@ Client *Stream::client() const { - return Context::instance()->d->m_clients.data().value(d->m_clientIndex, nullptr); + const auto &clients = Context::instance()->d->m_clients.data(); + auto it = std::find_if(clients.begin(), clients.end(), [this](Client *client) { + return client->index() == d->m_clientIndex; + }); + if (it != clients.end()) { + return *it; + } + return nullptr; } bool Stream::isVirtualStream() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/stream.h new/pulseaudio-qt-1.5.0/src/stream.h --- old/pulseaudio-qt-1.4.0/src/stream.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/stream.h 2024-05-24 19:11:26.000000000 +0200 @@ -28,7 +28,7 @@ Q_PROPERTY(bool hasVolume READ hasVolume NOTIFY hasVolumeChanged) public: - ~Stream(); + ~Stream() override; Client *client() const; bool isVirtualStream() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/streamrestore.cpp new/pulseaudio-qt-1.5.0/src/streamrestore.cpp --- old/pulseaudio-qt-1.4.0/src/streamrestore.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/streamrestore.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -89,7 +89,14 @@ qint64 StreamRestore::volume() const { - return d->m_volume.values[0]; + // FIXME: workaround for pipewire not supporting stream restore subscription + // revert when fix is released + // https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3805 + if (d->m_cache.valid) { + return d->m_cache.volume.values[0]; + } else { + return d->m_volume.values[0]; + } } void StreamRestore::setVolume(qint64 volume) @@ -115,7 +122,14 @@ bool StreamRestore::isMuted() const { - return d->m_muted; + // FIXME: workaround for pipewire not supporting stream restore subscription + // revert when fix is released + // https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/3805 + if (d->m_cache.valid) { + return d->m_cache.muted; + } else { + return d->m_muted; + } } void StreamRestore::setMuted(bool muted) @@ -141,14 +155,14 @@ return true; } -QVector<QString> StreamRestore::channels() const +QStringList StreamRestore::channels() const { return d->m_channels; } -QVector<qreal> StreamRestore::channelVolumes() const +QList<qreal> StreamRestore::channelVolumes() const { - QVector<qreal> ret; + QList<qreal> ret; ret.reserve(d->m_volume.channels); for (int i = 0; i < d->m_volume.channels; ++i) { ret << d->m_volume.values[i]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/streamrestore.h new/pulseaudio-qt-1.5.0/src/streamrestore.h --- old/pulseaudio-qt-1.4.0/src/streamrestore.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/streamrestore.h 2024-05-24 19:11:26.000000000 +0200 @@ -21,14 +21,14 @@ Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) Q_PROPERTY(bool hasVolume READ hasVolume CONSTANT) Q_PROPERTY(bool volumeWritable READ isVolumeWritable CONSTANT) - Q_PROPERTY(QVector<QString> channels READ channels NOTIFY channelsChanged) - Q_PROPERTY(QVector<qreal> channelVolumes READ channelVolumes NOTIFY channelVolumesChanged) + Q_PROPERTY(QStringList channels READ channels NOTIFY channelsChanged) + Q_PROPERTY(QList<qreal> channelVolumes READ channelVolumes NOTIFY channelVolumesChanged) Q_PROPERTY(quint32 deviceIndex READ deviceIndex WRITE setDeviceIndex NOTIFY deviceIndexChanged) // Not a IndexedPulseObject since pa_ext_stream_restore_info does not have an index member Q_PROPERTY(quint32 index READ index CONSTANT) public: - ~StreamRestore(); + ~StreamRestore() override; QString device() const; void setDevice(const QString &device); @@ -42,9 +42,9 @@ bool hasVolume() const; bool isVolumeWritable() const; - QVector<QString> channels() const; + QStringList channels() const; - QVector<qreal> channelVolumes() const; + QList<qreal> channelVolumes() const; quint32 index() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/streamrestore_p.h new/pulseaudio-qt-1.5.0/src/streamrestore_p.h --- old/pulseaudio-qt-1.4.0/src/streamrestore_p.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/streamrestore_p.h 2024-05-24 19:11:26.000000000 +0200 @@ -7,7 +7,7 @@ #define STREAMRESTORE_P_H #include "streamrestore.h" -#include <QVector> +#include <QList> #include <pulse/ext-stream-restore.h> namespace PulseAudioQt @@ -25,7 +25,7 @@ QString m_device; pa_cvolume m_volume; pa_channel_map m_channelMap; - QVector<QString> m_channels; + QStringList m_channels; bool m_muted = false; quint32 m_index = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/volumeobject.cpp new/pulseaudio-qt-1.5.0/src/volumeobject.cpp --- old/pulseaudio-qt-1.4.0/src/volumeobject.cpp 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/volumeobject.cpp 2024-05-24 19:11:26.000000000 +0200 @@ -48,7 +48,7 @@ return d->m_volumeWritable; } -QVector<QString> VolumeObject::channels() const +QStringList VolumeObject::channels() const { return d->m_channels; } @@ -58,9 +58,9 @@ return d->m_rawChannels; } -QVector<qint64> VolumeObject::channelVolumes() const +QList<qint64> VolumeObject::channelVolumes() const { - QVector<qint64> ret; + QList<qint64> ret; ret.reserve(d->m_volume.channels); for (int i = 0; i < d->m_volume.channels; ++i) { ret << d->m_volume.values[i]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/volumeobject.h new/pulseaudio-qt-1.5.0/src/volumeobject.h --- old/pulseaudio-qt-1.4.0/src/volumeobject.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/volumeobject.h 2024-05-24 19:11:26.000000000 +0200 @@ -20,12 +20,12 @@ Q_PROPERTY(qint64 volume READ volume WRITE setVolume NOTIFY volumeChanged) Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) Q_PROPERTY(bool volumeWritable READ isVolumeWritable NOTIFY isVolumeWritableChanged) - Q_PROPERTY(QVector<QString> channels READ channels NOTIFY channelsChanged) - Q_PROPERTY(QVector<qint64> channelVolumes READ channelVolumes WRITE setChannelVolumes NOTIFY channelVolumesChanged) + Q_PROPERTY(QStringList channels READ channels NOTIFY channelsChanged) + Q_PROPERTY(QList<qint64> channelVolumes READ channelVolumes WRITE setChannelVolumes NOTIFY channelVolumesChanged) Q_PROPERTY(QStringList rawChannels READ rawChannels NOTIFY rawChannelsChanged) public: - ~VolumeObject(); + ~VolumeObject() override; /** * This object's volume @@ -51,10 +51,10 @@ bool isVolumeWritable() const; - QVector<QString> channels() const; + QStringList channels() const; QStringList rawChannels() const; - QVector<qint64> channelVolumes() const; - virtual void setChannelVolumes(const QVector<qint64> &channelVolumes) = 0; + QList<qint64> channelVolumes() const; + virtual void setChannelVolumes(const QList<qint64> &channelVolumes) = 0; Q_INVOKABLE virtual void setChannelVolume(int channel, qint64 volume) = 0; Q_SIGNALS: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pulseaudio-qt-1.4.0/src/volumeobject_p.h new/pulseaudio-qt-1.5.0/src/volumeobject_p.h --- old/pulseaudio-qt-1.4.0/src/volumeobject_p.h 2024-01-08 23:15:04.000000000 +0100 +++ new/pulseaudio-qt-1.5.0/src/volumeobject_p.h 2024-05-24 19:11:26.000000000 +0200 @@ -23,7 +23,7 @@ pa_cvolume m_volume; bool m_muted = true; bool m_volumeWritable = true; - QVector<QString> m_channels; + QStringList m_channels; QStringList m_rawChannels; pa_cvolume cvolume() const; @@ -42,7 +42,7 @@ Q_EMIT q->volumeChanged(); Q_EMIT q->channelVolumesChanged(); } - QVector<QString> infoChannels; + QStringList infoChannels; infoChannels.reserve(info->channel_map.channels); for (int i = 0; i < info->channel_map.channels; ++i) { infoChannels << QString::fromUtf8(pa_channel_position_to_pretty_string(info->channel_map.map[i]));