summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt39
-rw-r--r--Makefile.am54
-rwxr-xr-xautogen.sh23
-rwxr-xr-xbootstrap.sh32
-rw-r--r--configure.ac99
-rw-r--r--doc/Makefile.am38
-rw-r--r--doc/README.html.in165
-rw-r--r--doc/screenshot.pngbin47787 -> 0 bytes
-rw-r--r--doc/style.css26
-rw-r--r--m4/.gitignore31
-rw-r--r--m4/ax_cxx_compile_stdcxx.m4558
-rw-r--r--m4/ax_cxx_compile_stdcxx_11.m439
-rw-r--r--m4/zp_lynx_doc.m424
-rw-r--r--src/CMakeLists.txt63
-rw-r--r--src/cardwidget.h2
-rw-r--r--src/i18n.h3
-rw-r--r--src/mainwindow.cc267
-rw-r--r--src/mainwindow.h22
-rw-r--r--src/mainwindow.ui253
-rw-r--r--src/pavucontrol.cc75
-rw-r--r--src/pavucontrol.h3
21 files changed, 557 insertions, 1259 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..c807b2d
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
+project(pavucontrol-qt)
+
+option(UPDATE_TRANSLATIONS "Update source translation translations/*.ts files" OFF)
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+
+include(GNUInstallDirs)
+
+find_package(Qt5Widgets REQUIRED QUIET)
+# find_package(Qt5DBus REQUIRED QUIET)
+# find_package(Qt5X11Extras REQUIRED QUIET)
+find_package(Qt5LinguistTools REQUIRED QUIET)
+
+find_package(lxqt REQUIRED QUIET)
+find_package(XdgUserDirs REQUIRED QUIET)
+
+include(LXQtCompilerSettings NO_POLICY_SCOPE)
+include(LXQtTranslate)
+
+find_package(PkgConfig REQUIRED QUIET)
+pkg_check_modules(
+ PULSE REQUIRED
+ libpulse>=5.0
+ libpulse-mainloop-glib>=0.9.16
+)
+pkg_check_modules(
+ GLIB REQUIRED
+ glib-2.0
+ glibmm-2.4 # c++ binding for glib
+)
+
+add_subdirectory(src)
+
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index a387352..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,54 +0,0 @@
-# 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 <http://www.gnu.org/licenses/>.
-
-EXTRA_DIST = \
- bootstrap.sh \
- LICENSE \
- intltool-merge.in \
- intltool-update.in \
- intltool-extract.in
-
-SUBDIRS=src doc po
-
-if USE_LYNX
-EXTRA_DIST += README
-MAINTAINERCLEANFILES = README
-noinst_DATA = README
-
-README:
- $(MAKE) -C doc README
- ln -sf doc/README $(builddir)
-endif
-
-homepage: all dist
- test -d $$HOME/homepage/private
- mkdir -p $$HOME/homepage/private/projects/pavucontrol
- cp pavucontrol-@PACKAGE_VERSION@.tar.gz $$HOME/homepage/private/projects/pavucontrol
- cp doc/README.html doc/screenshot.png doc/style.css $$HOME/homepage/private/projects/pavucontrol
- ln -sf README.html $$HOME/homepage/private/projects/pavucontrol/index.html
-
-DISTCLEANFILES = \
- intltool-extract \
- intltool-merge \
- intltool-update
-
-fedora-snapshot: dist
- cp $(distdir).tar.gz $$HOME/cvs.fedora/pavucontrol/devel/$(distdir).git`date +%Y%m%d`.tar.gz
-
-.PHONY: homepage
-
-ACLOCAL_AMFLAGS = -I m4
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 7c08180..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# This file is part of PulseAudio.
-#
-# PulseAudio 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.
-#
-# PulseAudio 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 PulseAudio; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-
-# Only there to make jhbuild happy
-
-NOCONFIGURE=1 ./bootstrap.sh
-
-exec ./configure "$@"
diff --git a/bootstrap.sh b/bootstrap.sh
deleted file mode 100755
index 4719e9c..0000000
--- a/bootstrap.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-
-# 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 <http://www.gnu.org/licenses/>.
-
-if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
- cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
- chmod +x .git/hooks/pre-commit && \
- echo "Activated pre-commit hook."
-fi
-
-intltoolize --force --automake
-autoreconf --force --install --symlink
-
-if test "x$NOCONFIGURE" = "x"; then
- CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var "$@"
- make clean
-fi
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index ee8a0e9..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
-
-# 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 <http://www.gnu.org/licenses/>.
-
-AC_PREREQ(2.62)
-AC_INIT([pavucontrol],[3.0],[mzcnihpbageby (at) 0pointer (dot) de])
-AC_CONFIG_SRCDIR([src/pavucontrol.cc])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall dist-xz tar-ustar])
-AM_SILENT_RULES([yes])
-
-AC_SUBST(PACKAGE_URL, [http://freedesktop.org/software/pulseaudio/pavucontrol/])
-
-if type -p stow > /dev/null && test -d /usr/local/stow ; then
- AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
- ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}"
-fi
-
-# Checks for programs.
-AC_PROG_CXX
-AC_PROG_CC
-AC_PROG_LN_S
-AC_TYPE_SIGNAL
-AC_HEADER_STDC
-AX_CXX_COMPILE_STDCXX_11
-
-AC_ARG_ENABLE(gtk3,
- [AS_HELP_STRING([--disable-gtk3],
- [Whether to build or not against gtk3 [default=yes]])],
- [enable_gtk3=$enableval],
- [enable_gtk3="yes"])
-
-if test "x$enable_gtk3" = "xyes"; then
- gtkmm_ver="3.0"
- gtkmm_min_ver="2.99"
- canberra_ver="3"
- AC_DEFINE([HAVE_GTK3], [1], [Define if we are building against gtk3])
- echo "***"
- echo "*** Attempting build in GTK3 mode. Use --disable-gtk3 to build for GTK2"
- echo "***"
-else
- gtkmm_ver="2.4"
- gtkmm_min_ver="2.16"
- canberra_ver=""
-fi
-PKG_CHECK_MODULES(GUILIBS, [ gtkmm-$gtkmm_ver >= $gtkmm_min_ver sigc++-2.0 libcanberra-gtk$canberra_ver >= 0.16 ])
-AC_SUBST(GUILIBS_CFLAGS)
-AC_SUBST(GUILIBS_LIBS)
-
-if test -d ../pulseaudio ; then
- PULSE_CFLAGS='-I$(top_srcdir)/../pulseaudio/src'
- PULSE_LIBS='-L$(top_srcdir)/../pulseaudio/src/.libs -lpulse -lpulse-mainloop-glib'
- echo "*** Found pulseaudio in ../pulseaudio, using that version ***"
-else
- PKG_CHECK_MODULES(PULSE, [ libpulse >= 5.0 libpulse-mainloop-glib >= 0.9.16 ])
-fi
-
-AC_SUBST(PULSE_LIBS)
-AC_SUBST(PULSE_CFLAGS)
-
-# If using GCC specifiy some additional parameters
-if test "x$GCC" = "xyes" ; then
- CFLAGS="$CFLAGS -pipe -Wall -W -Wno-unused-parameter"
- CXXFLAGS="$CXXFLAGS -pipe -Wall -W"
-fi
-
-ZP_LYNX_DOC
-
-IT_PROG_INTLTOOL([0.35.0])
-GETTEXT_PACKAGE=pavucontrol
-AC_SUBST([GETTEXT_PACKAGE])
-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
-AM_GLIB_GNU_GETTEXT
-
-AC_CONFIG_FILES([
-po/Makefile.in
-Makefile
-src/Makefile
-doc/Makefile
-doc/README.html])
-
-AC_OUTPUT
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index a0b0edc..0000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-# 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
-# <http://www.gnu.org/licenses/>.
-
-dist_html_DATA = README.html style.css
-EXTRA_DIST = README.html.in
-
-MAINTAINERCLEANFILES = README.html
-CLEANFILES =
-
-if USE_LYNX
-dist_doc_DATA = README
-
-README: README.html
- lynx --dump $^ | sed 's,file://.*/doc/README.html,README,' > $@
-
-MAINTAINERCLEANFILES += README
-CLEANFILES += README
-endif
-
-tidy: README.html
- tidy -e < README.html
-
-.PHONY: tidy
diff --git a/doc/README.html.in b/doc/README.html.in
deleted file mode 100644
index 1aa11f8..0000000
--- a/doc/README.html.in
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?> <!-- -*-html-helper-*- -->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<title>PulseAudio Volume Control @PACKAGE_VERSION@</title>
-<link rel="stylesheet" type="text/css" href="style.css" />
-</head>
-
-<body>
-<h1><a name="top">PulseAudio Volume Control @PACKAGE_VERSION@</a></h1>
-
-<p><i>Copyright 2006-2009 Lennart Poettering, 2009-2011 Colin Guthrie &lt;@PACKAGE_BUGREPORT@&gt;</i></p>
-
-<ul class="toc">
- <li><a href="#license">License</a></li>
- <li><a href="#news">News</a></li>
- <li><a href="#overview">Overview</a></li>
- <li><a href="#status">Current Status</a></li>
- <li><a href="#documentation">Documentation</a></li>
- <li><a href="#requirements">Requirements</a></li>
- <li><a href="#installation">Installation</a></li>
- <li><a href="#acks">Acknowledgements</a></li>
- <li><a href="#download">Download</a></li>
-</ul>
-
-<h2><a name="license">License</a></h2>
-
-<p>This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU Public License as published by
-the Free Software Foundation, either version 2 of the License, or (at
-your option) any later version.</p>
-
-<p>This program 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.</p>
-
-<h2><a name="news">News</a></h2>
-
-<div class="news-date">Tue Mar 24
-2015: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-3.0.tar.xz">Version
-3.0</a> released; improved error handling; remember device selection visibility; window sizing improvements.</p>
-
-<div class="news-date">Fri Mar 8
-2013: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-2.0.tar.xz">Version
-2.0</a> released.</p>
-
-<div class="news-date">Tue Sep 27
-2011: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-1.0.tar.xz">Version
-1.0</a> released.</p>
-
-<div class="news-date">Thu Sep 15
-2011: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.99.2.tar.gz">Version
-0.99.2</a> (v1 RC2) released; digital receiver UI.</p>
-
-<div class="news-date">Tue Aug 2
-2011: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.99.1.tar.gz">Version
-0.99.1</a> (v1 RC1) released; gtk3 support; source output volume support; key command handling; bugfixes.</p>
-
-<div class="news-date">Wed Oct 14
-2009: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.9.10.tar.gz">Version
-0.9.10</a> released; minor fixes; translation updates.</p>
-
-<div class="news-date">Thu Sep 10
-2009: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.9.9.tar.gz">Version
-0.9.9</a> released; allow configuring device ports; various updates.</p>
-
-<div class="news-date">Mon Apr 13
-2009: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.9.8.tar.gz">Version
-0.9.8</a> released; allow configuring card profiles; various updates.</p>
-
-<div class="news-date">Tue Sep 9
-2008: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.9.7.tar.gz">Version
-0.9.7</a> released; show volume meter for each stream and device.</p>
-
-<div class="news-date">Fri Mar 28
-2008: </div> <p class="news-text"><a href="@PACKAGE_URL@pavucontrol-0.9.6.tar.gz">Version
-0.9.6</a> released; draw radio buttons instead of check boxes when
-moving streams; fix crasher when connecting to a PA server that has no
-default sink/source configured.</p>
-
-<div class="news-date">Tue Oct 30 2007: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.9.5.tar.gz">Version 0.9.5</a>
-released; rework UI; add context menu option to kill a playback stream; add context menu option to select the default device; use prettier channel names; filter non-application streams by default; support muting streams</p>
-
-<div class="news-date">Sat Aug 26 2006: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.9.4.tar.gz">Version 0.9.4</a>
-released; add the ability to move a stream to another device while it
-is playing; limit the list of sinks/sources shown by their type; other cleanups</p>
-
-<div class="news-date">Mon Jul 24 2006: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.9.3.tar.gz">Version 0.9.3</a> released; show client names only if they are set</p>
-
-<div class="news-date">Sat Jul 8 2006: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.9.2.tar.gz">Version 0.9.2</a> released; update for <a href="http://pulseaudio.org/">PulseAudio 0.9.2</a></p>
-
-<div class="news-date">Fri Jun 2 2006: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.9.1.tar.gz">Version 0.9.1</a> released; add a <tt>.desktop</tt> file; update icons everywhere</p>
-
-<div class="news-date">Sat May 27 2006: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.9.0.tar.gz">Version 0.9.0</a> released; update for Polypaudio 0.9.0; show client name of playback streams; make volume slider more responsive</p>
-
-<div class="news-date">Fri Apr 21 2006: </div> <p class="news-text"><a
-href="@PACKAGE_URL@pavucontrol-0.8.tar.gz">Version 0.8</a> released; initial release</p>
-
-<h2><a name="overview">Overview</a></h2>
-
-<p>PulseAudio Volume Control (<tt>pavucontrol</tt>) is a simple GTK
-based volume control tool ("mixer") for the <a
-href="http://0pointer.de/lennart/projects/pulseaudio/">PulseAudio
-sound server</a>. In contrast to classic mixer tools this one allows
-you to control both the volume of hardware devices and of each
-playback stream separately.</p>
-
-<p>Everybody loves <a href="@PACKAGE_URL@/screenshot.png">screenshots</a>.</p>
-
-<h2><a name="status">Current Status</a></h2>
-
-<p>Works perfectly.</p>
-
-<h2><a name="documentation">Documentation</a></h2>
-
-<p>There is not much to say. Just run <tt>pavucontrol</tt> and see for yourself.</p>
-
-<h2><a name="requirements">Requirements</a></h2>
-
-<p>Currently, <tt>pavucontrol</tt> is tested on Linux only.</p>
-
-<p><tt>pavucontrol</tt> was developed and tested on Debian GNU/Linux
-"testing" from April 2006, it should work on most other Linux
-distributions (and maybe Unix versions) since it uses GNU autoconf for
-source code configuration.</p>
-
-<p><tt>pavucontrol</tt> requires <a href="http://gtkmm.sf.net/"><tt>gtkmm</tt></a> and <tt>glademmm</tt> installed.</p>
-
-<p>Obviously <tt>pavucontrol</tt> requires an installation of <a href="http://pulseaudio.org/">PulseAudio</a> (version 0.9.16).</p>
-
-<h2><a name="installation">Installation</a></h2>
-
-<p>As this package is made with the GNU autotools you should run
-<tt>./configure</tt> inside the distribution directory for configuring
-the source tree. After that you should run <tt>make</tt> for
-compilation and <tt>make install</tt> (as root) for installation of
-<tt>pavucontrol</tt>.</p>
-
-<h2><a name="acks">Acknowledgements</a></h2>
-
-<p>Colin Guthrie for the card profile UI and other work</p>
-
-<h2><a name="download">Download</a></h2>
-
-<p>The newest release is always available from <a href="@PACKAGE_URL@">@PACKAGE_URL@</a></p>
-
-<p>The current release is <a href="@PACKAGE_URL@pavucontrol-@PACKAGE_VERSION@.tar.gz">@PACKAGE_VERSION@</a></p>
-
-<p>Get <tt>pavucontrol</tt>'s development sources from the git <a href="git://anongit.freedesktop.org/pulseaudio/pavucontrol">repository</a> (<a href="http://cgit.freedesktop.org/pulseaudio/pavucontrol">gitweb</a>): </p>
-
-<pre>git clone git://anongit.freedesktop.org/pulseaudio/pavucontrol</pre>
-
-<hr/>
-<address class="grey">Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, October 2009</address>
-
-</body>
-</html>
diff --git a/doc/screenshot.png b/doc/screenshot.png
deleted file mode 100644
index 9676f39..0000000
--- a/doc/screenshot.png
+++ /dev/null
Binary files differ
diff --git a/doc/style.css b/doc/style.css
deleted file mode 100644
index b185c24..0000000
--- a/doc/style.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/***
- 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 <http://www.gnu.org/licenses/>.
- ***/
-
-body { color: black; background-color: white; }
-a:link, a:visited { color: #900000; }
-div.news-date { font-size: 80%; font-style: italic; }
-pre { background-color: #f0f0f0; padding: 0.4cm; }
-.grey { color: #8f8f8f; font-size: 80%; }
-table { margin-left: 1cm; border:1px solid lightgrey; padding: 0.2cm; }
-td { padding-left:10px; padding-right:10px; }
diff --git a/m4/.gitignore b/m4/.gitignore
deleted file mode 100644
index 4a99ba4..0000000
--- a/m4/.gitignore
+++ /dev/null
@@ -1,31 +0,0 @@
-codeset.m4
-gettext.m4
-glibc2.m4
-glibc21.m4
-iconv.m4
-intdiv0.m4
-intl.m4
-intldir.m4
-intltool.m4
-intmax.m4
-inttypes-pri.m4
-inttypes_h.m4
-lcmessage.m4
-lib-ld.m4
-lib-link.m4
-lib-prefix.m4
-lock.m4
-longdouble.m4
-longlong.m4
-nls.m4
-po.m4
-printf-posix.m4
-progtest.m4
-size_max.m4
-stdint_h.m4
-uintmax_t.m4
-ulonglong.m4
-visibility.m4
-wchar_t.m4
-wint_t.m4
-xsize.m4
diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
deleted file mode 100644
index 079e17d..0000000
--- a/m4/ax_cxx_compile_stdcxx.m4
+++ /dev/null
@@ -1,558 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
-#
-# DESCRIPTION
-#
-# Check for baseline language coverage in the compiler for the specified
-# version of the C++ standard. If necessary, add switches to CXXFLAGS to
-# enable support. VERSION may be '11' (for the C++11 standard) or '14'
-# (for the C++14 standard).
-#
-# The second argument, if specified, indicates whether you insist on an
-# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
-# -std=c++11). If neither is specified, you get whatever works, with
-# preference for an extended mode.
-#
-# The third argument, if specified 'mandatory' or if left unspecified,
-# indicates that baseline support for the specified C++ standard is
-# required and that the macro should error out if no mode with that
-# support is found. If specified 'optional', then configuration proceeds
-# regardless, after defining HAVE_CXX${VERSION} if and only if a
-# supporting mode is found.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
-# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
-# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
-# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
-# Copyright (c) 2015 Paul Norman <penorman@mac.com>
-# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 1
-
-dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
-dnl (serial version number 13).
-
-AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
- m4_if([$1], [11], [],
- [$1], [14], [],
- [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])],
- [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
- m4_if([$2], [], [],
- [$2], [ext], [],
- [$2], [noext], [],
- [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
- m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
- [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
- [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
- [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
- AC_LANG_PUSH([C++])dnl
- ac_success=no
- AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
- ax_cv_cxx_compile_cxx$1,
- [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
- [ax_cv_cxx_compile_cxx$1=yes],
- [ax_cv_cxx_compile_cxx$1=no])])
- if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
- ac_success=yes
- fi
-
- m4_if([$2], [noext], [], [dnl
- if test x$ac_success = xno; then
- for switch in -std=gnu++$1 -std=gnu++0x; do
- cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
- AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
- $cachevar,
- [ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $switch"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
- [eval $cachevar=yes],
- [eval $cachevar=no])
- CXXFLAGS="$ac_save_CXXFLAGS"])
- if eval test x\$$cachevar = xyes; then
- CXXFLAGS="$CXXFLAGS $switch"
- ac_success=yes
- break
- fi
- done
- fi])
-
- m4_if([$2], [ext], [], [dnl
- if test x$ac_success = xno; then
- dnl HP's aCC needs +std=c++11 according to:
- dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
- dnl Cray's crayCC needs "-h std=c++11"
- for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do
- cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
- AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
- $cachevar,
- [ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $switch"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
- [eval $cachevar=yes],
- [eval $cachevar=no])
- CXXFLAGS="$ac_save_CXXFLAGS"])
- if eval test x\$$cachevar = xyes; then
- CXXFLAGS="$CXXFLAGS $switch"
- ac_success=yes
- break
- fi
- done
- fi])
- AC_LANG_POP([C++])
- if test x$ax_cxx_compile_cxx$1_required = xtrue; then
- if test x$ac_success = xno; then
- AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
- fi
- else
- if test x$ac_success = xno; then
- HAVE_CXX$1=0
- AC_MSG_NOTICE([No compiler with C++$1 support was found])
- else
- HAVE_CXX$1=1
- AC_DEFINE(HAVE_CXX$1,1,
- [define if the compiler supports basic C++$1 syntax])
- fi
-
- AC_SUBST(HAVE_CXX$1)
- fi
-])
-
-
-dnl Test body for checking C++11 support
-
-m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
- _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
-)
-
-
-dnl Test body for checking C++14 support
-
-m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
- _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
- _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
-)
-
-
-dnl Tests for new features in C++11
-
-m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
-
-// If the compiler admits that it is not ready for C++11, why torture it?
-// Hopefully, this will speed up the test.
-
-#ifndef __cplusplus
-
-#error "This is not a C++ compiler"
-
-#elif __cplusplus < 201103L
-
-#error "This is not a C++11 compiler"
-
-#else
-
-namespace cxx11
-{
-
- namespace test_static_assert
- {
-
- template <typename T>
- struct check
- {
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
- };
-
- }
-
- namespace test_final_override
- {
-
- struct Base
- {
- virtual void f() {}
- };
-
- struct Derived : public Base
- {
- virtual void f() override {}
- };
-
- }
-
- namespace test_double_right_angle_brackets
- {
-
- template < typename T >
- struct check {};
-
- typedef check<void> single_type;
- typedef check<check<void>> double_type;
- typedef check<check<check<void>>> triple_type;
- typedef check<check<check<check<void>>>> quadruple_type;
-
- }
-
- namespace test_decltype
- {
-
- int
- f()
- {
- int a = 1;
- decltype(a) b = 2;
- return a + b;
- }
-
- }
-
- namespace test_type_deduction
- {
-
- template < typename T1, typename T2 >
- struct is_same
- {
- static const bool value = false;
- };
-
- template < typename T >
- struct is_same<T, T>
- {
- static const bool value = true;
- };
-
- template < typename T1, typename T2 >
- auto
- add(T1 a1, T2 a2) -> decltype(a1 + a2)
- {
- return a1 + a2;
- }
-
- int
- test(const int c, volatile int v)
- {
- static_assert(is_same<int, decltype(0)>::value == true, "");
- static_assert(is_same<int, decltype(c)>::value == false, "");
- static_assert(is_same<int, decltype(v)>::value == false, "");
- auto ac = c;
- auto av = v;
- auto sumi = ac + av + 'x';
- auto sumf = ac + av + 1.0;
- static_assert(is_same<int, decltype(ac)>::value == true, "");
- static_assert(is_same<int, decltype(av)>::value == true, "");
- static_assert(is_same<int, decltype(sumi)>::value == true, "");
- static_assert(is_same<int, decltype(sumf)>::value == false, "");
- static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
- return (sumf > 0.0) ? sumi : add(c, v);
- }
-
- }
-
- namespace test_noexcept
- {
-
- int f() { return 0; }
- int g() noexcept { return 0; }
-
- static_assert(noexcept(f()) == false, "");
- static_assert(noexcept(g()) == true, "");
-
- }
-
- namespace test_constexpr
- {
-
- template < typename CharT >
- unsigned long constexpr
- strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
- {
- return *s ? strlen_c_r(s + 1, acc + 1) : acc;
- }
-
- template < typename CharT >
- unsigned long constexpr
- strlen_c(const CharT *const s) noexcept
- {
- return strlen_c_r(s, 0UL);
- }
-
- static_assert(strlen_c("") == 0UL, "");
- static_assert(strlen_c("1") == 1UL, "");
- static_assert(strlen_c("example") == 7UL, "");
- static_assert(strlen_c("another\0example") == 7UL, "");
-
- }
-
- namespace test_rvalue_references
- {
-
- template < int N >
- struct answer
- {
- static constexpr int value = N;
- };
-
- answer<1> f(int&) { return answer<1>(); }
- answer<2> f(const int&) { return answer<2>(); }
- answer<3> f(int&&) { return answer<3>(); }
-
- void
- test()
- {
- int i = 0;
- const int c = 0;
- static_assert(decltype(f(i))::value == 1, "");
- static_assert(decltype(f(c))::value == 2, "");
- static_assert(decltype(f(0))::value == 3, "");
- }
-
- }
-
- namespace test_uniform_initialization
- {
-
- struct test
- {
- static const int zero {};
- static const int one {1};
- };
-
- static_assert(test::zero == 0, "");
- static_assert(test::one == 1, "");
-
- }
-
- namespace test_lambdas
- {
-
- void
- test1()
- {
- auto lambda1 = [](){};
- auto lambda2 = lambda1;
- lambda1();
- lambda2();
- }
-
- int
- test2()
- {
- auto a = [](int i, int j){ return i + j; }(1, 2);
- auto b = []() -> int { return '0'; }();
- auto c = [=](){ return a + b; }();
- auto d = [&](){ return c; }();
- auto e = [a, &b](int x) mutable {
- const auto identity = [](int y){ return y; };
- for (auto i = 0; i < a; ++i)
- a += b--;
- return x + identity(a + b);
- }(0);
- return a + b + c + d + e;
- }
-
- int
- test3()
- {
- const auto nullary = [](){ return 0; };
- const auto unary = [](int x){ return x; };
- using nullary_t = decltype(nullary);
- using unary_t = decltype(unary);
- const auto higher1st = [](nullary_t f){ return f(); };
- const auto higher2nd = [unary](nullary_t f1){
- return [unary, f1](unary_t f2){ return f2(unary(f1())); };
- };
- return higher1st(nullary) + higher2nd(nullary)(unary);
- }
-
- }
-
- namespace test_variadic_templates
- {
-
- template <int...>
- struct sum;
-
- template <int N0, int... N1toN>
- struct sum<N0, N1toN...>
- {
- static constexpr auto value = N0 + sum<N1toN...>::value;
- };
-
- template <>
- struct sum<>
- {
- static constexpr auto value = 0;
- };
-
- static_assert(sum<>::value == 0, "");
- static_assert(sum<1>::value == 1, "");
- static_assert(sum<23>::value == 23, "");
- static_assert(sum<1, 2>::value == 3, "");
- static_assert(sum<5, 5, 11>::value == 21, "");
- static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
-
- }
-
- // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
- // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
- // because of this.
- namespace test_template_alias_sfinae
- {
-
- struct foo {};
-
- template<typename T>
- using member = typename T::member_type;
-
- template<typename T>
- void func(...) {}
-
- template<typename T>
- void func(member<T>*) {}
-
- void test();
-
- void test() { func<foo>(0); }
-
- }
-
-} // namespace cxx11
-
-#endif // __cplusplus >= 201103L
-
-]])
-
-
-dnl Tests for new features in C++14
-
-m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
-
-// If the compiler admits that it is not ready for C++14, why torture it?
-// Hopefully, this will speed up the test.
-
-#ifndef __cplusplus
-
-#error "This is not a C++ compiler"
-
-#elif __cplusplus < 201402L
-
-#error "This is not a C++14 compiler"
-
-#else
-
-namespace cxx14
-{
-
- namespace test_polymorphic_lambdas
- {
-
- int
- test()
- {
- const auto lambda = [](auto&&... args){
- const auto istiny = [](auto x){
- return (sizeof(x) == 1UL) ? 1 : 0;
- };
- const int aretiny[] = { istiny(args)... };
- return aretiny[0];
- };
- return lambda(1, 1L, 1.0f, '1');
- }
-
- }
-
- namespace test_binary_literals
- {
-
- constexpr auto ivii = 0b0000000000101010;
- static_assert(ivii == 42, "wrong value");
-
- }
-
- namespace test_generalized_constexpr
- {
-
- template < typename CharT >
- constexpr unsigned long
- strlen_c(const CharT *const s) noexcept
- {
- auto length = 0UL;
- for (auto p = s; *p; ++p)
- ++length;
- return length;
- }
-
- static_assert(strlen_c("") == 0UL, "");
- static_assert(strlen_c("x") == 1UL, "");
- static_assert(strlen_c("test") == 4UL, "");
- static_assert(strlen_c("another\0test") == 7UL, "");
-
- }
-
- namespace test_lambda_init_capture
- {
-
- int
- test()
- {
- auto x = 0;
- const auto lambda1 = [a = x](int b){ return a + b; };
- const auto lambda2 = [a = lambda1(x)](){ return a; };
- return lambda2();
- }
-
- }
-
- namespace test_digit_seperators
- {
-
- constexpr auto ten_million = 100'000'000;
- static_assert(ten_million == 100000000, "");
-
- }
-
- namespace test_return_type_deduction
- {
-
- auto f(int& x) { return x; }
- decltype(auto) g(int& x) { return x; }
-
- template < typename T1, typename T2 >
- struct is_same
- {
- static constexpr auto value = false;
- };
-
- template < typename T >
- struct is_same<T, T>
- {
- static constexpr auto value = true;
- };
-
- int
- test()
- {
- auto x = 0;
- static_assert(is_same<int, decltype(f(x))>::value, "");
- static_assert(is_same<int&, decltype(g(x))>::value, "");
- return x;
- }
-
- }
-
-} // namespace cxx14
-
-#endif // __cplusplus >= 201402L
-
-]])
diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
deleted file mode 100644
index 09db383..0000000
--- a/m4/ax_cxx_compile_stdcxx_11.m4
+++ /dev/null
@@ -1,39 +0,0 @@
-# ============================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
-# ============================================================================
-#
-# SYNOPSIS
-#
-# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional])
-#
-# DESCRIPTION
-#
-# Check for baseline language coverage in the compiler for the C++11
-# standard; if necessary, add switches to CXXFLAGS to enable support.
-#
-# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
-# macro with the version set to C++11. The two optional arguments are
-# forwarded literally as the second and third argument respectively.
-# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
-# more information. If you want to use this macro, you also need to
-# download the ax_cxx_compile_stdcxx.m4 file.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
-# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
-# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
-# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
-# Copyright (c) 2015 Paul Norman <penorman@mac.com>
-# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 14
-
-include([ax_cxx_compile_stdcxx.m4])
-
-AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
diff --git a/m4/zp_lynx_doc.m4 b/m4/zp_lynx_doc.m4
deleted file mode 100644
index 955a6ca..0000000
--- a/m4/zp_lynx_doc.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-dnl Macro for enabling LYNX-based documentation generation
-
-AC_DEFUN([ZP_LYNX_DOC], [
- AC_ARG_ENABLE(lynx,
- AS_HELP_STRING([--disable-lynx],
- [Turn off lynx usage for documentation generation]),,
- [enable_lynx=yes])
-
- case "${enable_lynx}" in
- yes)
- AC_CHECK_PROG(have_lynx, lynx, yes, no)
-
- if test x$have_lynx = xno ; then
- AC_MSG_WARN([*** lynx not found, plain text README will not be built ***])
- fi
- ;;
- no)
- have_lynx=no ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;;
- esac
-
- AM_CONDITIONAL([USE_LYNX], [test "x$have_lynx" = xyes])
-])
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..211e67f
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,63 @@
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release)
+endif()
+
+include_directories(
+ ${PULSE_INCLUDE_DIRS}
+ ${GLIB_INCLUDE_DIRS}
+)
+
+set(pavucontrol-qt_HDRS
+ mainwindow.h
+)
+
+set(pavucontrol-qt_SRCS
+ pavucontrol.cc
+ mainwindow.cc
+)
+
+set(pavucontrol-qt_UI
+ src/wmselectdialog.ui
+)
+
+# Translations
+lxqt_translate_ts(pavucontrol-qt_QM_FILES
+ UPDATE_TRANSLATIONS
+ ${UPDATE_TRANSLATIONS}
+ SOURCES
+ ${pavucontrol-qt_HDRS}
+ ${pavucontrol-qt_SRCS}
+ ${pavucontrol-qt_UI}
+ INSTALL_DIR
+ "${LXQT_TRANSLATIONS_DIR}/${PROJECT_NAME}"
+ # PULL_TRANSLATIONS
+ # ${PULL_TRANSLATIONS}
+ CLEAN_TRANSLATIONS
+ ${CLEAN_TRANSLATIONS}
+ TRANSLATIONS_REPO
+ ${TRANSLATIONS_REPO}
+ TRANSLATIONS_REFSPEC
+ ${TRANSLATIONS_REFSPEC}
+ REPO_SUBDIR
+ "pavucontrol-qt/${PROJECT_NAME}"
+)
+# lxqt_app_translation_loader(pavucontrol-qt_QM_LOADER ${PROJECT_NAME})
+
+add_executable(pavucontrol-qt
+ ${pavucontrol-qt_SRCS}
+ ${pavucontrol-qt_QM_FILES}
+ ${pavucontrol-qt_QM_LOADER}
+)
+
+target_link_libraries(pavucontrol-qt
+ Qt5::Widgets
+ Qt5::DBus
+ ${PULSE_LDFLAGS}
+ ${GLIB_LDFLAGS}
+)
+
+INSTALL(TARGETS
+ pavucontrol-qt
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ COMPONENT Runtime
+)
diff --git a/src/cardwidget.h b/src/cardwidget.h
index 821aae5..4dc4529 100644
--- a/src/cardwidget.h
+++ b/src/cardwidget.h
@@ -34,6 +34,7 @@ public:
std::vector<Glib::ustring> profiles;
};
+#if 0
class CardWidget : public Gtk::VBox {
public:
CardWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x);
@@ -74,5 +75,6 @@ protected:
Gtk::ComboBox *profileList;
Glib::RefPtr<Gtk::ListStore> treeModel;
};
+#endif
#endif
diff --git a/src/i18n.h b/src/i18n.h
index f170b17..a64a91c 100644
--- a/src/i18n.h
+++ b/src/i18n.h
@@ -20,6 +20,9 @@
along with pavucontrol. If not, see <http://www.gnu.org/licenses/>.
***/
+#define GETTEXT_PACKAGE "pavucontrol"
+
+
#if !defined(GETTEXT_PACKAGE)
#error "Something is very wrong here, config.h needs to be included first"
#endif
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 31d5695..9e4089a 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -25,14 +25,14 @@
#include <set>
#include "mainwindow.h"
-
#include "cardwidget.h"
+/*
#include "sinkwidget.h"
#include "sourcewidget.h"
#include "sinkinputwidget.h"
#include "sourceoutputwidget.h"
#include "rolewidget.h"
-
+*/
#include "i18n.h"
/* Used for profile sorting */
@@ -66,106 +66,85 @@ struct source_port_prio_compare {
}
};
-MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x) :
- Gtk::Window(cobject),
+MainWindow::MainWindow():
+ QDialog(),
showSinkInputType(SINK_INPUT_CLIENT),
showSinkType(SINK_ALL),
showSourceOutputType(SOURCE_OUTPUT_CLIENT),
showSourceType(SOURCE_NO_MONITOR),
- eventRoleWidget(NULL),
+ eventRoleWidget(nullptr),
canRenameDevices(false),
m_connected(false),
- m_config_filename(NULL) {
-
- x->get_widget("cardsVBox", cardsVBox);
- x->get_widget("streamsVBox", streamsVBox);
- x->get_widget("recsVBox", recsVBox);
- x->get_widget("sinksVBox", sinksVBox);
- x->get_widget("sourcesVBox", sourcesVBox);
- x->get_widget("noCardsLabel", noCardsLabel);
- x->get_widget("noStreamsLabel", noStreamsLabel);
- x->get_widget("noRecsLabel", noRecsLabel);
- x->get_widget("noSinksLabel", noSinksLabel);
- x->get_widget("noSourcesLabel", noSourcesLabel);
- x->get_widget("connectingLabel", connectingLabel);
- x->get_widget("sinkInputTypeComboBox", sinkInputTypeComboBox);
- x->get_widget("sourceOutputTypeComboBox", sourceOutputTypeComboBox);
- x->get_widget("sinkTypeComboBox", sinkTypeComboBox);
- x->get_widget("sourceTypeComboBox", sourceTypeComboBox);
- x->get_widget("notebook", notebook);
- x->get_widget("showVolumeMetersCheckButton", showVolumeMetersCheckButton);
-
- cardsVBox->set_reallocate_redraws(true);
- sourcesVBox->set_reallocate_redraws(true);
- streamsVBox->set_reallocate_redraws(true);
- recsVBox->set_reallocate_redraws(true);
- sinksVBox->set_reallocate_redraws(true);
-
- sinkInputTypeComboBox->set_active((int) showSinkInputType);
- sourceOutputTypeComboBox->set_active((int) showSourceOutputType);
- sinkTypeComboBox->set_active((int) showSinkType);
- sourceTypeComboBox->set_active((int) showSourceType);
-
- sinkInputTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSinkInputTypeComboBoxChanged));
- sourceOutputTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSourceOutputTypeComboBoxChanged));
- sinkTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSinkTypeComboBoxChanged));
- sourceTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSourceTypeComboBoxChanged));
- showVolumeMetersCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onShowVolumeMetersCheckButtonToggled));
+ m_config_filename(nullptr) {
+ ui.setupUi(this);
+
+ ui.sinkInputTypeComboBox->setCurrentIndex((int) showSinkInputType);
+ ui.sourceOutputTypeComboBox->setCurrentIndex((int) showSourceOutputType);
+ ui.sinkTypeComboBox->setCurrentIndex((int) showSinkType);
+ ui.sourceTypeComboBox->setCurrentIndex((int) showSourceType);
+
+#if 0
+ ui.sinkInputTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSinkInputTypeComboBoxChanged));
+ ui.sourceOutputTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSourceOutputTypeComboBoxChanged));
+ ui.sinkTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSinkTypeComboBoxChanged));
+ ui.sourceTypeComboBox->signal_changed().connect(sigc::mem_fun(*this, &MainWindow::onSourceTypeComboBoxChanged));
+ ui.showVolumeMetersCheckButton->signal_toggled().connect(sigc::mem_fun(*this, &MainWindow::onShowVolumeMetersCheckButtonToggled));
+#endif
GKeyFile* config = g_key_file_new();
g_assert(config);
GKeyFileFlags flags = (GKeyFileFlags)( G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS);
- GError *err = NULL;
- m_config_filename = g_strconcat(g_get_user_config_dir(), "/pavucontrol.ini", NULL);
+ GError *err = nullptr;
+ m_config_filename = g_strconcat(g_get_user_config_dir(), "/pavucontrol.ini", nullptr);
/* Load the GKeyFile from keyfile.conf or return. */
if (g_key_file_load_from_file (config, m_config_filename, flags, &err)) {
- int width = g_key_file_get_integer(config, "window", "width", NULL);
- int height = g_key_file_get_integer(config, "window", "height", NULL);
+ int width = g_key_file_get_integer(config, "window", "width", nullptr);
+ int height = g_key_file_get_integer(config, "window", "height", nullptr);
/* When upgrading from a previous version, set showVolumeMeters to TRUE
* (default from glade file), so users don't complain about missing
* volume meters. */
- if (g_key_file_has_key(config, "window", "showVolumeMeters", NULL)) {
- showVolumeMetersCheckButton->set_active(g_key_file_get_boolean(config, "window", "showVolumeMeters", NULL));
+ if (g_key_file_has_key(config, "window", "showVolumeMeters", nullptr)) {
+ ui.showVolumeMetersCheckButton->setChecked(g_key_file_get_boolean(config, "window", "showVolumeMeters", nullptr));
}
-
+#if 0
int default_width, default_height;
get_default_size(default_width, default_height);
if (width >= default_width && height >= default_height)
resize(width, height);
-
+#endif
int sinkInputTypeSelection = g_key_file_get_integer(config, "window", "sinkInputType", &err);
- if (err == NULL)
- sinkInputTypeComboBox->set_active(sinkInputTypeSelection);
+ if (err == nullptr)
+ ui.sinkInputTypeComboBox->setCurrentIndex(sinkInputTypeSelection);
else {
g_error_free(err);
- err = NULL;
+ err = nullptr;
}
int sourceOutputTypeSelection = g_key_file_get_integer(config, "window", "sourceOutputType", &err);
- if (err == NULL)
- sourceOutputTypeComboBox->set_active(sourceOutputTypeSelection);
+ if (err == nullptr)
+ ui.sourceOutputTypeComboBox->setCurrentIndex(sourceOutputTypeSelection);
else {
g_error_free(err);
- err = NULL;
+ err = nullptr;
}
int sinkTypeSelection = g_key_file_get_integer(config, "window", "sinkType", &err);
- if (err == NULL)
- sinkTypeComboBox->set_active(sinkTypeSelection);
+ if (err == nullptr)
+ ui.sinkTypeComboBox->setCurrentIndex(sinkTypeSelection);
else {
g_error_free(err);
- err = NULL;
+ err = nullptr;
}
int sourceTypeSelection = g_key_file_get_integer(config, "window", "sourceType", &err);
- if (err == NULL)
- sourceTypeComboBox->set_active(sourceTypeSelection);
+ if (err == nullptr)
+ ui.sourceTypeComboBox->setCurrentIndex(sourceTypeSelection);
else {
g_error_free(err);
- err = NULL;
+ err = nullptr;
}
} else {
g_debug(_("Error reading config file %s: %s"), m_config_filename, err->message);
@@ -175,10 +154,11 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
/* Hide first and show when we're connected */
- notebook->hide();
- connectingLabel->show();
+ ui.notebook->hide();
+ ui.connectingLabel->show();
}
+#if 0
MainWindow* MainWindow::create(bool maximize) {
MainWindow* w;
Glib::RefPtr<Gtk::Builder> x = Gtk::Builder::create();
@@ -192,17 +172,18 @@ MainWindow* MainWindow::create(bool maximize) {
w->maximize();
return w;
}
+#endif
void MainWindow::on_realize() {
- Gtk::Window::on_realize();
+#if 0
-#ifdef HAVE_GTK3
+ Gtk::Window::on_realize();
get_window()->set_cursor(Gdk::Cursor::create(Gdk::WATCH));
-#else
- get_window()->set_cursor(Gdk::Cursor(Gdk::WATCH));
-#endif /* HAVE_GTK3 */
+
+#endif
}
+#if 0
bool MainWindow::on_key_press_event(GdkEventKey* event) {
if (GDK_KEY_Escape == event->keyval) {
@@ -216,14 +197,14 @@ bool MainWindow::on_key_press_event(GdkEventKey* event) {
case GDK_KEY_KP_3:
case GDK_KEY_KP_4:
case GDK_KEY_KP_5:
- notebook->set_current_page(event->keyval - GDK_KEY_KP_1);
+ ui.notebook->set_current_page(event->keyval - GDK_KEY_KP_1);
return true;
case GDK_KEY_1:
case GDK_KEY_2:
case GDK_KEY_3:
case GDK_KEY_4:
case GDK_KEY_5:
- notebook->set_current_page(event->keyval - GDK_KEY_1);
+ ui.notebook->set_current_page(event->keyval - GDK_KEY_1);
return true;
case GDK_KEY_W:
case GDK_KEY_Q:
@@ -235,23 +216,22 @@ bool MainWindow::on_key_press_event(GdkEventKey* event) {
}
return Gtk::Window::on_key_press_event(event);
}
+#endif
MainWindow::~MainWindow() {
GKeyFile* config = g_key_file_new();
g_assert(config);
-
- int width, height;
- get_size(width, height);
- g_key_file_set_integer(config, "window", "width", width);
- g_key_file_set_integer(config, "window", "height", height);
- g_key_file_set_integer(config, "window", "sinkInputType", sinkInputTypeComboBox->get_active_row_number());
- g_key_file_set_integer(config, "window", "sourceOutputType", sourceOutputTypeComboBox->get_active_row_number());
- g_key_file_set_integer(config, "window", "sinkType", sinkTypeComboBox->get_active_row_number());
- g_key_file_set_integer(config, "window", "sourceType", sourceTypeComboBox->get_active_row_number());
- g_key_file_set_integer(config, "window", "showVolumeMeters", showVolumeMetersCheckButton->get_active());
-
+#if 0
+ g_key_file_set_integer(config, "window", "width", width());
+ g_key_file_set_integer(config, "window", "height", height());
+ g_key_file_set_integer(config, "window", "sinkInputType", ui.sinkInputTypeComboBox->currentIndex());
+ g_key_file_set_integer(config, "window", "sourceOutputType", ui.sourceOutputTypeComboBox->currentIndex());
+ g_key_file_set_integer(config, "window", "sinkType", ui.sinkTypeComboBox->currentIndex());
+ g_key_file_set_integer(config, "window", "sourceType", ui.sourceTypeComboBox->currentIndex());
+ g_key_file_set_integer(config, "window", "showVolumeMeters", ui.showVolumeMetersCheckButton->get_active());
+#endif
gsize filelen;
- GError *err = NULL;
+ GError *err = nullptr;
gchar *filedata = g_key_file_to_data(config, &filelen, &err);
if (err) {
show_error(_("Error saving preferences"));
@@ -262,7 +242,7 @@ MainWindow::~MainWindow() {
g_file_set_contents(m_config_filename, filedata, filelen, &err);
g_free(filedata);
if (err) {
- gchar* msg = g_strconcat(_("Error writing config file %s"), m_config_filename, NULL);
+ gchar* msg = g_strconcat(_("Error writing config file %s"), m_config_filename, nullptr);
show_error(msg);
g_free(msg);
g_error_free(err);
@@ -281,6 +261,7 @@ finish:
}
}
+#if 0
static void set_icon_name_fallback(Gtk::Image *i, const char *name, Gtk::IconSize size) {
Glib::RefPtr<Gtk::IconTheme> theme;
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
@@ -304,8 +285,11 @@ static void set_icon_name_fallback(Gtk::Image *i, const char *name, Gtk::IconSiz
i->set(name);
}
}
+#endif
+class DeviceWidget;
static void updatePorts(DeviceWidget *w, std::map<Glib::ustring, PortInfo> &ports) {
+#if 0
std::map<Glib::ustring, PortInfo>::iterator it;
PortInfo p;
@@ -338,9 +322,11 @@ static void updatePorts(DeviceWidget *w, std::map<Glib::ustring, PortInfo> &port
p = it->second;
w->setLatencyOffset(p.latency_offset);
}
+#endif
}
void MainWindow::updateCard(const pa_card_info &info) {
+#if 0
CardWidget *w;
bool is_new = false;
const char *description, *icon;
@@ -456,11 +442,13 @@ void MainWindow::updateCard(const pa_card_info &info) {
updateDeviceVisibility();
w->updating = false;
+#endif
}
bool MainWindow::updateSink(const pa_sink_info &info) {
SinkWidget *w;
bool is_new = false;
+#if 0
const char *icon;
std::map<uint32_t, CardWidget*>::iterator cw;
std::set<pa_sink_port_info,sink_port_prio_compare> port_priorities;
@@ -497,7 +485,7 @@ bool MainWindow::updateSink(const pa_sink_info &info) {
set_icon_name_fallback(w->iconImage, icon ? icon : "audio-card", Gtk::ICON_SIZE_SMALL_TOOLBAR);
w->setVolume(info.volume);
- w->muteToggleButton->set_active(info.mute);
+ w->muteToggleButton->setCurrentIndex(info.mute);
w->setDefault(w->name == defaultSinkName);
@@ -527,7 +515,7 @@ bool MainWindow::updateSink(const pa_sink_info &info) {
if (is_new)
updateDeviceVisibility();
-
+#endif
return is_new;
}
@@ -549,7 +537,7 @@ static void read_callback(pa_stream *s, size_t length, void *userdata) {
}
if (!data) {
- /* NULL data means either a hole or empty buffer.
+ /* nullptr data means either a hole or empty buffer.
* Only drop the stream when there is a hole (length > 0) */
if (length)
pa_stream_drop(s);
@@ -588,9 +576,9 @@ pa_stream* MainWindow::createMonitorStreamForSource(uint32_t source_idx, uint32_
snprintf(t, sizeof(t), "%u", source_idx);
- if (!(s = pa_stream_new(get_context(), _("Peak detect"), &ss, NULL))) {
+ if (!(s = pa_stream_new(get_context(), _("Peak detect"), &ss, nullptr))) {
show_error(_("Failed to create monitoring stream"));
- return NULL;
+ return nullptr;
}
if (stream_idx != (uint32_t) -1)
@@ -599,6 +587,7 @@ pa_stream* MainWindow::createMonitorStreamForSource(uint32_t source_idx, uint32_
pa_stream_set_read_callback(s, read_callback, this);
pa_stream_set_suspended_callback(s, suspended_callback, this);
+#if 0
flags = (pa_stream_flags_t) (PA_STREAM_DONT_MOVE | PA_STREAM_PEAK_DETECT | PA_STREAM_ADJUST_LATENCY |
(suspend ? PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND : PA_STREAM_NOFLAGS) |
(!showVolumeMetersCheckButton->get_active() ? PA_STREAM_START_CORKED : PA_STREAM_NOFLAGS));
@@ -606,24 +595,28 @@ pa_stream* MainWindow::createMonitorStreamForSource(uint32_t source_idx, uint32_
if (pa_stream_connect_record(s, t, &attr, flags) < 0) {
show_error(_("Failed to connect monitoring stream"));
pa_stream_unref(s);
- return NULL;
+ return nullptr;
}
+#endif
return s;
}
void MainWindow::createMonitorStreamForSinkInput(SinkInputWidget* w, uint32_t sink_idx) {
+#if 0
if (!sinkWidgets.count(sink_idx))
return;
if (w->peak) {
pa_stream_disconnect(w->peak);
- w->peak = NULL;
+ w->peak = nullptr;
}
w->peak = createMonitorStreamForSource(sinkWidgets[sink_idx]->monitor_index, w->index);
+#endif
}
void MainWindow::updateSource(const pa_source_info &info) {
+#if 0
SourceWidget *w;
bool is_new = false;
const char *icon;
@@ -664,7 +657,7 @@ void MainWindow::updateSource(const pa_source_info &info) {
set_icon_name_fallback(w->iconImage, icon ? icon : "audio-input-microphone", Gtk::ICON_SIZE_SMALL_TOOLBAR);
w->setVolume(info.volume);
- w->muteToggleButton->set_active(info.mute);
+ w->muteToggleButton->setCurrentIndex(info.mute);
w->setDefault(w->name == defaultSourceName);
@@ -690,8 +683,10 @@ void MainWindow::updateSource(const pa_source_info &info) {
if (is_new)
updateDeviceVisibility();
+#endif
}
+#if 0
void MainWindow::setIconFromProplist(Gtk::Image *icon, pa_proplist *l, const char *def) {
const char *t;
@@ -732,8 +727,10 @@ finish:
set_icon_name_fallback(icon, t, Gtk::ICON_SIZE_SMALL_TOOLBAR);
}
+#endif
void MainWindow::updateSinkInput(const pa_sink_input_info &info) {
+#if 0
const char *t;
SinkInputWidget *w;
bool is_new = false;
@@ -786,15 +783,17 @@ void MainWindow::updateSinkInput(const pa_sink_input_info &info) {
setIconFromProplist(w->iconImage, info.proplist, "audio-card");
w->setVolume(info.volume);
- w->muteToggleButton->set_active(info.mute);
+ w->muteToggleButton->setCurrentIndex(info.mute);
w->updating = false;
if (is_new)
updateDeviceVisibility();
+#endif
}
void MainWindow::updateSourceOutput(const pa_source_output_info &info) {
+#if 0
SourceOutputWidget *w;
const char *app;
bool is_new = false;
@@ -843,17 +842,18 @@ void MainWindow::updateSourceOutput(const pa_source_output_info &info) {
#if HAVE_SOURCE_OUTPUT_VOLUMES
w->setVolume(info.volume);
- w->muteToggleButton->set_active(info.mute);
+ w->muteToggleButton->setCurrentIndex(info.mute);
#endif
w->updating = false;
if (is_new)
updateDeviceVisibility();
+#endif
}
void MainWindow::updateClient(const pa_client_info &info) {
-
+#if 0
g_free(clientNames[info.index]);
clientNames[info.index] = g_strdup(info.name);
@@ -869,10 +869,11 @@ void MainWindow::updateClient(const pa_client_info &info) {
g_free(txt);
}
}
+#endif
}
void MainWindow::updateServer(const pa_server_info &info) {
-
+#if 0
defaultSourceName = info.default_source_name ? info.default_source_name : "";
defaultSinkName = info.default_sink_name ? info.default_sink_name : "";
@@ -898,9 +899,11 @@ void MainWindow::updateServer(const pa_server_info &info) {
w->setDefault(w->name == defaultSourceName);
w->updating = false;
}
+#endif
}
bool MainWindow::createEventRoleWidget() {
+#if 0
if (eventRoleWidget)
return FALSE;
@@ -928,22 +931,23 @@ bool MainWindow::createEventRoleWidget() {
volume.values[0] = PA_VOLUME_NORM;
eventRoleWidget->setVolume(volume);
- eventRoleWidget->muteToggleButton->set_active(false);
+ eventRoleWidget->muteToggleButton->setCurrentIndex(false);
eventRoleWidget->updating = false;
-
+#endif
return TRUE;
}
void MainWindow::deleteEventRoleWidget() {
-
+#if 0
if (eventRoleWidget)
delete eventRoleWidget;
-
- eventRoleWidget = NULL;
+#endif
+ eventRoleWidget = nullptr;
}
void MainWindow::updateRole(const pa_ext_stream_restore_info &info) {
+#if 0
pa_cvolume volume;
bool is_new = false;
@@ -960,17 +964,18 @@ void MainWindow::updateRole(const pa_ext_stream_restore_info &info) {
volume.values[0] = pa_cvolume_max(&info.volume);
eventRoleWidget->setVolume(volume);
- eventRoleWidget->muteToggleButton->set_active(info.mute);
+ eventRoleWidget->muteToggleButton->setCurrentIndex(info.mute);
eventRoleWidget->updating = false;
if (is_new)
updateDeviceVisibility();
+#endif
}
#if HAVE_EXT_DEVICE_RESTORE_API
void MainWindow::updateDeviceInfo(const pa_ext_device_restore_info &info) {
-
+#if 0
if (sinkWidgets.count(info.index)) {
SinkWidget *w;
pa_format_info *format;
@@ -981,14 +986,14 @@ void MainWindow::updateDeviceInfo(const pa_ext_device_restore_info &info) {
/* Unselect everything */
for (int j = 1; j < PAVU_NUM_ENCODINGS; ++j)
- w->encodings[j].widget->set_active(false);
+ w->encodings[j].widget->setCurrentIndex(false);
for (uint8_t i = 0; i < info.n_formats; ++i) {
format = info.formats[i];
for (int j = 1; j < PAVU_NUM_ENCODINGS; ++j) {
if (format->encoding == w->encodings[j].encoding) {
- w->encodings[j].widget->set_active(true);
+ w->encodings[j].widget->setCurrentIndex(true);
break;
}
}
@@ -996,12 +1001,13 @@ void MainWindow::updateDeviceInfo(const pa_ext_device_restore_info &info) {
w->updating = false;
}
+#endif
}
#endif
void MainWindow::updateVolumeMeter(uint32_t source_index, uint32_t sink_input_idx, double v) {
-
+#if 0
if (sink_input_idx != PA_INVALID_INDEX) {
SinkInputWidget *w;
@@ -1033,6 +1039,7 @@ void MainWindow::updateVolumeMeter(uint32_t source_index, uint32_t sink_input_id
w->updatePeak(v);
}
}
+#endif
}
static guint idle_source = 0;
@@ -1047,11 +1054,11 @@ void MainWindow::setConnectionState(gboolean connected) {
if (m_connected != connected) {
m_connected = connected;
if (m_connected) {
- connectingLabel->hide();
- notebook->show();
+ ui.connectingLabel->hide();
+ ui.notebook->show();
} else {
- notebook->hide();
- connectingLabel->show();
+ ui.notebook->hide();
+ ui.connectingLabel->show();
}
}
}
@@ -1065,6 +1072,7 @@ void MainWindow::updateDeviceVisibility() {
}
void MainWindow::reallyUpdateDeviceVisibility() {
+#if 0
bool is_empty = true;
for (std::map<uint32_t, SinkInputWidget*>::iterator i = sinkInputWidgets.begin(); i != sinkInputWidgets.end(); ++i) {
@@ -1180,51 +1188,62 @@ void MainWindow::reallyUpdateDeviceVisibility() {
recsVBox->show();
cardsVBox->hide();
cardsVBox->show();
+#endif
}
void MainWindow::removeCard(uint32_t index) {
+#if 0
if (!cardWidgets.count(index))
return;
delete cardWidgets[index];
cardWidgets.erase(index);
updateDeviceVisibility();
+#endif
}
void MainWindow::removeSink(uint32_t index) {
+#if 0
if (!sinkWidgets.count(index))
return;
delete sinkWidgets[index];
sinkWidgets.erase(index);
updateDeviceVisibility();
+#endif
}
void MainWindow::removeSource(uint32_t index) {
+#if 0
if (!sourceWidgets.count(index))
return;
delete sourceWidgets[index];
sourceWidgets.erase(index);
updateDeviceVisibility();
+#endif
}
void MainWindow::removeSinkInput(uint32_t index) {
+#if 0
if (!sinkInputWidgets.count(index))
return;
delete sinkInputWidgets[index];
sinkInputWidgets.erase(index);
updateDeviceVisibility();
+#endif
}
void MainWindow::removeSourceOutput(uint32_t index) {
+#if 0
if (!sourceOutputWidgets.count(index))
return;
delete sourceOutputWidgets[index];
sourceOutputWidgets.erase(index);
updateDeviceVisibility();
+#endif
}
void MainWindow::removeClient(uint32_t index) {
@@ -1255,54 +1274,55 @@ void MainWindow::setConnectingMessage(const char *string) {
else
markup += string;
markup += "</i>";
- connectingLabel->set_markup(markup);
+ ui.connectingLabel->setText(QString::fromUtf8(markup.c_str()));
}
void MainWindow::onSinkTypeComboBoxChanged() {
- showSinkType = (SinkType) sinkTypeComboBox->get_active_row_number();
+ showSinkType = (SinkType) ui.sinkTypeComboBox->currentIndex();
if (showSinkType == (SinkType) -1)
- sinkTypeComboBox->set_active((int) SINK_ALL);
+ ui.sinkTypeComboBox->setCurrentIndex((int) SINK_ALL);
updateDeviceVisibility();
}
void MainWindow::onSourceTypeComboBoxChanged() {
- showSourceType = (SourceType) sourceTypeComboBox->get_active_row_number();
+ showSourceType = (SourceType) ui.sourceTypeComboBox->currentIndex();
if (showSourceType == (SourceType) -1)
- sourceTypeComboBox->set_active((int) SOURCE_NO_MONITOR);
+ ui.sourceTypeComboBox->setCurrentIndex((int) SOURCE_NO_MONITOR);
updateDeviceVisibility();
}
void MainWindow::onSinkInputTypeComboBoxChanged() {
- showSinkInputType = (SinkInputType) sinkInputTypeComboBox->get_active_row_number();
+ showSinkInputType = (SinkInputType) ui.sinkInputTypeComboBox->currentIndex();
if (showSinkInputType == (SinkInputType) -1)
- sinkInputTypeComboBox->set_active((int) SINK_INPUT_CLIENT);
+ ui.sinkInputTypeComboBox->setCurrentIndex((int) SINK_INPUT_CLIENT);
updateDeviceVisibility();
}
void MainWindow::onSourceOutputTypeComboBoxChanged() {
- showSourceOutputType = (SourceOutputType) sourceOutputTypeComboBox->get_active_row_number();
+ showSourceOutputType = (SourceOutputType) ui.sourceOutputTypeComboBox->currentIndex();
if (showSourceOutputType == (SourceOutputType) -1)
- sourceOutputTypeComboBox->set_active((int) SOURCE_OUTPUT_CLIENT);
+ ui.sourceOutputTypeComboBox->setCurrentIndex((int) SOURCE_OUTPUT_CLIENT);
updateDeviceVisibility();
}
void MainWindow::onShowVolumeMetersCheckButtonToggled() {
- bool state = showVolumeMetersCheckButton->get_active();
+#if 0
+ bool state = ui.showVolumeMetersCheckButton->get_active();
pa_operation *o;
for (std::map<uint32_t, SinkWidget*>::iterator it = sinkWidgets.begin() ; it != sinkWidgets.end(); it++) {
SinkWidget *sw = it->second;
if (sw->peak) {
- o = pa_stream_cork(sw->peak, (int)!state, NULL, NULL);
+ o = pa_stream_cork(sw->peak, (int)!state, nullptr, nullptr);
if (o)
pa_operation_unref(o);
}
@@ -1311,7 +1331,7 @@ void MainWindow::onShowVolumeMetersCheckButtonToggled() {
for (std::map<uint32_t, SourceWidget*>::iterator it = sourceWidgets.begin() ; it != sourceWidgets.end(); it++) {
SourceWidget *sw = it->second;
if (sw->peak) {
- o = pa_stream_cork(sw->peak, (int)!state, NULL, NULL);
+ o = pa_stream_cork(sw->peak, (int)!state, nullptr, nullptr);
if (o)
pa_operation_unref(o);
}
@@ -1320,7 +1340,7 @@ void MainWindow::onShowVolumeMetersCheckButtonToggled() {
for (std::map<uint32_t, SinkInputWidget*>::iterator it = sinkInputWidgets.begin() ; it != sinkInputWidgets.end(); it++) {
SinkInputWidget *sw = it->second;
if (sw->peak) {
- o = pa_stream_cork(sw->peak, (int)!state, NULL, NULL);
+ o = pa_stream_cork(sw->peak, (int)!state, nullptr, nullptr);
if (o)
pa_operation_unref(o);
}
@@ -1329,10 +1349,11 @@ void MainWindow::onShowVolumeMetersCheckButtonToggled() {
for (std::map<uint32_t, SourceOutputWidget*>::iterator it = sourceOutputWidgets.begin() ; it != sourceOutputWidgets.end(); it++) {
SourceOutputWidget *sw = it->second;
if (sw->peak) {
- o = pa_stream_cork(sw->peak, (int)!state, NULL, NULL);
+ o = pa_stream_cork(sw->peak, (int)!state, nullptr, nullptr);
if (o)
pa_operation_unref(o);
}
sw->setVolumeMeterVisible(state);
}
+#endif
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 30e1ad0..1fb8858 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -27,6 +27,9 @@
# include <pulse/ext-device-restore.h>
#endif
+#include <QDialog>
+#include "ui_mainwindow.h"
+
class CardWidget;
class SinkWidget;
class SourceWidget;
@@ -34,10 +37,12 @@ class SinkInputWidget;
class SourceOutputWidget;
class RoleWidget;
-class MainWindow : public Gtk::Window {
+class MainWindow : public QDialog {
+ Q_OBJECT
public:
- MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x);
- static MainWindow* create(bool maximize);
+ MainWindow();
+ // MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x);
+ // static MainWindow* create(bool maximize);
virtual ~MainWindow();
void updateCard(const pa_card_info &info);
@@ -63,20 +68,20 @@ public:
void removeAllWidgets();
void setConnectingMessage(const char *string = NULL);
-
+#if 0
Gtk::Notebook *notebook;
Gtk::VBox *streamsVBox, *recsVBox, *sinksVBox, *sourcesVBox, *cardsVBox;
Gtk::Label *noStreamsLabel, *noRecsLabel, *noSinksLabel, *noSourcesLabel, *noCardsLabel, *connectingLabel;
Gtk::ComboBox *sinkInputTypeComboBox, *sourceOutputTypeComboBox, *sinkTypeComboBox, *sourceTypeComboBox;
Gtk::CheckButton *showVolumeMetersCheckButton;
-
+#endif
std::map<uint32_t, CardWidget*> cardWidgets;
std::map<uint32_t, SinkWidget*> sinkWidgets;
std::map<uint32_t, SourceWidget*> sourceWidgets;
std::map<uint32_t, SinkInputWidget*> sinkInputWidgets;
std::map<uint32_t, SourceOutputWidget*> sourceOutputWidgets;
- std::map<uint32_t, char*> clientNames;
+ std::map<uint32_t, char*> clientNames;
SinkInputType showSinkInputType;
SinkType showSinkType;
SourceOutputType showSourceOutputType;
@@ -94,7 +99,7 @@ public:
pa_stream* createMonitorStreamForSource(uint32_t source_idx, uint32_t stream_idx, bool suspend);
void createMonitorStreamForSinkInput(SinkInputWidget* w, uint32_t sink_idx);
- void setIconFromProplist(Gtk::Image *icon, pa_proplist *l, const char *name);
+ // void setIconFromProplist(Gtk::Image *icon, pa_proplist *l, const char *name);
RoleWidget *eventRoleWidget;
@@ -107,11 +112,12 @@ public:
protected:
virtual void on_realize();
- virtual bool on_key_press_event(GdkEventKey* event);
+ // virtual bool on_key_press_event(GdkEventKey* event);
private:
gboolean m_connected;
gchar* m_config_filename;
+ Ui::MainWindow ui;
};
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
new file mode 100644
index 0000000..921d6d2
--- /dev/null
+++ b/src/mainwindow.ui
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QDialog" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>766</width>
+ <height>548</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Volume Control</string>
+ </property>
+ <property name="windowIcon">
+ <iconset theme="multimedia-volume-control"/>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTabWidget" name="notebook">
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>_Playback</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" colspan="2">
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>730</width>
+ <height>423</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="noStreamsLabel">
+ <property name="text">
+ <string>&lt;i&gt;No application is currently playing audio.&lt;/i&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Show:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sinkInputTypeComboBox"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>_Recording</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0" colspan="2">
+ <widget class="QScrollArea" name="scrollArea_2">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_2">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>730</width>
+ <height>423</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="noRecsLabel">
+ <property name="text">
+ <string>&lt;i&gt;No application is currently recording audio.&lt;/i&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Show:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sourceOutputTypeComboBox"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_3">
+ <attribute name="title">
+ <string>_Output Devices</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0" colspan="2">
+ <widget class="QScrollArea" name="scrollArea_3">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_3">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>730</width>
+ <height>423</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="noSinksLabel">
+ <property name="text">
+ <string>&lt;i&gt;No output devices available&lt;/i&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Show:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sinkTypeComboBox"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_4">
+ <attribute name="title">
+ <string>_Input Devices</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0" colspan="2">
+ <widget class="QScrollArea" name="scrollArea_4">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_4">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>730</width>
+ <height>423</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QLabel" name="noSourcesLabel">
+ <property name="text">
+ <string>&lt;i&gt;No input devices available&lt;/i&gt;</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Show:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="sourceTypeComboBox"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_5">
+ <attribute name="title">
+ <string>_Configuration</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <widget class="QScrollArea" name="scrollArea_5">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_5">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>730</width>
+ <height>461</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <widget class="QLabel" name="noCardsLabel">
+ <property name="text">
+ <string>&lt;i&gt;No cards available for configuration&lt;/i&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="showVolumeMetersCheckButton">
+ <property name="text">
+ <string>Show volume meters</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="connectingLabel">
+ <property name="text">
+ <string>...</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc
index 7a95c3e..48f3b59 100644
--- a/src/pavucontrol.cc
+++ b/src/pavucontrol.cc
@@ -22,15 +22,18 @@
#include <config.h>
#endif
+#define PACKAGE_VERSION "0.1"
+
#include <pulse/pulseaudio.h>
#include <pulse/glib-mainloop.h>
#include <pulse/ext-stream-restore.h>
#include <pulse/ext-device-manager.h>
-#include <canberra-gtk.h>
+// #include <canberra-gtk.h>
#include "pavucontrol.h"
#include "i18n.h"
+/*
#include "minimalstreamwidget.h"
#include "channelwidget.h"
#include "streamwidget.h"
@@ -40,7 +43,10 @@
#include "sinkinputwidget.h"
#include "sourceoutputwidget.h"
#include "rolewidget.h"
+*/
#include "mainwindow.h"
+#include <QMessageBox>
+#include <QApplication>
static pa_context* context = NULL;
static pa_mainloop_api* api = NULL;
@@ -54,10 +60,8 @@ void show_error(const char *txt) {
snprintf(buf, sizeof(buf), "%s: %s", txt, pa_strerror(pa_context_errno(context)));
- Gtk::MessageDialog dialog(buf, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true);
- dialog.run();
-
- Gtk::Main::quit();
+ QMessageBox::critical(nullptr, QObject::tr("Error"), QString::fromUtf8(buf));
+ qApp->quit();
}
static void dec_outstanding(MainWindow *w) {
@@ -65,7 +69,7 @@ static void dec_outstanding(MainWindow *w) {
return;
if (--n_outstanding <= 0) {
- w->get_window()->set_cursor();
+ // w->get_window()->set_cursor();
w->setConnectionState(true);
}
}
@@ -108,7 +112,6 @@ void sink_cb(pa_context *c, const pa_sink_info *i, int eol, void *userdata) {
dec_outstanding(w);
return;
}
-
#if HAVE_EXT_DEVICE_RESTORE_API
if (w->updateSink(*i))
ext_device_restore_subscribe_cb(c, PA_DEVICE_TYPE_SINK, i->index, w);
@@ -172,6 +175,7 @@ void source_output_cb(pa_context *, const pa_source_output_info *i, int eol, voi
/* At this point all notebook pages have been populated, so
* let's open one that isn't empty */
if (default_tab != -1) {
+#if 0
if (default_tab < 1 || default_tab > w->notebook->get_n_pages()) {
if (w->sinkInputWidgets.size() > 0)
w->notebook->set_current_page(0);
@@ -184,6 +188,7 @@ void source_output_cb(pa_context *, const pa_source_output_info *i, int eol, voi
} else {
w->notebook->set_current_page(default_tab - 1);
}
+#endif
default_tab = -1;
}
}
@@ -582,7 +587,7 @@ void context_state_callback(pa_context *c, void *userdata) {
case PA_CONTEXT_TERMINATED:
default:
- Gtk::Main::quit();
+ qApp->quit();
return;
}
}
@@ -610,25 +615,27 @@ gboolean connect_to_pulse(gpointer userdata) {
pa_context_set_state_callback(context, context_state_callback, w);
- w->setConnectingMessage();
+ // w->setConnectingMessage();
if (pa_context_connect(context, NULL, PA_CONTEXT_NOFAIL, NULL) < 0) {
if (pa_context_errno(context) == PA_ERR_INVALID) {
+/*
w->setConnectingMessage(_("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"
"or default-server in client.conf is misconfigured.\n"
"This situation can also arrise when PulseAudio crashed and left stale details in the X11 Root Window.\n"
"If this is the case, then PulseAudio should autospawn again, or if this is not configured you should\n"
"run start-pulseaudio-x11 manually."));
+*/
reconnect_timeout = 5;
}
else {
if(!retry) {
reconnect_timeout = -1;
- Gtk::Main::quit();
+ qApp->quit();
} else {
g_debug(_("Connection failed, attempting reconnect"));
reconnect_timeout = 5;
- g_timeout_add_seconds(reconnect_timeout, connect_to_pulse, w);
+ g_timeout_add_seconds(reconnect_timeout, connect_to_pulse, userdata);
}
}
}
@@ -679,39 +686,31 @@ int main(int argc, char *argv[]) {
options.set_main_group(group);
- try {
- Gtk::Main kit(argc, argv, options);
-
- if (version) {
- printf("%s\n", PACKAGE_STRING);
- return 0;
- }
-
- ca_context_set_driver(ca_gtk_context_get(), "pulse");
+ QApplication app(argc, argv);
+ // ca_context_set_driver(ca_gtk_context_get(), "pulse");
- MainWindow* mainWindow = MainWindow::create(maximize);
+ // MainWindow* mainWindow = MainWindow::create(maximize);
+ MainWindow* mainWindow = new MainWindow();
- pa_glib_mainloop *m = pa_glib_mainloop_new(g_main_context_default());
- g_assert(m);
- api = pa_glib_mainloop_get_api(m);
- g_assert(api);
+ pa_glib_mainloop *m = pa_glib_mainloop_new(g_main_context_default());
+ g_assert(m);
+ api = pa_glib_mainloop_get_api(m);
+ g_assert(api);
- connect_to_pulse(mainWindow);
- if (reconnect_timeout >= 0)
- Gtk::Main::run(*mainWindow);
+ connect_to_pulse(mainWindow);
+ if (reconnect_timeout >= 0) {
+ mainWindow->show();
+ app.exec();
+ }
- if (reconnect_timeout < 0)
- show_error(_("Fatal Error: Unable to connect to PulseAudio"));
+ if (reconnect_timeout < 0)
+ show_error(_("Fatal Error: Unable to connect to PulseAudio"));
- delete mainWindow;
+ delete mainWindow;
- if (context)
- pa_context_unref(context);
- pa_glib_mainloop_free(m);
- } catch ( const Glib::OptionError & e ) {
- fprintf(stderr, "%s", options.get_help().c_str());
- return 1;
- }
+ if (context)
+ pa_context_unref(context);
+ pa_glib_mainloop_free(m);
return 0;
}
diff --git a/src/pavucontrol.h b/src/pavucontrol.h
index 65cb913..2820fb1 100644
--- a/src/pavucontrol.h
+++ b/src/pavucontrol.h
@@ -26,7 +26,8 @@
#include <libintl.h>
-#include <gtkmm.h>
+// #include <gtkmm.h>
+#include <glibmm.h>
#include <pulse/pulseaudio.h>