Commit Graph

90 Commits

Author SHA1 Message Date
Ryan Foster
a1fbf1015f clang-format: Increase column limit from 80 to 120 2024-10-04 18:19:27 -04:00
Warchamp7
cb026964b0 UI: Replace themeID and style hints with class property 2024-10-04 15:20:49 -04:00
Norihiro Kamae
6fed2c2bdd UI: Fix error color at clipping is not displayed on horizontal meter 2024-09-27 13:30:10 -04:00
Norihiro Kamae
06642fdee4 UI: Fix low value of std::clamp gets greater than high value
`std::clamp` was introduced at 60a45d3aa3 but it caused a runtime
assertion failure on Windows that checks the low value of `std::clamp`
is not greater than the high value.
2024-09-18 17:15:02 -04:00
PatTheMav
2635cf3a2a UI: Split global config into app and user config
This introduces a split of the current single ConfigFile instance for
all configuration into two separate instances.

The app config instance contains system-wide settings that mainly
concern the working of the app itself, whereas the user config instance
contains settings actually exposed to the user for the configuration.
2024-09-12 16:18:46 -04:00
Norihiro Kamae
60a45d3aa3 UI: Use std::clamp instead of macro 2024-08-24 16:16:08 -07:00
PatTheMav
710d99ef4d UI: Improve incremental compile times via explicit file includes
When a source file contains an explicit include with a filename
following the "moc_<actual-filename>.cpp" pattern, then CMake's
AUTOMOC generation tool will recognize the matching pair and generate
the replacement header file and add the required include directory
entries.

For all files which do contain Q_OBJECT or similar declarations but do
not have an explicit include directive, the global mocs_compilation.cpp
file will still be generated (which groups all "missing" generated
headers).

The larger this global file is, the more expensive incremental
compilation will be as this file (and all its contained generated
headers) will be re-generated regardless of whether actual changes
occurred.
2024-08-22 16:45:12 -04:00
pkv
19abab097d UI: Fix leak with paint event of volume slider
This fixes a memory leak introduced in [1] where a new QColor is not
balanced by a delete.

[1] UI: Update volume meter appearance
52ae5fc4bd

Signed-off-by: pkv <pkv@obsproject.com>
2024-08-03 16:27:17 -07:00
tytan652
5eb10135da UI,shared: Move SliderIgnoreScroll to its own directory 2024-07-27 07:38:36 +02:00
tytan652
48f139729f UI,shared: Move Qt Wrappers to its own directory 2024-07-27 07:38:36 +02:00
Warchamp7
4e13cff8f1 UI: Center widgets in vertical mixer layout 2024-06-10 16:48:32 -04:00
gxalpha
c7dc09e862 UI: Fix mute checkbox positioning on macOS
Likely related to QTBUG-2699, QMacStyle appears to screw up the size of
this checkbox. Ignoring the style's layout rect fixes this.
2024-06-10 16:48:32 -04:00
Warchamp7
56d6fb4c62 UI: Group horizontal audio mixer buttons 2024-06-10 16:48:32 -04:00
Warchamp7
52ae5fc4bd UI: Update volume meter appearance 2024-06-03 17:20:21 -04:00
Warchamp7
8dcfae9a39 UI: Remove unnecessary ProxyStyle usage 2024-05-23 18:55:43 -04:00
Warchamp7
aba600cec0 UI: Move VolumeSlider widget to volume control 2024-05-23 18:55:43 -04:00
cg2121
b82a49e881 UI: Use OBSSourceLabel for VolControl
The OBSSourceLabel handles renaming of a source, so we don't have
to use the rename signals for volume controls.
2024-05-11 18:18:13 -07:00
cg2121
272a5edbaa UI: Use vector for volume control signals
This cleans up the volume control code by using a vector for
signals.
2024-05-11 18:18:13 -07:00
cg2121
dfd5798e6c UI: Fix volume control button styling
The config button and mute checkbox were different sizes.
2024-04-29 14:56:59 -04:00
Ryan Foster
eb65ebdc5e UI: Use System theme volume meter colors
These comments do not actually match the color values here:
 * (0xff, 0xff, 0xff) is white
 * (0xcc, 0xcc, 0xcc) is light gray

Instead of just fixing the comments, use the values from the System
theme and also correct the comments.
2024-04-18 13:59:44 -04:00
Florian Zwoch
fd65a1404c UI: Fill audio meter background each update (#9842)
Since the widget is marked as opaque we need to draw each pixel or
else we may end up with unpainted pixels. On Wayland this will
result in artifacts in the audio meter as transparent pixels will
pick up colors from the underlaying desktop instead.
2024-02-20 15:44:59 -05:00
Ryan Foster
02478d4939 UI: Use std::shared_ptr instead of QSharedPointer
Also use std::weak_ptr instead of QWeakPointer as needed.

Qt has been porting QSharedPointer and QWeakPointer to std::shared_ptr
and std::weak_ptr respectively. QSharedPointer is apparently 2x slower
than std::shared_ptr.

References:
 * https://bugreports.qt.io/browse/QTBUG-109570
 * https://codereview.qt-project.org/c/qt/qtbase/+/359678
 * https://codereview.qt-project.org/c/qt/qtgrpc/+/447780
 * https://codereview.qt-project.org/c/qt/qtbase/+/450134
 * https://codereview.qt-project.org/c/qt/qttools/+/450776
 * https://codereview.qt-project.org/c/qt/qttools/+/450777
 * https://codereview.qt-project.org/q/QSharedPointer
2023-10-04 18:36:20 -04:00
cg2121
610990270f UI: Center vertical volume control buttons
The mute and config buttons were not vertically centered.
2023-08-21 17:38:31 -03:00
gxalpha
ac170a2d83 UI: Replace SIGNAL and SLOT macros in custom widgets 2023-07-21 13:16:04 +02:00
derrod
dcc07cfe4e clang-format: Set AllowAllConstructorInitializersOnNextLine to false 2023-07-15 16:14:55 -07:00
Clayton Groeneveld
e121ac1587 UI, libobs: Add RAII wrappers for faders/volume meters
They can now be automatically deleted.
2023-07-15 16:06:36 -07:00
derrod
67f7712d83 UI: Migrate undo/redo to using UUIDs 2023-06-28 11:04:56 -07:00
derrod
982c424de3 UI: Do not show unassigned icon for monitored sources 2023-05-05 17:38:34 -04:00
derrod
87e294fa5f UI: Fix unassigned audio source check in callback 2023-04-05 21:53:36 +02:00
derrod
16c078960d UI: Fix missing masking in unassigned audio mix check 2023-03-29 03:16:45 +02:00
derrod
dc84a8da20 UI: Add unassigned indicator and warning to mixer 2023-03-25 16:08:25 -07:00
tytan652
6dd99e3a9f UI: Fix implicit conversion warning on Linux with Clang 2023-01-19 13:08:46 -05:00
Matt Gajownik
08a04d2cf0 UI: Lock volume meter sliders to LTR
Fixes #5447 where sliders would work in reverse.
2023-01-03 18:24:41 -05:00
PatTheMav
8f362fe508 UI: Clamp float values possibly representing infinity to integer size
Casting a floating point type to an integer type has undefined behaviour
if the value does not fit into the destination type.

As the volume meter is initialized with floats values representing +inf
(as makes sense for a dB meter), values should be explicitly clamped
to integer boundaries.
2022-10-09 16:20:03 -07:00
cg2121
193d48f5d9 UI: Fix alignment of volume sliders
With the Yami themes, the volume sliders wouldn't
be aligned in the center of the layout.
2022-10-02 10:31:26 +11:00
cg2121
94189402c2 UI: Fix padding with vertical volume meters
Since Yami uses a different font, the 0 dB mark at the top of the
vertical meters would be cut off. This adds a 1px padding to the top
and bottom of the volume meters, when in vertical mode.
2022-08-13 01:10:38 -07:00
VodBox
77694d76e8 UI: Add Accessibility menu to settings
This change introduces an accessibility menu to settings, along with
options for overriding the colors used by OBS in the mixer and in the
preview to be more color blind friendly than the options provided by the
current theme.
2022-07-27 21:37:30 -04:00
Warchamp7
936bd58874 UI: Add new theme Yami 2022-07-02 16:52:39 -07:00
gxalpha
2422deb78a UI: Default mixer volume meter to two channels
If OBS is set to mono, it will still default to mono.
Also corrects a somewhat related comment (which was also wrong before
this change)
2022-04-17 11:54:50 +10:00
OldBaldGeek
6a5a5b4538 UI: Make volume meter tweakable by stylesheet
Replace fixed Arial, 7 px meter scale font with the font used
for VolumeMeter/QWidget. Add qproperties for meter bar thickness and
a scaling factor for the meter scale numbers. If not specified in a
QSS, defaults are 3 pixel bar width and 80% of base font size.
2022-02-27 13:17:59 +11:00
OldBaldGeek
c8a0dbff1e UI: Use selective repaint on volume meter scale
Fix for issue 3915 - reduce tick and font blur at 125% DPI.
Former use of paint cache resulted in blur when scaled.
2022-02-27 13:17:59 +11:00
Exeldro
1dd96124e3 UI: Fix vertical grayscale meters when volume is muted 2021-12-30 22:32:24 -08:00
Clayton Groeneveld
f52c05081a UI: Add grayscale meters when volume is muted
This allows the user to see audio levels, even when
muted.
2021-12-23 06:35:29 -08:00
Clayton Groeneveld
5878856ce4 UI: Display grayscale volume meter if muted
Currently, the volume meters don't show volume levels when
muted. This shows the levels and makes it grayscale when
the source is muted.
2021-12-23 06:35:29 -08:00
VodBox
3d544653e8 UI: Cleanup libobs C++ type use 2021-11-26 23:23:51 +13:00
Ryan Foster
5f68991911 clang-format: Commit file changes for clang-format 12 2021-10-13 20:00:04 +11:00
jp9000
2be0d6b8ef Revert "UI: Update volume controls by callback"
This reverts commit 0a3cd8fbf6.

Causes volume levels to freeze if audio stops.
2021-09-23 09:27:30 -07:00
jpark37
0a3cd8fbf6 UI: Update volume controls by callback
Gets rid of the time-critical timeSetEvent thread on Windows.
2021-09-10 10:21:19 -07:00
jp9000
20bbc9794d UI: Add Undo/Redo for volume change/mute via main fader 2021-04-27 21:09:41 -07:00
Exeldro
bacf83dbc9 UI: Close context menu on destroy of VolControl 2021-01-25 04:17:14 -08:00