summaryrefslogtreecommitdiffstats
path: root/src/PulseAudioQt/module.cpp
blob: af80fb7ae288e17c106bce64299d4ea36d31b946 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
    SPDX-FileCopyrightText: 2017 David Rosca <nowrep@gmail.com>

    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/

#include "module.h"
#include "debug.h"
#include "module_p.h"

#include "context.h"
#include "indexedpulseobject_p.h"

namespace PulseAudioQt
{
Module::Module(QObject *parent)
    : IndexedPulseObject(parent)
    , d(new ModulePrivate(this))
{
}

ModulePrivate::ModulePrivate(Module *q)
    : q(q)
{
}

ModulePrivate::~ModulePrivate()
{
}

void ModulePrivate::update(const pa_module_info *info)
{
    q->IndexedPulseObject::d->updatePulseObject(info);
    q->PulseObject::d->updateProperties(info);

    const QString infoArgument = QString::fromUtf8(info->argument);
    if (m_argument != infoArgument) {
        m_argument = infoArgument;
        Q_EMIT q->argumentChanged();
    }
}

Module::~Module()
{
    delete d;
}

QString Module::argument() const
{
    return d->m_argument;
}

} // PulseAudioQt