Commit Graph

236 Commits

Author SHA1 Message Date
mephinet a2a452f249 mainwindow: Close window instead of quitting on Ctrl-W etc.
The end result is the same, so this isn't strictly needed - originally
this patch fixed a segfault, but that segfault got fixed in a different
way before merging this patch.
2020-11-09 17:32:16 +02:00
Felipe Sateler 2840825519 Migrate away from deprecated Gtk interfaces
This was accomplished by building with -DGTKMM_DISABLE_DEPRECATED.
2020-10-11 17:18:59 +03:00
Jamison Lofthouse 9954baa343 Set channel label width to 12
Add a bit more padding for when percentages and decibel levels are weird
so that sliders and labels are a consistent width.
2020-08-04 17:45:06 -06:00
Yousuf Philips aff7bdea2b Have pulseaudio appear in the Settings category of menu 2020-07-07 14:45:12 +03:00
Yousuf Philips 64b086580a Additional keywords from the dialog and elsewhere 2020-06-10 19:28:53 +00:00
Yousuf Philips 64b8bc9f61 Make pulse audio appear in Xfce's settings dialog 2020-06-09 12:35:31 +00:00
Leon Kowarschick fb75f5d1e4 add gtk window class to mainwindow.
This allows pavucontrol to be specifically addressed when creating GTK
themes.
2020-06-02 20:20:35 +02:00
Allan Nordhøy 8921ee0cd6 i18n: Correct spelling "AC-3" and "E-AC-3" 2020-05-17 00:48:43 +00:00
lionel 327be8dc28 pavuapplication: fix compilation issue with g++ (Raspbian 4.9.2-10+deb8u2)
Fixes this compilation issue:

pavuapplication.cc: In function ‘int main(int, char**)’:
pavuapplication.cc:146:32: error: use of deleted function ‘PavuApplication::PavuApplication(PavuApplication&&)’
     auto app = PavuApplication();
                                ^
In file included from pavuapplication.cc:29:0:
pavuapplication.h:27:7: note: ‘PavuApplication::PavuApplication(PavuApplication&&)’ is implicitly deleted because the default definition would be ill-formed:
 class PavuApplication : public Gtk::Application {
       ^
In file included from /usr/include/gtkmm-3.0/gtkmm/window.h:32:0,
                 from /usr/include/gtkmm-3.0/gtkmm/dialog.h:30,
                 from /usr/include/gtkmm-3.0/gtkmm/aboutdialog.h:33,
                 from /usr/include/gtkmm-3.0/gtkmm.h:99,
                 from pavucontrol.h:29,
                 from pavuapplication.h:24,
                 from pavuapplication.cc:29:
/usr/include/gtkmm-3.0/gtkmm/application.h:211:3: error: ‘Gtk::Application::Application(const Gtk::Application&)’ is private
   Application(const Application&);
   ^
In file included from pavuapplication.cc:29:0:
pavuapplication.h:27:7: error: within this context
 class PavuApplication : public Gtk::Application {
       ^
In file included from /usr/include/glibmm-2.4/glibmm/wrap.h:26:0,
                 from /usr/include/glibmm-2.4/glibmm/containerhandle_shared.h:26,
                 from /usr/include/glibmm-2.4/glibmm/arrayhandle.h:23,
                 from /usr/include/glibmm-2.4/glibmm.h:91,
                 from /usr/include/gtkmm-3.0/gtkmm.h:87,
                 from pavucontrol.h:29,
                 from pavuapplication.h:24,
                 from pavuapplication.cc:29:
/usr/include/glibmm-2.4/glibmm/objectbase.h:238:3: error: ‘Glib::ObjectBase::ObjectBase(const Glib::ObjectBase&)’ is private
   ObjectBase(const ObjectBase&);
   ^
In file included from pavuapplication.cc:29:0:
pavuapplication.h:27:7: error: within this context
 class PavuApplication : public Gtk::Application {
       ^
2020-02-14 11:35:54 +02:00
Christoph Haag 4f31ec83a8 mainwindow: escape nameLabel
Fixes a warning with the 'Valve VR Radio & HMD Mic' device.
2019-12-22 05:57:20 +00:00
Tanu Kaskinen ae278b8643 streamwidget: Use a drop-down list instead of a button and a popup for selecting the device
This looks better, requires less code and probably fixes
https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/63
2019-11-27 19:54:30 +00:00
Will Thompson a36506b82e Add keywords to desktop file
In traditional packages, including 'pavucontrol' here is redundant with
Exec.  However, only the first field of Exec is used as a search key,
and in the Flatpak the first field is 'flatpak'. I often search for
'pavucontrol' and fail to find the app as a result.

All the others are terms that seem relevant to finding this app. Most of
them are borrowed from gnome-control-center's sound panel's .desktop
file.
2019-11-07 16:19:27 +00:00
Tanu Kaskinen 2a1072cc2b devicewidget: fix the enabling logic of the advanced options expander
The old logic disabled the expander always when a sink didn't have any
ports. That's bad if the sink has no ports but supports configuring
formats. That hasn't caused problems so far, but I have a patch for
module-null-sink that will enable format configuration support, and the
null sink has no ports, so it's affected by this issue.

This patch also changes things so that the expander is completely hidden
when it's disabled instead just setting it non-sensitive. I think that's
better (at least it saves some space).
2019-09-19 15:26:04 +03:00
Tanu Kaskinen 0dd27ba347 mainwindow: set the updating flag later for sinks and sources
The updating flag is used to determine whether a change in some UI
control state is due to a user action or an update from the server. The
flag was set to false too early when processing sink and source updates
from the server. This caused at least unnecessary "set port" commands,
because each update refreshes the port list, which generates change
events in the port list combo box, causing the portChanged callbacks to
be called.

The unnecessary "set port" commands could even confuse the automatic
port selection policies in the server. If the current port wasn't
originally explicitly chosen by the user, then the "set port" command
from pavucontrol will make the server think that the user explicitly
chose that port.
2019-09-19 11:37:11 +03:00
Tanu Kaskinen e6caa8b87a mainwindow: scale icons to sane size
If load_icon() fails, we treat the icon name as a file path and try to
load an image from the path. In case that works, we need to ensure that
the has correct size. Previously that wasn't done, which led to too
large icons.

scale_simple() doesn't do anything if the image is already the correct
size, so we can call it unconditionally.

The exception handling was a bit weird in that the exception types
didn't match the documentation of IconTheme::load_icon() and
Image::set(). I updated the exception types (Image::set() doesn't need
exception handling any more, because now it's called with a Pixbuf
rather than a file name).

Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/60
2019-07-27 13:53:48 +03:00
Tanu Kaskinen 5f664bc63b channelwidget: ensure that all channel labels have the same width
pavucontrol.glade previously set the channel label width to 15
characters, with the goal of making all channel labels have the same
width. However, with some translations and font settings the configured
width wasn't enough, so sometimes a label was wider than others, and
that made the volume slider widths different too. If the volume sliders
have different widths, it's very hard to visually compare the volumes of
the channels.

This patch removes the fixed width in pavucontrol.glade and solves the
problem by finding the widest label and using that label's width with
all labels.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/51
2019-02-26 15:42:57 +00:00
Tanu Kaskinen f200a10d98 channelwidget: refactor to reduce repetition
DeviceWidget and StreamWidget had some duplicate code to initialize
ChannelWidgets. This patch moves some of the duplicated initialization
code into ChannelWidgets to reduce repetition and to improve
encapsulation.
2019-02-26 15:42:57 +00:00
Tanu Kaskinen 46ce3e418e pavucontrol.glade: right-align channel labels
The channel labels ("Front Left" etc.) that are adjacent to volume
sliders used to be left-aligned, which meant that there was some empty
space (depending on the text width) between the label text and the
volume slider. Right-aligning the labels looks nicer.
2019-02-26 15:42:57 +00:00
Karl Ove Hufthammer ce36a44a1d channelwidget: Make volume strings translatable and add missing space
The volume strings (e.g. ‘86% (-3.81dB)’) shown to the right of each
volume slider is now translatable/localisable. (The similar string
‘100% (0dB)’, centred *below* each slider, was already translatable.)
Also, the English strings now include a space between the decibel value
and the unit, e.g. ‘-3.81 dB’ instead of ‘-3.81dB’.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/52
2019-02-25 18:25:09 +02:00
Andreas Rönnquist 1035910f45 Remove closing window by pressing Esc
Disable closing using Esc, to avoid closing the window by mistake.
2019-02-09 07:23:48 +00:00
Tanu Kaskinen dfeabf086c drop gtk2 support
When opening pavucontrol.glade with Glade 3.22.1, this message was
shown:

    pavucontrol.glade targets Gtk+ 2.16

    But this version of Glade is for GTK+ 3 only.
    Make sure you can run this project with Glade 3.8 with no deprecated
    widgets first.

I think it's best to just drop the gtk2 support.
2018-11-21 12:55:11 +02:00
Tanu Kaskinen 577246f15a pavucontrol.glade: changes automatically done by Glade
When opening pavucontrol.glade in Glade 3.22.1 and saving the file
without doing any manual changes, these changes are made to the file.
The changes seem harmless, so let's apply them to avoid unnecessary
clutter appearing when doing more important changes in the future.
2018-11-21 12:25:02 +02:00
Tanu Kaskinen 0fa1969108 pavucontrol.glade: object renames automatically done by Glade
When opening pavucontrol.glade with Glade and saving it without any
manual changes, Glade does these object rename to get rid of duplicate
IDs. None of these are referenced by the code, so the renames are
harmless.
2018-11-21 12:17:55 +02:00
Tanu Kaskinen 0047261f23 rename more objects in the quest to get rid of duplicate IDs
Continuing from the previous patch, this patch renames more objects in
pavucontrol.glade to get rid of duplicate IDs. nameLabel and iconImage
actually weren't any more duplicates, because the previous patch renamed
the corresponding IDs for devices and streams, but the card related
objects were renamed nevertheless to be more descriptive and consistent
with the IDs used by the device and stream widgets.
2018-11-21 12:06:08 +02:00
Tanu Kaskinen c760edaf24 move some widget initializations from MinimalStreamWidget to subclasses
Current Glade versions want object IDs to be unique, but currently
pavucontrol.glade shares some IDs between the top-level windows. I guess
this used to be OK in the past, and the "interface-naming-policy
toplevel-contextual" comment in the beginning of the .glade file
probably has something to do with this. I want to update the .glade file
to be easy to work with current Glade versions, so I will remove the
duplicated object IDs.

The first IDs to change are the "channelsVBox", "nameLabel",
"boldNameLabel" and "iconImage" IDs. These were used by
MinimalStreamWidget to create widgets for both devices and streams, but
now that the IDs are different for devices and streams, the widgets have
to be created by the subclasses.

MinimalStreamWidget doesn't need the Gtk::Builder in its constructor any
more, so remove that parameter to avoid warnings about an unused
variable.
2018-11-21 11:40:02 +02:00
Tanu Kaskinen d3b3bee378 pavuapplication: initialize members in the constructor
It seems that without explicit initialization of the members they remain
uninitialized. The lack of initialization caused crashing, because
PavuApplication::on_activate() creates the MainWindow only if mainWindow
is NULL, and if it's some random value instead, on_activate() calls
selectTab() on a non-existent window.

Fixes: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/issues/49
2018-10-18 15:27:10 +03:00
Nikita Zlobin 7c3e76e7a5 UI form enhancement
Padding around scrollviews inside notebook is removed - bottom panel now top padding as well
and both are visually separated.
2018-03-24 09:03:47 +02:00
Anders Jonsson 90c91702ed main: Fix typo
arrise -> arise

https://bugs.freedesktop.org/show_bug.cgi?id=104227
2017-12-14 08:35:13 +05:30
Tanu Kaskinen 36d82f23aa remove unnecessary Window -> MainWindow casting
mainwindow.h and pavucontrol.h include each other, which makes it
necessary to declare some types before the include directives.
2017-11-02 10:51:34 +02:00
Tanu Kaskinen 107a8dd305 remove unnecessary RefPtr wrapping of PavuApplication
There's no need for reference counting of PavuApplication.
2017-11-02 10:51:13 +02:00
Colin Leroy f6ce4fb8db Implement single-launch with Gtk::Application
This introduces a new file for clarity. Options
handling changes so that --tab changes the tab
if the window is already opened. Other options
are only used at start time.
2017-11-01 13:39:39 +02:00
Colin Leroy 335c26c57c devicewidget: Set latency offset's maximum to 5000ms
Airplay hardware has a inherent latency of at least 2 seconds, with
2350ms being a common value.
2017-10-08 20:02:59 +03:00
Tanu Kaskinen 574139c10e pavucontrol.glade: use a more appropriate icon for the channel lock button
Suggested by Palo Kisa:
4474716b41 (commitcomment-21327782)

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=99577
2017-03-15 23:47:24 +02:00
Paul W. Frields 4474716b41 Use freedesktop.org standard icon name
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=99577
2017-01-31 15:26:53 +02:00
Felipe Sateler 6e0de0a39a mainwindow: force icons to have sane size
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=86398
2016-05-01 20:28:27 +03:00
Lukas K f6015d6426 Add checkbutton for disabling volume meters
Add a checkbutton for disabling volume meters because of high CPU
utilisation when updating them
2016-04-26 18:15:57 +03:00
Arun Raghavan fd98c921ae mainwindow: Don't add a border on the outermost vbox
It adds a thick border around along the edges that looks quite ugly.
2016-03-31 17:13:39 +05:30
Pino Toscano 4db50bc09a Remove Encoding key from .desktop file
Long time deprecated.
2016-01-25 08:36:40 +05:30
Peter Meerwald 290485e8ab Add --version command line option
allow pavucontrol to display its --version
see https://bugs.freedesktop.org/show_bug.cgi?id=83147

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
2015-05-20 23:07:55 +02:00
David Kreuter c4fcb1c772 mainwindow: unavailable profiles are marked as such in their description 2015-04-10 18:13:01 +05:30
Steven Dwy 762cca5519 mainwindow: Remember device visibility selections
stores the type of devices that are shown for Playback,
Recording, Output Devices, Input Devices, resp.
2015-02-26 22:55:46 +01:00
Ivan Ivanov dd0ccda382 devicewidget, streamwidget: Show only one volume slider when channels are locked 2015-02-26 22:55:46 +01:00
Martin Steghöfer ed140c230c mainwindow: Catch Gdk::PixbufError
Due to another bug the MIME type guessing of PNG files was broken on my
Ubuntu system. This made pavucontrol crash on startup (while loading the
necessary icons) without a helpful error message (requiring a lot of
debugging effort). Although this is not originally pavucontrol's fault,
I think that pavucontrol could be more robust about such a problem,
especially because:

A) In a complex database like the one to guess MIME types (that is populated
from hundres of different packages) this can happen from time to time and
B) pavucontrol already has some fallback options in place - they are just not
active in this specific case.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88813
2015-02-16 11:29:29 +01:00
Felipe Sateler f2e32ea305 Handle IO errors in icon setting code
If gtk cannot load the file, it may throw a Gio::Error. In that case
fall back to setting the name.

BugLink: https://bugs.debian.org/765725
2014-10-28 11:36:28 +02:00
Christer Stenbrenden c71e9d5b51 Don't crash if pa_stream_peek returns NULL
pa_stream_peek can return NULL if either the buffer is empty or if it
has a hole. In either case we need to avoid derefencing the data
pointer. Additionally, if there is a hole, we need to call pa_stream_drop,
if the buffer is empty we should not call it.

BugLink: https://bugs.debian.org/735898
2014-10-28 11:32:45 +02:00
Hans de Goede e83660bbd6 Do not instantiate cardwidget, devicewidget and rolewidget with a type of EventBox
RoleWidget::create contains:
    x->get_widget_derived("streamWidget", w);

But streamWidget is defined as following in the glade file:
<object class="GtkEventBox" id="streamWidget">

Where as RoleWidget is derived from [Minimal]StreamWidget, which is derived
from Gtk::VBox, so this is clearly wrong.

Adding:
printf("rolewidget type: %s\n", g_type_name(G_TYPE_FROM_INSTANCE(w->gobj())));
for debugging shows that this really leads to RoleWidget being instantiated
as an EventBox (yet things still work due to sheer luck).

This commit fixes this, by putting the streamWidget id at the right level of
the hierarchy in the glade file (and likewise for cardWidget and deviceWidget).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-09-07 13:58:51 +03:00
Hans de Goede b2362f2223 Reference the widget before returning it from ::create methods
Widgets (unlike Windows and Dialogs) returned by Gtk::Builder::get_widget*
start owned by the GtkBuilder object, the idea being that they will get
added to a container before the scope of the GtkBuilder object ends, and it
thus automatically gets destroyed.

But in the various ::create methods in pavucontrol, a pointer to the widget
gets returned, so that it can be added to a cointainer by the caller.
However as soon as the ::create method exits the GtkBuilder object owning
the widget, and thus also the widget gets destroyed, and we end up returning
free-ed memory.

This commit fixes this by making all ::create methods take a reference on
the widget before returning it, and having all the callers unreference the
widget after adding it to a container.

https://bugs.freedesktop.org/show_bug.cgi?id=83144
https://bugzilla.redhat.com/show_bug.cgi?id=1133339

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2014-09-07 13:51:27 +03:00
Simon Johansson 0254dfb2ab Add horizontal scrollbars automatically
Add a horizontal scrollbar inside each tab automatically when the window
is not wide enough. Add arrows for scrolling the tab bar when the tabs
don't fit inside the window.
2014-06-24 13:38:08 +03:00
Pierre Zurek dc4bdf091f Add a --maximize command line option 2014-03-07 16:04:32 +02:00
Alexander E. Patrakov 35e844d2b2 pavucontrol: ellipsize labels to fix window resizing
ellipsize labels to make the window resizable even with long label text
and add tooltips to provide a way to read the full text

Originally from Sebastian Wick <sebastian@sebastianwick.net>
2013-12-13 15:18:42 +02:00