Commit graph

32 commits

Author SHA1 Message Date
gxalpha 6a6cb3edcd UI: Avoid QT_TO_UTF8(QTStr()) double conversion 2023-07-18 15:07:25 -04:00
Richard Stanway d997a56fb6 UI: Destroy the frontend API after OBS_FRONTEND_EVENT_EXIT
The frontend API was never explicitly cleaned up which has lead to
several crashes from plugins continuing to call it even after OBS itself
has been destroyed. We now destroy the API after the exit event, so
further calls by plugins will be no-ops instead of potentially accessing
destroyed OBS state.

This also required some changes to our own use of the API, as we relied
on the OBSBasic destructor to clean up some callbacks, by which point
the API should have already been destroyed.
2023-07-15 16:54:51 -07:00
tytan652 cf5c68b773 UI,libobs,libobs-opengl,obs-ffmpeg: Remove unneeded cast in switches
Those casts were usually used to workaround switch warnings.

Also adds default to OBS frontend event switches that had this
workaround.
2023-01-16 11:52:26 +01:00
Richard Stanway 930c65e7c3 UI: Prevent negative "disk full in" calculation when no output
If the output is paused the average bitrate will be zero, resulting in
infinite time until disk is full and int overflows. Similarly, if no data
has been collected yet, the result will be NaN and undefined behavior.
2023-01-07 15:49:13 -08:00
tytan652 15689fd4bd UI: Fix stats widget appearance on Yami themes
- QSS changes fix background color on the stats dialog.
- Making OBSBasicStats derive from QFrame fixes the background color
and round bottom corners on the stats dock.
2022-10-19 15:02:25 -04:00
tytan652 0a12d6728c UI: Fix stats widget status font size 2022-10-19 15:02:25 -04:00
VodBox 3d544653e8 UI: Cleanup libobs C++ type use 2021-11-26 23:23:51 +13:00
Kurt Kartaltepe 513bcb8e35 UI: Cleanup Qt for Qt6
This changes cleans up some deprecated functions that were removed in
Qt6. Some are placed behind version ifdefs and others are replaced for
their non-deprecated Qt5 version.
2021-03-08 21:41:13 -08:00
PatTheMav 9ac92f61be
UI: Use macOS app icon for Qt app on macOS 2020-11-13 17:17:45 +01:00
jpark37 dbf318a388 UI: Apply minimum width to Stats fields
Helps prevent Stats dock from resizing OBS when long text is set.
2020-10-16 05:11:53 -07:00
Clayton Groeneveld f3501976d7 UI: Fix rec time left not showing in stats
If a user would start recording, then open the stats dialog,
the recording time left would be blank.
2020-09-02 18:49:13 -05:00
jpark37 263bf48baa UI: Fix Qt 5.14 deprecation warnings
These functions should be available on current Qt.
2020-01-20 22:13:16 -08:00
jp9000 a6871b2c1d UI: Add setThemeID to qt-wrappers
Makes the function usable outside of just window-basic-stats.cpp.
2019-12-27 10:54:20 -08:00
Richard Stanway 27b7f45fd7 UI: Fix path calculation for disk space check
When using custom FFmpeg output mode, the check would instead use the
standard recording path which is no longer visible in the settings. This
commit also simplifies the checks by moving the duplicated code to a new
function.
2019-09-27 15:04:07 +02:00
jp9000 f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
jp9000 f130e8755b UI: Ensure frontend event is removed on object deletion 2019-05-23 23:53:36 -07:00
Clayton Groeneveld 1282a5a3dc UI: Fix issue where rec time left would show negative time
The recording time left timer was being called an unnecessary time,
in the stats constructor, when it should have only been started
when the recording starts.
2019-05-21 01:45:38 -05:00
Clayton Groeneveld 171f811669 UI: Estimate recording time left until disk is full 2019-04-14 22:45:31 -05:00
Clayton Groeneveld 51198058c8 UI: Don't update stats dock if hidden
When the stats dock is hidden, the QTimer is still updating it, causing
unnecessary CPU usage.
2019-04-06 16:40:02 -07:00
Clayton Groeneveld 2080051b9f UI: Use icons from theme on Linux 2019-03-16 05:41:12 -05:00
pkv 62fa2b0086 UI: Fix a series of mem leaks (#1614)
* UI: Fix mem leak with projectors

* UI: Fix mem leak with ScaleFilteringMenu

* UI: Fix mem leak with sourceProjector

* UI: Fix leak with preview projector in Source menu and Preview

* UI: Fix mem leaks with background color menu

* UI: Fix leak with deinterlace Menu

* UI: Fix leak with scene transition override menu

* UI: Fix leak with scene projector menu

* UI: Fix leak with filter shortcut in Main

* UI: Fix leak with filter shortcut in stats
2019-01-30 20:33:15 -06:00
Alex Anderson 4df790a471 UI: Make stats dockable
Adds a new dock out of the stats widget.
2018-08-28 14:40:31 -07:00
Shaolin f61090e1ea UI: Set OBS icon to projector and stats window
Closes obsproject/obs-studio#1259
2018-04-22 04:56:45 -07:00
mntone 9ffdaff984 UI: Add memory usage to Stats window on linux/mac
Closes jp9000/obs-studio#953
2017-09-12 01:56:40 -07:00
jp9000 d3c163b775 UI: Fix Stats not showing stream data until start 2017-08-11 08:52:09 -07:00
SuslikV 9bf2318654 UI: Fix conditions for redraw the stats labels
After the commit 3491487c71 obs_frontend_get_streaming_output()
returns NULL if "Start Streaming" button not pressed yet.  The code
would erroneously fail to update the recording/streaming status if
either one of them hadn't been activated yet.

Closes jp9000/obs-studio#999
2017-08-10 21:40:18 -07:00
jp9000 96f746ce41 UI: Initialize Stats window values after OBSInit/reset
When the statistics window starts up for the first time, it reset values
at that very moment so that stray lagged frames due to OBS' startup
wouldn't be displayed.  However, that's really a bad place to reset
those values because the user could want to view the stats window after
a long stream, and having those values reset when he/she views the
window for the first time would sort of make the point of viewing your
stats moot.

Instead, reset the values only when applicable, such as after OBSInit or
when video is reset.
2017-06-19 15:38:13 -07:00
jp9000 0a82d87d82 UI: Check to see if outputs valid when updating stats 2017-05-15 15:05:54 -07:00
jp9000 3470776843 UI: Make Stats a regular window rather than dialog 2017-05-15 15:02:56 -07:00
jp9000 3d5759335c UI: Save/remember stats window geometry 2017-05-13 20:51:44 -07:00
jp9000 35454f7fc5 UI: Fix a few locale items, and add a few missing ones 2017-05-13 13:01:56 -07:00
jp9000 0e1ae62355 UI: Add stats dialog
Shows performance stats, and streaming/recording stats, and helps warn
the user when they have less-than-optimal values with coloring on the
values (e.g. yellow when getting low on disk space, red when getting
really low)
2017-05-13 01:52:54 -07:00