Verified Commit 8b82de77 authored by Alf Gaida's avatar Alf Gaida

Adding upstream version 0.14.0.

Signed-off-by: Alf Gaida's avatarAlf Gaida <agaida@siduction.org>
parent a41e7ede
pavucontrol-qt-0.14.0 / 2019-01-25
=================================
* Bumped version to 0.14.0
* Added FreeBSD installation instructions
* Implementation fixed:
- Some code modernizations like range based loops,
auto declared iterators and use of nullptr
- Don't use automatic string conversions
- Remove unused Makefile.am
- Treat the 'off' card profile specifically
- Mainwindow: Don't use deprecated libpulse members
* Improved cmake scripting
- Set cmake_minimum_required to 3.1.0
- Removed locale compile definitons
* Moved translations from lxqt-l10n back to pavucontrol-qt
- Removed obsolete translation fuctionality
- Added translation promo in README.md
* Translation updates
pavucontrol-qt-0.4.0 / 2018-05-21
=================================
......@@ -12,8 +32,8 @@ pavucontrol-qt-0.4.0 / 2018-05-21
* pavucontrol: Remove unique application constraint
* Add Simplified Chinese desktop entry
0.3.0 / 2017-09-24
==================
pavucontrol-qt-0.3.0 / 2017-09-24
=================================
* Release 0.3.0: Update changelog
* Bump version to 0.3.0
......@@ -38,8 +58,8 @@ pavucontrol-qt-0.4.0 / 2018-05-21
* MainWindow: Add quit shortcut
* Added pavucontrol-qt_da.desktop
0.2.0 / 2016-12-11
==================
pavucontrol-qt-0.2.0 / 2016-12-11
=================================
* Release 0.2.0: Update changelog
* Release 0.2.0: Update changelog
......@@ -52,8 +72,8 @@ pavucontrol-qt-0.4.0 / 2018-05-21
* CMakeLists: Remove XdgUserDirs requirement
* mainwindow: Set icon for eventRoleWidget
0.1.0 / 2016-09-24
==================
pavucontrol-qt-0.1.0 / 2016-09-24
=================================
* Release 0.1.0: Add changelog
* devicewidget: Remove debug
......
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# CMP0000: Call the cmake_minimum_required() command at the beginning of the top-level
# CMakeLists.txt file even before calling the project() command.
# The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION)
# command to specify that the current project code is written for the given range of CMake
# versions.
project(pavucontrol-qt)
option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
set(LXQTBT_MINIMUM_VERSION "0.5.0")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
......@@ -13,18 +17,20 @@ set(CMAKE_AUTOUIC ON)
include(GNUInstallDirs)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(Qt5DBus REQUIRED)
# Minimum Versions
set(GLIB_MINIMUM_VERSION "2.50.0")
set(LXQTBT_MINIMUM_VERSION "0.6.0")
set(QT_MINIMUM_VERSION "5.7.1")
find_package(Qt5Widgets ${QT_MINIMUM_VERSION} REQUIRED)
find_package(Qt5LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
find_package(Qt5DBus ${QT_MINIMUM_VERSION} REQUIRED)
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
find_package(GLIB ${GLIB_MINIMUM_VERSION} REQUIRED)
set(PAVUCONTROLQT_MAJOR_VERSION 0)
set(PAVUCONTROLQT_MINOR_VERSION 4)
set(PAVUCONTROLQT_MINOR_VERSION 14)
set(PAVUCONTROLQT_PATCH_VERSION 0)
set(PAVUCONTROLQT_VERSION ${PAVUCONTROLQT_MAJOR_VERSION}.${PAVUCONTROLQT_MINOR_VERSION}.${PAVUCONTROLQT_PATCH_VERSION})
add_definitions("-DPAVUCONTROLQT_VERSION=\"${PAVUCONTROLQT_VERSION}\"")
......@@ -39,10 +45,5 @@ pkg_check_modules(
libpulse>=5.0
libpulse-mainloop-glib>=0.9.16
)
pkg_check_modules(
GLIB REQUIRED
glib-2.0
)
add_subdirectory(src)
......@@ -21,10 +21,21 @@ To build run `make`, to install `make install` which accepts variable `DESTDIR`
### Binary packages
This project was launched in August 2016 and binary packages are rare so far. On Arch Linux an [AUR](https://aur.archlinux.org/) package [pavucontrol-qt-git](https://aur.archlinux.org/packages/pavucontrol-qt-git/) can be used to build current checkouts of branch `master`.
This project was launched in August 2016 and binary packages are rare so far.
On Arch Linux an [AUR](https://aur.archlinux.org/) package [pavucontrol-qt-git](https://aur.archlinux.org/packages/pavucontrol-qt-git/) can be used to build current checkouts of branch `master`.
On FreeBSD the binary package is available as [pavucontrol-qt](https://www.freshports.org/audio/pavucontrol-qt/) and can be installed with `pkg install pavucontrol-qt`.
## Usage
In LXQt sessions the binary is placed in sub-menu "Sound & Video" of the panel's main menu.
The usage itself should be self-explanatory.
The usage itself should be self-explanatory.
### Translation (Weblate)
<a href="https://weblate.lxqt.org/projects/lxqt/pavucontrol-qt/">
<img src="https://weblate.lxqt.org/widgets/lxqt/-/pavucontrol-qt/multi-auto.svg" alt="Translation status" />
</a>
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include_directories(
${PULSE_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
......@@ -54,15 +50,8 @@ lxqt_translate_ts(pavucontrol-qt_QM_FILES
${pavucontrol-qt_UI}
INSTALL_DIR
"${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/translations"
PULL_TRANSLATIONS
${PULL_TRANSLATIONS}
CLEAN_TRANSLATIONS
${CLEAN_TRANSLATIONS}
TRANSLATIONS_REPO
${TRANSLATIONS_REPO}
TRANSLATIONS_REFSPEC
${TRANSLATIONS_REFSPEC}
)
lxqt_translate_desktop(DESKTOP_FILES
SOURCES
pavucontrol-qt.desktop.in
......
# This file is part of pavucontrol.
#
# Copyright 2006-2008 Lennart Poettering
#
# pavucontrol is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# pavucontrol is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pavucontrol. If not, see <https://www.gnu.org/licenses/>.
desktopdir = $(datadir)/applications
gladedir = $(pkgdatadir)
localedir = $(datadir)/locale
bin_PROGRAMS=pavucontrol
glade_DATA=pavucontrol.glade
desktop_in_files=pavucontrol.desktop.in
desktop_DATA=$(desktop_in_files:.desktop.in=.desktop)
pavucontrol_SOURCES= \
minimalstreamwidget.h minimalstreamwidget.cc \
channelwidget.h channelwidget.cc \
streamwidget.h streamwidget.cc \
devicewidget.h devicewidget.cc \
cardwidget.h cardwidget.cc \
sinkwidget.h sinkwidget.cc \
sourcewidget.h sourcewidget.cc \
sinkinputwidget.h sinkinputwidget.cc \
sourceoutputwidget.h sourceoutputwidget.cc \
rolewidget.h rolewidget.cc \
mainwindow.h mainwindow.cc \
pavucontrol.h pavucontrol.cc \
i18n.h
pavucontrol_LDADD=$(AM_LDADD) $(GUILIBS_LIBS) $(PULSE_LIBS)
pavucontrol_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) $(PULSE_CFLAGS) -DLOCALEDIR=\"$(localedir)\"
pavucontrol_CXXFLAGS+=-DGLADE_FILE=\"$(gladedir)/pavucontrol.glade\"
#pavucontrol_CXXFLAGS+=-DGLADE_FILE=\"pavucontrol.glade\"
EXTRA_DIST = $(glade_DATA) $(desktop_in_files)
CLEANFILES = $(desktop_DATA)
@INTLTOOL_DESKTOP_RULE@
......@@ -29,44 +29,64 @@ CardWidget::CardWidget(QWidget* parent) :
QWidget(parent) {
setupUi(this);
connect(profileList, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &CardWidget::onProfileChange);
connect(profileCB, &QAbstractButton::toggled, this, &CardWidget::onProfileCheck);
}
void CardWidget::prepareMenu() {
int idx = 0;
int active_idx = -1;
const bool off = activeProfile == noInOutProfile;
profileList->clear();
/* Fill the ComboBox */
for (uint32_t i = 0; i < profiles.size(); ++i) {
const auto& profile = profiles[i];
for (const auto & profile : profiles) {
QByteArray name = profile.first;
// skip the "off" profile
if (name == noInOutProfile)
continue;
QString desc = QString::fromUtf8(profile.second);
profileList->addItem(desc, name);
if (profile.first == activeProfile)
active_idx = idx;
idx++;
if (profile.first == activeProfile
|| (off && profile.first == lastActiveProfile)
)
{
profileList->setCurrentIndex(idx);
lastActiveProfile = profile.first;
}
++idx;
}
if (active_idx >= 0)
profileList->setCurrentIndex(active_idx);
profileCB->setChecked(!off);
}
void CardWidget::changeProfile(const QByteArray & name)
{
pa_operation* o;
if (!(o = pa_context_set_card_profile_by_index(get_context(), index, name.constData(), nullptr, nullptr))) {
show_error(tr("pa_context_set_card_profile_by_index() failed").toUtf8().constData());
return;
}
pa_operation_unref(o);
}
void CardWidget::onProfileChange(int active) {
if (updating)
return;
if (active != -1) {
QString desc = profileList->itemText(active);
QByteArray name = profileList->itemData(active).toByteArray();
pa_operation* o;
if (active != -1)
changeProfile(profileList->itemData(active).toByteArray());
}
if (!(o = pa_context_set_card_profile_by_index(get_context(), index, name.constData(), NULL, NULL))) {
show_error(tr("pa_context_set_card_profile_by_index() failed").toUtf8().constData());
return;
}
void CardWidget::onProfileCheck(bool on)
{
if (updating)
return;
if (on)
onProfileChange(profileList->currentIndex());
else
changeProfile(noInOutProfile);
pa_operation_unref(o);
}
}
......@@ -48,13 +48,17 @@ public:
std::vector< std::pair<QByteArray,QByteArray> > profiles;
std::map<QByteArray, PortInfo> ports;
QByteArray activeProfile;
QByteArray noInOutProfile;
QByteArray lastActiveProfile;
bool hasSinks;
bool hasSources;
void prepareMenu();
protected:
virtual void onProfileChange(int active);
void changeProfile(const QByteArray & name);
void onProfileChange(int active);
void onProfileCheck(bool on);
};
......
......@@ -13,9 +13,9 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="nameHLayout" stretch="0,1">
<item>
<widget class="QLabel" name="iconImage">
<property name="text">
......@@ -32,17 +32,28 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Profile:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="profileList"/>
<item>
<layout class="QHBoxLayout" name="profileHLayout" stretch="0,0,1">
<item>
<widget class="QCheckBox" name="profileCB">
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="profileLabel">
<property name="text">
<string>Profile:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="profileList"/>
</item>
</layout>
</item>
<item row="2" column="0" colspan="2">
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -52,5 +63,38 @@
</layout>
</widget>
<resources/>
<connections/>
<connections>
<connection>
<sender>profileCB</sender>
<signal>toggled(bool)</signal>
<receiver>profileLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>137</x>
<y>47</y>
</hint>
<hint type="destinationlabel">
<x>147</x>
<y>47</y>
</hint>
</hints>
</connection>
<connection>
<sender>profileCB</sender>
<signal>toggled(bool)</signal>
<receiver>profileList</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>137</x>
<y>47</y>
</hint>
<hint type="destinationlabel">
<x>315</x>
<y>47</y>
</hint>
</hints>
</connection>
</connections>
</ui>
......@@ -60,8 +60,8 @@ DeviceWidget::DeviceWidget(MainWindow* parent, QByteArray deviceType) :
connect(portList, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &DeviceWidget::onPortChange);
connect(offsetButton, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &DeviceWidget::onOffsetChange);
for (unsigned i = 0; i < PA_CHANNELS_MAX; i++)
channels[i] = NULL;
for (auto & channel : channels)
channel = nullptr;
// FIXME:
......@@ -151,7 +151,7 @@ void DeviceWidget::onOffsetChange() {
card_name = QByteArray::fromStdString(card_stream.str());
if (!(o = pa_context_set_port_latency_offset(get_context(),
card_name, activePort, offset, NULL, NULL))) {
card_name, activePort, offset, nullptr, nullptr))) {
show_error(tr("pa_context_set_port_latency_offset() failed").toUtf8().constData());
return;
}
......@@ -189,11 +189,11 @@ void DeviceWidget::prepareMenu() {
portList->clear();
/* Fill the ComboBox's Model */
for (uint32_t i = 0; i < ports.size(); ++i) {
QByteArray name = ports[i].first;
QString desc = ports[i].second;
for (auto & port : ports) {
QByteArray name = port.first;
QString desc = port.second;
portList->addItem(desc, name);
if (ports[i].first == activePort)
if (port.first == activePort)
active_idx = idx;
idx++;
}
......@@ -201,7 +201,7 @@ void DeviceWidget::prepareMenu() {
if (active_idx >= 0)
portList->setCurrentIndex(active_idx);
if (ports.size() > 0) {
if (!ports.empty()) {
portSelect->show();
if (pa_context_get_server_protocol_version(get_context()) >= 27) {
......@@ -236,7 +236,7 @@ void DeviceWidget::renamePopup() {
pa_operation* o;
gchar *key = g_markup_printf_escaped("%s:%s", mDeviceType.constData(), name.constData());
if (!(o = pa_ext_device_manager_set_device_description(get_context(), key, new_name.toUtf8().constData(), NULL, NULL)))
if (!(o = pa_ext_device_manager_set_device_description(get_context(), key, new_name.toUtf8().constData(), nullptr, nullptr)))
show_error(tr("pa_ext_device_manager_set_device_description() failed").toUtf8().constData());
else
pa_operation_unref(o);
......
......@@ -96,7 +96,7 @@
</item>
<item>
<widget class="QWidget" name="portSelect" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
......
This diff is collapsed.
......@@ -32,7 +32,7 @@ MinimalStreamWidget::MinimalStreamWidget(QWidget *parent) :
QWidget(parent),
peakProgressBar(new QProgressBar(this)),
lastPeak(0),
peak(NULL),
peak(nullptr),
updating(false),
volumeMeterEnabled(false),
volumeMeterVisible(true) {
......
......@@ -51,8 +51,8 @@
#include <QCommandLineOption>
#include <QString>
static pa_context* context = NULL;
static pa_mainloop_api* api = NULL;
static pa_context* context = nullptr;
static pa_mainloop_api* api = nullptr;
static int n_outstanding = 0;
static int default_tab = 0;
static bool retry = false;
......@@ -179,11 +179,11 @@ void source_output_cb(pa_context *, const pa_source_output_info *i, int eol, voi
* let's open one that isn't empty */
if (default_tab != -1) {
if (default_tab < 1 || default_tab > w->notebook->count()) {
if (w->sinkInputWidgets.size() > 0)
if (!w->sinkInputWidgets.empty())
w->notebook->setCurrentIndex(0);
else if (w->sourceOutputWidgets.size() > 0)
else if (!w->sourceOutputWidgets.empty())
w->notebook->setCurrentIndex(1);
else if (w->sourceWidgets.size() > 0 && w->sinkWidgets.size() == 0)
else if (!w->sourceWidgets.empty() && w->sinkWidgets.empty())
w->notebook->setCurrentIndex(3);
else
w->notebook->setCurrentIndex(2);
......@@ -470,7 +470,7 @@ void context_state_callback(pa_context *c, void *userdata) {
PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT|
PA_SUBSCRIPTION_MASK_CLIENT|
PA_SUBSCRIPTION_MASK_SERVER|
PA_SUBSCRIPTION_MASK_CARD), NULL, NULL))) {
PA_SUBSCRIPTION_MASK_CARD), nullptr, nullptr))) {
show_error(QObject::tr("pa_context_subscribe() failed").toUtf8().constData());
return;
}
......@@ -535,7 +535,7 @@ void context_state_callback(pa_context *c, void *userdata) {
pa_ext_stream_restore_set_subscribe_cb(c, ext_stream_restore_subscribe_cb, w);
if ((o = pa_ext_stream_restore_subscribe(c, 1, NULL, NULL)))
if ((o = pa_ext_stream_restore_subscribe(c, 1, nullptr, nullptr)))
pa_operation_unref(o);
} else
......@@ -549,7 +549,7 @@ void context_state_callback(pa_context *c, void *userdata) {
pa_ext_device_restore_set_subscribe_cb(c, ext_device_restore_subscribe_cb, w);
if ((o = pa_ext_device_restore_subscribe(c, 1, NULL, NULL)))
if ((o = pa_ext_device_restore_subscribe(c, 1, nullptr, nullptr)))
pa_operation_unref(o);
} else
......@@ -562,7 +562,7 @@ void context_state_callback(pa_context *c, void *userdata) {
pa_ext_device_manager_set_subscribe_cb(c, ext_device_manager_subscribe_cb, w);
if ((o = pa_ext_device_manager_subscribe(c, 1, NULL, NULL)))
if ((o = pa_ext_device_manager_subscribe(c, 1, nullptr, nullptr)))
pa_operation_unref(o);
} else
......@@ -578,7 +578,7 @@ void context_state_callback(pa_context *c, void *userdata) {
w->removeAllWidgets();
w->updateDeviceVisibility();
pa_context_unref(context);
context = NULL;
context = nullptr;
if (reconnect_timeout > 0) {
g_debug("%s", QObject::tr("Connection failed, attempting reconnect").toUtf8().constData());
......@@ -609,7 +609,7 @@ gboolean connect_to_pulse(gpointer userdata) {
pa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "audio-card");
pa_proplist_sets(proplist, PA_PROP_APPLICATION_VERSION, PACKAGE_VERSION);
context = pa_context_new_with_proplist(api, NULL, proplist);
context = pa_context_new_with_proplist(api, nullptr, proplist);
g_assert(context);
pa_proplist_free(proplist);
......@@ -617,7 +617,7 @@ gboolean connect_to_pulse(gpointer userdata) {
pa_context_set_state_callback(context, context_state_callback, w);
w->setConnectingMessage();
if (pa_context_connect(context, NULL, PA_CONTEXT_NOFAIL, NULL) < 0) {
if (pa_context_connect(context, nullptr, PA_CONTEXT_NOFAIL, nullptr) < 0) {
if (pa_context_errno(context) == PA_ERR_INVALID) {
w->setConnectingMessage(QObject::tr("Connection to PulseAudio failed. Automatic retry in 5s\n\n"
"In this case this is likely because PULSE_SERVER in the Environment/X11 Root Window Properties\n"
......
......@@ -51,11 +51,11 @@ void RoleWidget::executeVolumeUpdate() {
info.channel_map.channels = 1;
info.channel_map.map[0] = PA_CHANNEL_POSITION_MONO;
info.volume = volume;
info.device = device == "" ? NULL : device.constData();
info.device = device == "" ? nullptr : device.constData();
info.mute = muteToggleButton->isChecked();
pa_operation* o;
if (!(o = pa_ext_stream_restore_write(get_context(), PA_UPDATE_REPLACE, &info, 1, TRUE, NULL, NULL))) {
if (!(o = pa_ext_stream_restore_write(get_context(), PA_UPDATE_REPLACE, &info, 1, TRUE, nullptr, nullptr))) {
show_error(tr("pa_ext_stream_restore_write() failed").toUtf8().constData());
return;
}
......
......@@ -60,7 +60,7 @@ uint32_t SinkInputWidget::sinkIndex() {
void SinkInputWidget::executeVolumeUpdate() {
pa_operation* o;
if (!(o = pa_context_set_sink_input_volume(get_context(), index, &volume, NULL, NULL))) {
if (!(o = pa_context_set_sink_input_volume(get_context(), index, &volume, nullptr, nullptr))) {
show_error(tr("pa_context_set_sink_input_volume() failed").toUtf8().constData());
return;
}
......@@ -75,7 +75,7 @@ void SinkInputWidget::onMuteToggleButton() {
return;
pa_operation* o;
if (!(o = pa_context_set_sink_input_mute(get_context(), index, muteToggleButton->isChecked(), NULL, NULL))) {
if (!(o = pa_context_set_sink_input_mute(get_context(), index, muteToggleButton->isChecked(), nullptr, nullptr))) {
show_error(tr("pa_context_set_sink_input_mute() failed").toUtf8().constData());
return;
}
......@@ -85,7 +85,7 @@ void SinkInputWidget::onMuteToggleButton() {
void SinkInputWidget::onKill() {
pa_operation* o;
if (!(o = pa_context_kill_sink_input(get_context(), index, NULL, NULL))) {
if (!(o = pa_context_kill_sink_input(get_context(), index, nullptr, nullptr))) {
show_error(tr("pa_context_kill_sink_input() failed").toUtf8().constData());
return;
}
......@@ -94,8 +94,8 @@ void SinkInputWidget::onKill() {
}
void SinkInputWidget::buildMenu() {
for (std::map<uint32_t, SinkWidget*>::iterator i = mpMainWindow->sinkWidgets.begin(); i != mpMainWindow->sinkWidgets.end(); ++i) {
menu->addAction(new SinkMenuItem{this, i->second->description, i->second->index, i->second->index == mSinkIndex, menu});
for (auto & sinkWidget : mpMainWindow->sinkWidgets) {
menu->addAction(new SinkMenuItem{this, sinkWidget.second->description, sinkWidget.second->index, sinkWidget.second->index == mSinkIndex, menu});
}
}
......@@ -110,7 +110,7 @@ void SinkInputWidget::SinkMenuItem::onToggle() {
return;*/
pa_operation* o;
if (!(o = pa_context_move_sink_input_by_index(get_context(), widget->index, index, NULL, NULL))) {
if (!(o = pa_context_move_sink_input_by_index(get_context(), widget->index, index, nullptr, nullptr))) {
show_error(tr("pa_context_move_sink_input_by_index() failed").toUtf8().constData());
return;
}
......
......@@ -77,7 +77,7 @@ SinkWidget::SinkWidget(MainWindow *parent) :
void SinkWidget::executeVolumeUpdate() {
pa_operation* o;
if (!(o = pa_context_set_sink_volume_by_index(get_context(), index, &volume, NULL, NULL))) {
if (!(o = pa_context_set_sink_volume_by_index(get_context(), index, &volume, nullptr, nullptr))) {
show_error(tr("pa_context_set_sink_volume_by_index() failed").toUtf8().constData());
return;
}
......@@ -92,7 +92,7 @@ void SinkWidget::onMuteToggleButton() {
return;
pa_operation* o;
if (!(o = pa_context_set_sink_mute_by_index(get_context(), index, muteToggleButton->isChecked(), NULL, NULL))) {
if (!(o = pa_context_set_sink_mute_by_index(get_context(), index, muteToggleButton->isChecked(), nullptr, nullptr))) {
show_error(tr("pa_context_set_sink_mute_by_index() failed").toUtf8().constData());
return;
}
......@@ -106,7 +106,7 @@ void SinkWidget::onDefaultToggleButton() {
if (updating)
return;
if (!(o = pa_context_set_default_sink(get_context(), name, NULL, NULL))) {
if (!(o = pa_context_set_default_sink(get_context(), name, nullptr, nullptr))) {
show_error(tr("pa_context_set_default_sink() failed").toUtf8().constData());
return;
}
......@@ -122,7 +122,7 @@ void SinkWidget::onPortChange() {
pa_operation* o;
QByteArray port = portList->itemData(sel).toString().toUtf8();
if (!(o = pa_context_set_sink_port_by_index(get_context(), index, port.constData(), NULL, NULL))) {
if (!(o = pa_context_set_sink_port_by_index(get_context(), index, port.constData(), nullptr, nullptr))) {
show_error(tr("pa_context_set_sink_port_by_index() failed").toUtf8().constData());
return;
}
......@@ -154,15 +154,15 @@ void SinkWidget::onEncodingsChange() {
formats = (pa_format_info**)malloc(sizeof(pa_format_info*) * PAVU_NUM_ENCODINGS);
for (int i = 0; i < PAVU_NUM_ENCODINGS; ++i) {
if (encodings[i].widget->isChecked()) {
for (auto & encoding : encodings) {
if (encoding.widget->isChecked()) {
formats[n_formats] = pa_format_info_new();
formats[n_formats]->encoding = encodings[i].encoding;
formats[n_formats]->encoding = encoding.encoding;
++n_formats;
}
}
if (!(o = pa_ext_device_restore_save_formats(get_context(), PA_DEVICE_TYPE_SINK, index, n_formats, formats, NULL, NULL))) {
if (!(o = pa_ext_device_restore_save_formats(get_context(), PA_DEVICE_TYPE_SINK, index, n_formats, formats, nullptr, nullptr))) {
show_error(tr("pa_ext_device_restore_save_sink_formats() failed").toUtf8().constData());
free(formats);
return;
......
......@@ -68,7 +68,7 @@ uint32_t SourceOutputWidget::sourceIndex() {
void SourceOutputWidget::executeVolumeUpdate() {
pa_operation* o;
if (!(o = pa_context_set_source_output_volume(get_context(), index, &volume, NULL, NULL))) {
if (!(o = pa_context_set_source_output_volume(get_context(), index, &volume, nullptr, nullptr))) {
show_error(tr("pa_context_set_source_output_volume() failed").toUtf8().constData());
return;
}
......@@ -83,7 +83,7 @@ void SourceOutputWidget::onMuteToggleButton() {
return;
pa_operation* o;
if (!(o = pa_context_set_source_output_mute(get_context(), index, muteToggleButton->isChecked(), NULL, NULL))) {
if (!(o = pa_context_set_source_output_mute(get_context(), index, muteToggleButton->isChecked(), nullptr, nullptr))) {
show_error(tr("pa_context_set_source_output_mute() failed").toUtf8().constData());
return;
}
......@@ -94,7 +94,7 @@ void SourceOutputWidget::onMuteToggleButton() {
void SourceOutputWidget::onKill() {
pa_operation* o;
if (!(o = pa_context_kill_source_output(get_context(), index, NULL, NULL))) {
if (!(o = pa_context_kill_source_output(get_context(), index, nullptr, nullptr))) {
show_error(tr("pa_context_kill_source_output() failed").toUtf8().constData());
return;
}
......@@ -104,8 +104,8 @@ void SourceOutputWidget::onKill() {
void SourceOutputWidget::buildMenu() {