Commit graph

80 commits

Author SHA1 Message Date
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
VodBox 89b4e9136f UI: Various screen reader fixes
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 2004.

Audio track selection in Settings now says Track 1, 2, etc, rather than
just the number.

Various checkboxes that just say "Enable" now have accessible text that
says what the enable is for (since it says "checkbox", the fact it's an
enable should hopefully be clear).

Type in the recording tab of output now has accessible text which says
"Recording Type".

Items in the Advanced Audio Properties window now have accessible text
for what they are for. Currently some do not report correct values, but
that will require an accessible interface in Qt to be written
specifically for that, which will be done at a later date.

Buttons in the filters window now have accessible text for what they do.

All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text.
2020-11-25 19:38:05 -08:00
jp9000 f4f2d383b1 UI: Greatly improve main window repaint performance
The VolumeMeter widgets were apparently being drawn as transparent
widgets, which meant that it was necessary to redraw everything under
the widgets in order to properly draw the widgets, so the entire mixer
section of the window was being redrawn every time the meters updated.
This caused a significant perf hit when the only thing wanted/desired
was just to update the meters. This was more noticeable after changing
the audio meter update rate to 60hz from 30hz.

The fix is to simply mark them as opaque widgets, and paint the
background ourselves rather than rely on what's under the window. CPU
perf for painting the main window has been vastly improved because of
this; CPU usage of Qt in the main window is now reduced by at least half
of what it was, if not more.
2020-10-03 08:27:01 -07:00
Ben Torell 1782490060 UI: Update volmeters at 60hz
Technically this is 62.5Hz (once every 16ms) but who's counting?
2020-06-22 09:36:22 -04:00
Matt Gajownik 962ac4abbc UI: Don't clip meters when resizing with no input 2020-03-21 23:25:23 +11:00
Clayton Groeneveld b3601681b8 UI: Add ability to lock volume 2020-02-16 18:33:46 -06:00
luz.paz d124e6402c docs/sphinx: Fix various typos
(This modifies UI, libobs, deps/obs-scripting, various cmake files)

Found using:
`codespell -q 3 -S *.ini,./UI/data/locale,./deps/w32-pthreads -L aci,dur,iff,mut,numer,uint`
2019-10-14 17:19:38 -07:00
jp9000 3064887ae2 Revert "UI: Various screen reader fixes"
This reverts commit b5843caa48.

This breaks some hotkeys because the signals are tied to a signal which
is now triggered because "toggled" is used instead of "clicked", so just
revert it for now for the release and look at it later post-patch.
2019-09-12 13:55:31 -07:00
VodBox b5843caa48 UI: Various screen reader fixes
This commit fixes various issues with screen readers in the main OBS
interface. These were tested using NVDA on Windows 10 1903.

Checkboxes or buttons which toggle, when receiving an activate signal
from the screen reader would visually update, but not perform any
action. This is because they're listening only for clicks. They should
all now be listening for toggles instead.

The screen reader would navigate through the UI in the order that
elements are defined in the .ui XML, and not by their row positions.
The XML has been reordered so that things should be defined in their row
order.

Audio track selection now says Track 1, 2, etc, rather than just the
number. Various checkboxes that just say "Enable" now have accessible
text that says what the enable is for (since it says "checkbox", the
fact it's an enable should hopefully be clear). Type in the recording
tab of output now has accessible text which says "Recording Type".

All the right side buttons in hotkeys now have tooltips, and by
extension, accessible text. Currently it does not yet say what hotkey
the action is in relation to, but that would require more locales.
2019-09-04 12:43:56 +12:00
Jim 5f7ff6fbcc
Merge pull request #1970 from cg2121/fix-warnings
various: Fix compiler/theme warnings
2019-08-17 08:22:03 -07:00
jp9000 7b5cc8c29d UI: Use "-inf" for muted volume level
The infinity character doesn't work on windows, so just revert to using
"inf" for now.
2019-08-16 13:06:06 -07:00