File indexing completed on 2024-09-29 07:11:53

0001 /*
0002     SPDX-FileCopyrightText: 2017 David Rosca <nowrep@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "module.h"
0008 #include "debug.h"
0009 #include "module_p.h"
0010 
0011 #include "context.h"
0012 #include "indexedpulseobject_p.h"
0013 
0014 namespace PulseAudioQt
0015 {
0016 Module::Module(QObject *parent)
0017     : IndexedPulseObject(parent)
0018     , d(new ModulePrivate(this))
0019 {
0020 }
0021 
0022 ModulePrivate::ModulePrivate(Module *q)
0023     : q(q)
0024 {
0025 }
0026 
0027 ModulePrivate::~ModulePrivate()
0028 {
0029 }
0030 
0031 void ModulePrivate::update(const pa_module_info *info)
0032 {
0033     q->IndexedPulseObject::d->updatePulseObject(info);
0034     q->PulseObject::d->updateProperties(info);
0035 
0036     const QString infoArgument = QString::fromUtf8(info->argument);
0037     if (m_argument != infoArgument) {
0038         m_argument = infoArgument;
0039         Q_EMIT q->argumentChanged();
0040     }
0041 }
0042 
0043 Module::~Module()
0044 {
0045     delete d;
0046 }
0047 
0048 QString Module::argument() const
0049 {
0050     return d->m_argument;
0051 }
0052 
0053 } // PulseAudioQt