Commit Graph

263 Commits

Author SHA1 Message Date
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
Akihiro Tsukada cbf3acb543 sinkwidget: add support for AAC pass-through 2013-03-13 11:35:59 +02:00
Alam Arias 0d7cbc57a0 added back support for gtkmm-2.4 builds 2013-03-11 13:23:06 +02:00
Arun Raghavan 5132a24b35 sinkwidget: Move format selection options to 'Advanced' expander
There's no reason to present this for all S/PDIF and HDMI cases. The
user can select it when required.
2012-12-17 15:20:42 +05:30
Arun Raghavan c69cffecdc devicewidget: Move latency offset into an expander
We don't want to flood users with this option, let's just leave it
closed by default for those who need it.
2012-12-17 15:20:42 +05:30
Tanu Kaskinen cc06ae9029 mainwindow: Fix iterator dereferencing style. 2012-11-24 16:39:05 +02:00
poljar (Damir Jelić) 1bff6399d6 mainwindow: Show the availability of the ports and profiles.
If we know if a certain port is available/unavailable, we can print
that out, as a help to the user (and as debugging for ourselves).
A profile is also available/unavailable if all ports which have that
profile are available/unavailable.

Credit goes to David Henningson for the original idea and some of the code.
2012-11-24 16:35:12 +02:00
Tanu Kaskinen f0853f0810 mainwindow: Don't clear the "updating" flag in updateCard() too early.
The prepareMenu() call can change the active profile selection, which
in turn will cause a "set card profile" command to be sent to the
server if the "updating" flag is not set, so the "updating" flag needs
to be set when calling prepareMenu() from updateCard().

This caused a problem with disconnecting bluetooth headsets: as part
of the disconnection procedure, module-bluetooth-device sets the card
profile to "off". At that point module-card-restore doesn't do
anything, because the change is marked as "don't save". But the
profile change event is then sent to pavucontrol, which updates its
view, and pavucontrol sends the new profile ("off") back to
pulseaudio, and this time the profile change iss marked as "please
save", so module-card-restore restores the "off" profile when the
device is connected again, even though the user never requested the
"off" profile to be chosen.
2012-11-19 15:16:22 +02:00
Colin Guthrie 27d915d041 Add a few known peak-detect stream clients to a source-output blacklist 2012-09-28 00:08:10 +01:00
poljar (Damir Jelić) d03f9ffac2 devicewidget: Add a latency offset spinbutton
This change adds the ability to change the latency offset of a port with
pavucontrol.
2012-07-27 09:25:14 +03:00
poljar (Damir Jelić) 8af6520c60 sink/sourcewidget: Move the index and card_index to the devicewidget
This is a minor cleanup that moves the index of the sink/source and the
card_index from the sink/source widget to the device widget.
2012-07-27 08:56:02 +03:00
poljar (Damir Jelić) 1a23cdfe6d cardwidget: Add a port class
The cardwidget should cache all the relevant data for the ports.

This change introduces a new port class which holds the port info for
the card.
2012-07-27 08:54:10 +03:00
Frédéric Dalleau ba868cc0b0 Add --retry command line option
As a developper, I find it annoying to restart pavucontrol everytime I restart
pulseaudio, moreover the error dialog sometimes needs an additional click
before restarting.
Add it as a command line option so that default behavior is not changed.
2012-07-04 12:35:52 +03:00
Cosimo Cecchi fb278932a4 Fix theme under gtk3
We need to set the visible_window property to ensure
the theme background colour shines through.

https://bugzilla.gnome.org/show_bug.cgi?id=655635
2011-10-25 11:31:37 +02:00
Arun Raghavan 8e359a8f71 source: Only autosuspend network sources
This makes sure we inhibit autosuspend only for network sources (which
was the main purpose of adding autosuspend, since constantly monitoring
those is network heavy).
2011-09-23 08:21:07 +05:30
Colin Guthrie f58f0da9eb Update device format stuff for (pre-release) API changes. 2011-08-18 17:46:28 +01:00
Arun Raghavan c9b307de5a Check if PA_SINK_SET_FORMATS is defined before using it 2011-08-18 14:57:09 +05:30
Arun Raghavan 5c19f6b5d2 Use sink flags to figure out if we can set formats
The server now signals when a sink supports setting formats, so we don't
have to rely on the profile name.
2011-08-16 11:13:34 +05:30
Colin Guthrie 479e7bcd6e Add UI to select the formats supported by the receiver attached to a digitial sink 2011-08-10 14:22:55 +02:00
Colin Guthrie e317d38146 Fix strange vertical alignment of sinks/source/cards
This only seemed to affect GTK3 and it seems to introduce
a GTK warning relating to 'gtk_widget_size_allocate' similar
to those fixed in the previous commit, but nothing seems to
be the worse for it.
2011-07-27 23:35:20 +01:00
Colin Guthrie 2aaf33200a Fix GTK Warnings under GTK3 due to combo box sizes 2011-07-27 23:34:48 +01:00
Colin Guthrie 0087ef0d60 source-output: We will officially support source output volumes in 0.99 2011-07-22 10:18:40 +01:00
Colin Guthrie ca9c74b042 source-output: Don't set the channel map for the SO if we do not support SO volumes.
The setting of the channel map triggers the display of the actual volume sliders
so it is essential that we do not set it when we don't want to.
2011-07-22 10:01:48 +01:00
Colin Guthrie a03fa60f41 sink: Oops. I didn't mean to comment this out in the previous commit. 2011-07-22 09:50:22 +01:00
Colin Guthrie 9784b9d76d stream-volumes: Support source-output volume controls now available in PA. 2011-07-22 09:35:38 +01:00
Colin Guthrie 53c38faa8a Handle simple key events.
* Use ctrl+w or ctrl+q or esc to quit.
 * Uset ctrl+1-5 to change tabs.
2011-06-06 12:18:14 +02:00
Colin Guthrie 933b8a7009 Deal more gracefully with disconnections.
As pavucontrol is often used for debugging PA, it should
be quite robust and not popup messages etc. under 'normal'
testing conditions. This adds quite a verbose message under
some specific conditions that do crop up from time to time.
2011-06-06 12:18:06 +02:00
Marc-Antoine Perennou 964de9fc7f Add support for gtkmm-3.0 and prefer it over gtkmm-2.* by default.
Pass --disable-gtk3 to configure to build against gtk2
2011-04-29 17:10:58 +01:00
Colin Guthrie 26d42651c5 Ensure the marker for base volume is set on all channels.
Refs #804
2011-03-28 18:52:27 +01:00
Colin Guthrie c70b048c98 volume: Don't bother setting the steps.
The number of volume steps doesn't really affect our scale, so there
is little value in setting it.
2011-03-09 21:54:05 +00:00
Colin Guthrie 297af52ae5 volume: Support volumes up to 11.
This allows us to set volumes up to ~153% aka +11dB.

Also show the current dB value in the UI - as pavucontrol is a bit more
developer-friendly than other volume UIs displaying this by default makes
sense.
2011-03-09 21:50:29 +00:00
Colin Guthrie 9516b6f1dc ui: Remove ellipsize attribute from some labels (causes ellipsis to be displayed rather than real text) 2011-03-03 14:53:28 +00:00
Colin Guthrie 099e91616d ui: Resave glade file without any changes to tidy it up 2011-03-03 14:36:08 +00:00
Rafał Mużyło 9ce0e0a380 Drop the need to use libglademm 2011-03-03 14:31:14 +00:00
Maarten Bosmans 5997290d1e Add DONT_INHIBIT_AUTO_SUSPEND flag to monitor streams 2011-03-03 13:52:21 +00:00
Colin Guthrie 73e57023ec source-outputs: Source outputs do not support volume control, so hide the mute and lock channels buttons 2010-12-22 14:58:30 +00:00
Colin Guthrie f70ff92ecd main: Format string fixes 2010-04-22 02:04:19 +01:00
Colin Guthrie 97c9cc6197 main: Add a --tab command line argument to force a given tab to be displayed.
Refs: http://pulseaudio.org/ticket/768
2010-04-22 01:03:54 +01:00
Colin Guthrie 870c3ddb2e mainwindow: Fix clearing out of clients 2010-04-22 00:08:39 +01:00
Colin Guthrie 94add670c4 mainwindow: Save/restore window size 2010-04-22 00:04:56 +01:00
Colin Guthrie 95e48d5c9e mainwindow: Compact iterator decls 2010-04-21 00:44:01 +01:00
Colin Guthrie 9fe20201f2 main: Cleanup labels after connection rework 2010-04-20 22:03:45 +01:00
Colin Guthrie 18c8945708 source-outputs: Fix a bug where the 'no streams' label is sometimes shown along with the actual widget. 2010-04-20 20:45:26 +01:00
Colin Guthrie 7de18201a3 connection: Show a nice label when connecting to PA. 2010-04-20 20:24:15 +01:00
Colin Guthrie 84dc67b395 main: Automatically reconnect to PA upon disconnection 2010-04-20 20:01:39 +01:00
Colin Guthrie 6c0bcb4c08 mainwindow: Add a method to remove all widgets (e.g. on disconnect) 2010-04-20 20:00:37 +01:00
Colin Guthrie b11f0b7297 streamwidget: Fix a compile warning. 2010-04-20 19:46:30 +01:00
Colin Guthrie cbcdd0f49c Split out the creation of the PA context a little.
This is a precursor to adding reconnection support.
2010-04-20 19:11:14 +01:00
Lennart Poettering 8959744e60 glade: ellipsize user supplied text strings 2010-01-05 20:57:25 +01:00
Colin Guthrie 78f5194541 Allow for the sink input peak detect to survive across sink moves. 2009-10-17 15:59:29 +01:00
Colin Guthrie 68e3401350 Update for the latest incarnation of module-device-manager 2009-10-15 13:03:16 +01:00
Colin Guthrie c813bb9e3f Use the correct update mode for device-restore database write 2009-10-15 13:03:16 +01:00
Colin Guthrie 375c2c2d62 Add support for the device-manager module.
Currently this module only really allows for devices to be renamed, so we add a new
dialog that can be activated by right clicking on devices (i.e. sinks/sources).
This dialog allows you to enter a new name which will be set via the extension
provided by the device-manager module.

Future work will allow you to manage (i.e. rename, delete etc) offline devices too.
2009-10-15 13:03:16 +01:00
Colin Guthrie d4f1a7622b volume: Set the scale properly for delta changes via mouse/keyboard. 2009-10-03 13:09:37 +01:00
Colin Guthrie b5b433ee00 events: Hide output streams with a stream restore designator for the event widget.
Showing these streams causes UI issues due to the repainting when the app that generates the
sound events is pavucontrol itself (e.g. changing volume, trying to move stream to a new device etc.)
2009-10-03 13:09:12 +01:00
Lennart Poettering 32d6f81d9d drop reference to beepDevice 2009-09-09 01:06:12 +02:00
Lennart Poettering 8a11d0f781 fix event sound generation for volume changes 2009-08-27 05:41:11 +02:00
Lennart Poettering 5143fa8dae only assume that the minimal volume is silence for devices that can do dB volumes 2009-08-27 05:40:47 +02:00
Lennart Poettering b373c000ea use fallback icon scheme for stream icons, too 2009-08-26 02:15:57 +02:00
Lennart Poettering d98588b665 glade: minor alignment fixes 2009-07-01 20:28:57 +02:00
Colin Guthrie f1a23af603 Restructure the class inheritance a bit.
This just shuffles around the streamwidget a bit. The RoleWidget child class is the
exception, so try and gear things around SinkInput/SourceOutput widgets more to
save repeating the same code too much.
2009-06-28 16:38:39 +01:00
Colin Guthrie ac052e1a30 Rename event method to be more indicative of what it does. 2009-06-28 16:00:35 +01:00
Colin Guthrie 61cae8cd40 Rename a variable to make it more generic 2009-06-27 22:37:46 +01:00
Colin Guthrie 159609135f Add support for changing ports.
This commit adds a combo box for selecting ports.
Overall this implementation could have taken two paths:
 * Implement port selection as combo box.
 * Implement port selection as a button.

I went for the first option as is done in selecting card profiles over the
second method used for selecting devices for streams. This seems more like
how a config option should be presented as opposed to a runtime type thing.
2009-06-27 18:14:05 +01:00
Colin Guthrie 7b3083df57 Don't use a hyperlink to display the device, just use a regular button.
I'm not super happy with this style but it's probably more reliable
2009-06-17 23:23:04 +01:00
Colin Guthrie 514a66e0c8 Do not disable the default button when it's set.
I reworked the way this was done so we can easily re-enable this as I think it's clearer when it's inactive
(the difference between toggled and not toggled is pretty minor).

With this abstraction we could reset the tooltip etc. too.
2009-06-17 22:44:02 +01:00
Colin Guthrie 7a7c1fc7f2 Hide the terminate button.
The terminate button is a last resort and shouldn't be promoted in the UI.

This commit hides it behind a right click menu instead.
This also hides the 'Set as Fallback' label in the glade file.
2009-06-17 22:25:19 +01:00
Colin Guthrie 02b316fcba More changes in the UI to try and make things neater.
This abandons the combo box approach an instead partially reverts to the popup.
We now display a suffix after the stream title saying " on <device>" or " from <device>"
where the <device> part looks like a hyperlink and, when clicked, shows the popup to change the device.

If there is only one device available, we suppress the whole thing and thus avoid confusion.
2009-06-17 08:54:14 +01:00
Colin Guthrie e71562619a Create the event role widget early so that it's always top of the list. 2009-06-17 08:54:14 +01:00
Colin Guthrie b96c707c12 Change 'Default' to 'Use as fallback' 2009-06-17 08:54:13 +01:00
Colin Guthrie ddd7d06dde Move the setBaseVolume()/setSteps() methods to devicewidget (problem found after rebasing) 2009-06-17 08:54:13 +01:00
Colin Guthrie dea5d0a0fe Include config.h in the cc file (after rebase) 2009-06-17 08:54:13 +01:00
Colin Guthrie 26d5749396 Add a tooltip 2009-06-17 08:54:13 +01:00
Colin Guthrie 4bd94fa2b8 Wire up all the new UI code.
This makes the default button work on sinks/sources, allows the drop
down to actually change the sink/source and removes the old menu code.

Some names and such are fixed in the glade file too.
2009-06-17 08:54:12 +01:00