2 * Copyright (C) 2016,2017 Konsulko Group
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include <pulse/pulseaudio.h>
19 #include <QtCore/QHash>
20 #include <QtCore/QObject>
22 const char * const channel_position_string[] =
51 class PaClient : public QObject
61 inline pa_context *context() const
68 pa_threaded_mainloop_lock(m_ml);
73 pa_threaded_mainloop_unlock(m_ml);
76 void addOneControlState(int type, int index, const pa_cvolume *cvolume);
78 QHash<int, pa_cvolume *> sink_states();
79 QHash<int, pa_cvolume *> source_states();
82 void setVolume(uint32_t type, uint32_t index, uint32_t channel, uint32_t volume);
85 void controlAdded(int cindex, QString name, QString desc, int type, int channel, const char *cdesc, int volume);
86 void volumeExternallyChanged(uint32_t type, uint32_t cindex, uint32_t channel, uint32_t volume);
90 pa_threaded_mainloop *m_ml;
91 pa_mainloop_api *m_mlapi;
93 QHash<int, pa_cvolume *> m_sink_states;
94 QHash<int, pa_cvolume *> m_source_states;