~mterry/indicator-sound/snap-root

« back to all changes in this revision

Viewing changes to tests/dbus-types/pulseaudio-volume.h

  • Committer: CI Train Bot
  • Author(s): Xavi Garcia Mena
  • Date: 2016-01-05 15:08:02 UTC
  • mfrom: (513.1.2 restore-osd-notifications)
  • Revision ID: ci-train-bot@canonical.com-20160105150802-9n0tg5ipbbq2qbab
This branch just readds the OSD notifications code, that was reverted in trunk as the corresponding silo was also rolled back after landing.
Approved by: PS Jenkins bot, Xavi Garcia

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License along
 
14
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Author: Xavi Garcia <xavi.garcia.mena@canonical.com>
 
17
 */
 
18
#pragma once
 
19
 
 
20
#include <QtDBus>
 
21
 
 
22
class PulseaudioVolume
 
23
{
 
24
public:
 
25
    PulseaudioVolume();
 
26
    PulseaudioVolume(unsigned int type, unsigned int volume);
 
27
    PulseaudioVolume(const PulseaudioVolume &other);
 
28
    PulseaudioVolume& operator=(const PulseaudioVolume &other);
 
29
    ~PulseaudioVolume();
 
30
 
 
31
    friend QDBusArgument &operator<<(QDBusArgument &argument, PulseaudioVolume const & volume);
 
32
    friend const QDBusArgument &operator>>(QDBusArgument const & argument, PulseaudioVolume &volume);
 
33
 
 
34
    unsigned int getType() const;
 
35
    unsigned int getVolume() const;
 
36
 
 
37
    //register Message with the Qt type system
 
38
    static void registerMetaType();
 
39
 
 
40
private:
 
41
    unsigned int type_;
 
42
    unsigned int volume_;
 
43
};
 
44
 
 
45
class PulseaudioVolumeArray
 
46
{
 
47
public:
 
48
    PulseaudioVolumeArray();
 
49
    PulseaudioVolumeArray(QString const &interface, QString const &property, QDBusVariant const& value);
 
50
    PulseaudioVolumeArray(const PulseaudioVolumeArray &other);
 
51
    PulseaudioVolumeArray& operator=(const PulseaudioVolumeArray &other);
 
52
    ~PulseaudioVolumeArray();
 
53
 
 
54
    friend QDBusArgument &operator<<(QDBusArgument &argument, PulseaudioVolumeArray const & volume);
 
55
    friend const QDBusArgument &operator>>(QDBusArgument const & argument, PulseaudioVolumeArray &volume);
 
56
 
 
57
    int getNumItems() const;
 
58
    PulseaudioVolume getItem(int i) const;
 
59
    void addItem(PulseaudioVolume const &item);
 
60
 
 
61
    //register Message with the Qt type system
 
62
    static void registerMetaType();
 
63
 
 
64
private:
 
65
    QVector<PulseaudioVolume> volume_array_;
 
66
};
 
67
 
 
68
Q_DECLARE_METATYPE(PulseaudioVolume)
 
69
Q_DECLARE_METATYPE(PulseaudioVolumeArray)