Changeset View
Changeset View
Standalone View
Standalone View
src/sink.h
- This file was copied to src/canberracontext.cpp.
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef SINK_H | 21 | #ifndef SINK_H | ||
22 | #define SINK_H | 22 | #define SINK_H | ||
23 | 23 | | |||
24 | #include "device.h" | 24 | #include "device.h" | ||
25 | #include <pulse/channelmap.h> | ||||
26 | #include <canberra.h> | ||||
25 | 27 | | |||
26 | namespace QPulseAudio | 28 | namespace QPulseAudio | ||
27 | { | 29 | { | ||
28 | 30 | | |||
29 | class Sink : public Device | 31 | class Sink : public Device | ||
30 | { | 32 | { | ||
31 | Q_OBJECT | 33 | Q_OBJECT | ||
32 | public: | 34 | public: | ||
33 | explicit Sink(QObject *parent); | 35 | explicit Sink(QObject *parent); | ||
36 | virtual ~Sink(); | ||||
drosca: No reason to add empty destructor. | |||||
34 | 37 | | |||
35 | void update(const pa_sink_info *info); | 38 | void update(const pa_sink_info *info); | ||
36 | void setVolume(qint64 volume) override; | 39 | void setVolume(qint64 volume) override; | ||
37 | void setMuted(bool muted) override; | 40 | void setMuted(bool muted) override; | ||
38 | void setActivePortIndex(quint32 port_index) override; | 41 | void setActivePortIndex(quint32 port_index) override; | ||
39 | void setChannelVolume(int channel, qint64 volume) override; | 42 | void setChannelVolume(int channel, qint64 volume) override; | ||
40 | 43 | | |||
41 | bool isDefault() const override; | 44 | bool isDefault() const override; | ||
42 | void setDefault(bool enable) override; | 45 | void setDefault(bool enable) override; | ||
46 | | ||||
47 | public slots: | ||||
drosca: `const QString &name` | |||||
48 | void testChannel(const QString &name); | ||||
49 | | ||||
50 | private: | ||||
51 | pa_channel_position_t channelNameToPosition(const QString &name); | ||||
52 | QString positionToChannelName(pa_channel_position_t position); | ||||
53 | QString positionAsString(pa_channel_position_t pos); | ||||
54 | | ||||
drosca: It should reuse context from `VolumeFeedback`. | |||||
43 | }; | 55 | }; | ||
44 | 56 | | |||
45 | } // QPulseAudio | 57 | } // QPulseAudio | ||
46 | 58 | | |||
47 | #endif // SINK_H | 59 | #endif // SINK_H |
No reason to add empty destructor.