Commit graph

828 commits

Author SHA1 Message Date
jp9000 b4b01e2054 UI: Use bigger default size for button dock
Due to the new virtual camera button set being ridiculously large, the
main window needs a larger default dock size for the button dock.
Annoyingly.
2022-08-22 14:07:00 -07:00
cg2121 0afcb71122 UI: Reset volume/media sliders on theme change
Since volume/media sliders are using QProxyStyle, they are not
updated when themes are changed, so re-initialize them.
2022-08-20 16:29:16 -07:00
tytan652 5d5ecf17b4 UI: Check for virtual camera enablement before loading config 2022-08-18 06:47:42 -07:00
tytan652 f41404528a UI: Save virtual camera outside of the modules object
Save the configuration outside of the modules object meant for plugins
in the scene collection.
2022-08-18 02:35:13 -07:00
cg2121 5412b000ab UI: Remove unused stylesheet code
This code is from before custom stylesheets were introduced.
2022-08-17 23:22:05 -07:00
Chip Bradford 590fa1ffe6 UI: Free virtual cam memory on shutdown 2022-08-17 23:21:28 -07:00
gxalpha 07c54e1b18 UI: Use user application support as base_module_dir 2022-08-17 17:03:48 +02:00
gxalpha b543f96a3b UI: Only load legacy macOS .so plugins on x86_64
Plugins are expected to be in the .plugin bundle format. We do not want
to encourage usage of the old .so format, this is only kept at all for
backwards compatibility with existing plugins.
2022-08-17 17:03:48 +02:00
gxalpha 4998fddf6b UI: Don't load macOS plugin bundles from global library
Plugins are supposed to go into the user application support directory,
so we shouldn't load them from the system one.
2022-08-17 17:03:48 +02:00
cg2121 be98abc088 UI: Fix crash when hiding audio mixer item
This crash is suspected to be a QT bug that happens in 6.2.4, as
it only happens in this version. This is the QT version that is in
the Ubuntu 22.04 ppa, so this fix is a necessary evil as it affects
Ubuntu users.

This fixes the crash by deferring the hiding of the audio mixer
item to the next event loop.
2022-08-17 05:43:02 -07:00
Jim 7b76619c43 UI: Fix increment check for what's new (again)
Increment checks for the what's new file were not working as intended;
old stored increments would unintentionally pass to newer versions if
the newer versions did not explicitly start up with a whatsnew.json file
that had their version. The previous attempt to fix made it so that it
used a completely separate global.ini entry when a matching entry was
found. However, this entry did not take into account the beta or release
candidate number of the current build. This fixes it to bake in the
beta/rc number into the entry.
2022-08-14 01:06:53 -07:00
Jim c63d2f9852 UI: Remove #if expression for what's new message
This #if test was intended to not show messages for new users, but
instead just made it so messages wouldn't show at all if the entry
wasn't previously set. Plus the expression was bad anyway.

This was causing betas and release candidates to not show what's new
messages when they should have been.

Just remove this code as it's silly to have at this point anyway. All
users should see what's new messages if they open the program, even if
for the first time.
2022-08-14 01:06:53 -07:00
derrod 9140c260ee UI: Add Whats New for macOS/Linux
- Requires MbedTLS on Linux
- Enabled by default on macOS and Flatpak
- Enabled on linux via ENABLE_WHATSNEW_LINUX
- Enables compilation of blake2 on Linux/macOS
- Makes header name check also work with lowercase header
- Changes WahtsNew to be only enabled when browser panels are available
2022-08-13 16:46:48 -07:00
Chip Bradford e7ebe99049 UI: Fix crash when pausing/unpausing recording 2022-08-13 01:33:07 -07:00
Jim 9e15114750
Merge pull request #6577 from chippydip/multiple-video-mixes
libobs: Add support for multiple video mixes
2022-08-09 21:37:48 -07:00
gxalpha a1e8075fba UI: Unregister file splitting hotkey when clearing hotkeys 2022-08-06 10:25:10 +10:00
Chip Bradford df446c3f6e UI: Add Virtual Camera source selector dialog 2022-07-31 15:39:18 -07:00
PatTheMav f1cf3ff141 UI: Fix Qt call on UI thread from graphics thread
Calling `devicePixelRatioF` from any thread but the main UI thread
triggers thread-safety warnings at runtime on macOS, because Qt uses
NSView calls to determine the value.

NSView calls are only allowed to be made from the main thread on macOS,
so instead the value is stored as a property of the OBSQTDisplay at
initialization, to be retrieved from the preview object later.

Static functions that do not have access to the preview object have the
pixel ratio passed in their call signature.
2022-07-31 19:36:34 +02:00
gxalpha 37526e9ac9 UI: Add macOS permissions window
Co-Authored-By: Matt Gajownik <git@wizardcm.com>
2022-07-31 18:14:41 +02:00
cg2121 e072976ccf UI: Add audio mixer toolbar
This adds a toolbar to the audio mixer dock, so it is
easier to access advanced audio dialog and unhide/vertical
actions.
2022-07-31 20:22:02 +10:00
Clayton Groeneveld 2d6a9c9cc1 UI: Show spacing helpers in preview
This shows distance between sides of preview and edges of sources.
This will allow users to more easily align sources.

Co-authored-by: Palakis <contact@slepin.fr>
2022-07-30 19:41:18 -07:00
cg2121 5bdd4fe658 UI: Fix studio mode label not updating
When studio mode is enabled and OBS is first started, the program
scene label would be empty.
2022-07-31 09:18:14 +10:00
gxalpha ea9350bcbf UI: Add hotkey to split file
Adds a frontend hotkey that splits the current recording file. Ideally,
this would only appear if file splitting is enabled like the replay
buffer hotkey, however that is an output hotkey which is hidden because
the output doesn't exist. This doesn't work here since the recording
output is obviously always available, but is unaware of whether file
splitting is enabled until the output is started.
2022-07-30 15:21:08 +02:00
jp9000 2b3c90d2cc UI: Show warning on plugin load failure
Allows the user to know what plugins failed to load. This is
particularly useful if we're going to block Qt5 plugins as well, or if
certain plugins can't load because they're incompatible with a newer
version.
2022-07-28 16:36:01 -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
Clayton Groeneveld aae15fc497 UI: Fix bugs with missing files refactor
With https://github.com/obsproject/obs-studio/pull/5148, it was
brought up that the loading of the missing files was not thread
safe, as the missing files were being loaded late in the loading
process. This PR tries to fix that problem, while still simplifying
the original missing files code.
2022-07-27 12:42:32 +10:00
jp9000 64701a1cea UI: Only check major.minor for "what's new" 2022-07-26 07:49:09 -07:00
jp9000 a7ed93d88d UI: Use separate version string for what's new, save it
Uses a separate version entry for the "what's new" version check to
ensure that it properly resets whenever a "what's new" entry is ready to
be displayed.
2022-07-26 07:40:12 -07:00
jp9000 277e34fbb8 UI: Clean up OBSBasic::ReceivedIntroJson a bit
Just moves some defines above the function rather than have messy
defines all throughout the function.
2022-07-26 07:40:12 -07:00
jp9000 2df1ad5b39 UI: Ensure thread signal posts to UI thread
This is more of a safety precaution to ensure that the "what's new"
thread only executes its result function in the UI thread when emitted,
because the result function can read/write config files.
2022-07-26 07:40:11 -07:00
derrod 9c40e448b6 UI: Add File Integrity Check 2022-07-27 00:34:04 +10:00
Clayton Groeneveld 3dae4a35a1 UI: Relatively center multiple scene items
Before the scene items would be centered at the same spot
when centering them, now they are moved relatively to each
other.
2022-07-27 00:29:32 +10:00
Clayton Groeneveld b3c5524a48 UI: Add scene names to preview/program labels
This makes it easier for users to determine what
is the current preview or program scene.
2022-07-26 23:28:05 +10:00
jpark37 1610ac04ff UI: Add application audio capture to toolbar 2022-07-23 17:41:34 -07:00
Norihiro Kamae 5ea10fec82 UI: Remove unused functions for audio mixers
Functions `save_audio_source` and `load_audio_source` are defined but
never called from any code. Also not defined in any header file.
2022-07-23 16:49:21 -07:00
gxalpha 49e37db952 UI: Use pipe operator instead of plus for Qt keys 2022-07-22 09:37:17 -04:00
jp9000 0a218e06b7 UI: Add low latency audio buffering mode to UI
This feature is meant to reduce maximum audio buffering and turn off
dynamic buffering mode. This allows the lowest possible consistent
latency for audio buffering, which is useful for the decklink and NDI
outputs which cannot rely on audio timestamps for synchronization.

This can have a negative effect of making audio segments (partial or in
full) cut out. So audio glitching or audio loss can occur if this is
enabled.
2022-07-20 05:31:20 -07:00
Clayton Groeneveld 6eb5a922a7 UI: Remove duplicate missing files code
The same code was in different places, so call single function to
clean up code.
2022-07-18 19:12:31 +02:00
mvji c041deb433 UI: Check output path when starting replay buffer
Make a better error message for user,
in case recording path is invalid

Issue 6731
2022-07-16 16:50:32 -07:00
Clayton Groeneveld 873ee8e7ba UI: Fix reset ui warning showing on first start
If a plugin adds a dock and the program is run for the
first time, the reset ui warning would show up.
2022-07-10 12:26:42 +10:00
Vainock e053f9dd26 UI,mac-avcapture: Use consistent variables in locales 2022-07-02 14:02:40 +10:00
gxalpha cd900d7091 UI: Try closing remux before initiating shutdown
Makes OBS try to close the remux dialog before Clearing Scene data since
in case a remux might still be going on and the user does want to abort
closing OBS.
2022-06-25 21:44:58 -04:00
Clayton Groeneveld 3cfd30ae2a UI: Add ability to reset whole UI
Users for example disable all of the items in the view menu.
This allows them to easily reset them all.
2022-06-25 21:24:35 -04:00
tt2468 81003b2c64 UI: Change default reconnect values
- Base reconnect delay is now 2 seconds
- Max retry count is now 25
2022-06-25 17:06:00 -07:00
gxalpha 889ca0fc04 UI: Regroup and Reorder source right-click menus
Visually, the Scale Filtering, Blending Mode & Method, and Deinterlacing
menus are now grouped together, with "Hide in Mixer" being its own group
until a better place for it has been found.
Projector and Screenshot menus have been moved down.

As a related code cleanup, the creation of sourceProjector and
sourceWindow has been moved down and partially inlined.
2022-06-20 19:31:31 -03:00
gxalpha bb69883bd0 UI: Only show "Interact" menu for interactable sources
Most sources can't be interacted with, so always showing this menu only
takes up space and makes the menu stack bigger.
2022-06-20 19:31:31 -03:00
gxalpha 829e906ac2 UI: Remove "Resize output (source size)" menu 2022-06-20 19:31:31 -03:00
Norihiro Kamae 1c4bc6e735 UI: Fix multithread-unsafe GetCurrentScene
The function `OBSBasic::GetCurrentScene()` is also called from the
graphics thread and access to a QListWidget object, which is not
multithread-safe.
2022-06-06 10:20:00 -07:00
Kurt Kartaltepe f8d415afbe UI: Close display before native surfaces
This hooks the platform specific events in order to close the obs
display more accurately. Earlier attempts on hooking visiblity, but Qt
does not ensure that visibility is changed before the surface is
destroyed. So we ended up racing with the EGL driver and on some
drivers if you lose the race they hang.

Also only force display creation if the display is actually visible.
When a source type is not video/drawable (or is missing) this would
force the display to be created for the blank window and also hang.

Finally force closure of the preview displays during scene cleanup to
avoid similar ordering issues in Qt. Qt has even less order guarentees
during close and we are sure that displays are no longer needed at this
point in the UI.
2022-05-28 16:54:37 -07:00
gxalpha 41521b2816 UI: Move taskbar overlay functions into platform.hpp
Refactors the existing implementation for Windows into
platform-windows.cpp, allowing for other OS implementations in the
future.
2022-05-20 20:16:56 +10:00
Ryan Foster dbdf82da80 UI: Fix memory leak with Manage Broadcast dialog
When OBS has been connected to a YouTube account, the Manage Broadcast
dialog becomes available. Opening and closing this dialog leaks about
2-3 MB of memory each time. This happens because the dialog is never
deleted, and a new object is created every time the dialog opens.

If we set Qt::WA_DeleteOnClose on the dialog, then the dialog->exec()
call would call delete this. However, if the dialog->Valid() call
returned false (this should currently be impossible), then exec is never
called, so it would not clean up.

To fix this, make the dialog stack-allocated instead of using new and
delete.

Detected by clang-analyzer.
2022-05-16 22:46:50 +02:00
gxalpha 252918a7c4 UI: Put program on top in vertical studio mode
Co-Authored-By: Elias Thompson <email@eliasthompson.com>
2022-05-14 16:15:04 -07:00
Norihiro Kamae 34e570c5bc Fix indent on multiline comments 2022-04-30 16:06:23 -07:00
mvji 80600c1c26 UI: Fix compiler warning when WIN32 is not defined
Fix unused parameter warning.
2022-04-23 16:12:45 -07:00
gxalpha d6c6e8df87 UI: Add shortcut for larger movement steps in preview
Adds the ability to move a selected item 10 pixels in the preview when
holding shift while using the arrow keys, instead of going just 1 pixel
per step.
2022-04-16 16:47:44 -07:00
jpark37 338608bd67 libobs,UI: Support HLG nominal peak level
HLG output uses MovieLabs-recommended procedure.

- If peak luminance is greater than 1000, use maxRGB EETF to 1000.
- Otherwise, don't tonemap.
- Then use normal HLG conversion procedure with gamma 1.2 (1000 nits).
2022-04-14 09:36:44 -07:00
cg2121 02aa833950 UI: Fix show/hide toggle with minimize to taskbar
If the user would minimize to tray instead of taskbar, the
window would flash when clicking show in the tray menu, and
the preview would be disabled. This would only happen on Linux.
2022-04-13 16:14:41 +10:00
Norihiro Kamae ebc291956c UI: Set automatic file splitting time in minutes
The original PR was made with time specified in seconds because it was
useful to debug the behavior. For production, assuming most users want
to specify 10 minutes or more, the time should be specified in minutes.
2022-04-11 06:58:39 -07:00
Jim b745a100a3
Merge pull request #5371 from norihiro/automatic-file-splitting
Automatic file splitting
2022-04-10 16:49:37 -07:00
jpark37 59dbc3eb81 libobs: Rename Rec. 2020 to Rec. 2100
Rec. 2020 is really an SDR spec, but I think HDR10 made it okay to slap
PQ on it, call it an HDR spec. Rec. 2100 came along after and formally
allowed the use of PQ/HLG, so we should use 2100 instead.
2022-04-10 00:13:52 -07:00
jpark37 9409ce1ea7 UI: Add Rec. 2020 space and I010/P010 formats
Also localize color spaces with improved naming. Should be compatible
with existing user profiles.
2022-04-07 02:38:33 -07:00
gxalpha e33b7d2dab UI: Disable wheel scrolling on QComboBoxes
Adds a new ProxyStyle, OBSIgnoreWheelProxyStyle, and applies it to the
entire program. This style sets a StyleHint to disable mouse wheel
scrolling on QComboBoxes.
The existing OBSProxyStyle, which is used only for the context bar, has
been renamed accordingly.
2022-04-02 16:04:51 -07:00
jpark37 f2b049c0e7 UI: Add support for nonlinear SRGB blending 2022-04-02 16:02:41 -07:00
Richard Stanway a8ecf3c8f2
UI: Fix display affinity logic when re-applying
The old behavior toggled display affinity every time the window was
updated instead of applying it consistently.
2022-03-31 17:23:53 +02:00
jp9000 e236a16715 libobs: Refactor hide/show transition functions
Having two separate functions for each hide/show transition action is
silly and makes code awful.
2022-03-24 22:32:41 -07:00
jpark37 cd22df09c9 libobs, UI: Add SDR white nits option 2022-03-23 22:35:26 -07:00
PatTheMav 1f0f2be15e
UI: Update CMakeLists.txt for main OBS app 2022-03-16 23:11:58 +01:00
cg2121 24e4cd1717 UI: Fix mixer hide toggle in studio mode
If the user would toggle hide in mixer in studio mode,
the source would show up in audio mixer, even if it
wasn't active.
2022-03-08 13:18:05 -08:00
Matt Gajownik 372b54ca7a UI: Display dock-relevant context menu on titlebar 2022-03-08 12:36:19 -08:00
cg2121 8c732d31a7 UI: Disable replay save button when paused
Another indicator to the user that replays can't be saved
when recordings are paused.
2022-03-08 12:32:27 -08:00
jp9000 61cbfb3b9a UI: Use get_new_source_name instead of strprintf
Remove a bit of duplicated code, and fix non-Windows compilation. This
is a bit of a workaround to not have to modify cmake, but might as well
reuse a function that already exists anyway rather than duplicate the
code.
2022-03-08 01:27:20 -08:00
jp9000 6dd65c8d13 UI: Fix duplicated source names in audio settings
When you add an audio capture source and use the "use existing" feature
in the source selection dialog, and then recreate the same audio source
again in audio settings, it will result in two sources using identical
names, which although relatively harmless can cause issues when doing
things such as trying to find sources by their name.

Fixes obsproject/obs-studio#5621
Closes obsproject/obs-studio#5947
2022-03-08 01:05:27 -08:00
cg2121 1a2e5035c3 UI: Remove OBSSceneItem QDataStream
Since the source list is a custom list model, the
QDataStreams for OBSSceneItem are not needed.
2022-03-05 15:59:30 -08:00
gxalpha dd564a2e8f UI: Move "Check For Updates" menu to app menu on macOS
For apps using sparkle, it's normal for the "Check For Updates" button
to be in the app menu instead of the help menu, so let's put it there.
2022-02-27 12:47:18 +11:00
jpark37 61ffb5c4d8 UI: Add OBSQTDisplay::OnMove()/OnDisplayChange()
This plumbing will be useful when handling color space changes.

Currently does nothing, and only Windows is wired for now.
2022-02-26 01:09:07 -08:00
gxalpha d5f2b7e496 UI: Refresh edit menu on item select/deselect 2022-02-19 15:42:57 -08:00
Matt Gajownik eb7d6e84aa UI: Add separators to system tray context menu 2022-01-29 14:01:34 +11:00
gxalpha 9c51b70dd0 UI: Fix unused variable warning on non-windows 2022-01-29 13:30:17 +11:00
jp9000 c87a81ba56 UI: Show wait cursor while cleaning up scene data 2022-01-28 10:30:42 -08:00
Richard Stanway 5ed45d06da
UI: Check current affinity before calling SetWindowDisplayAffinity
For some reason, SetWindowDisplayAffinity can make windows visible even
when it sets the same value for affinity that GetWindowDisplayAffinity
reports. Possibly an API bug as this is probably not a widely used API
yet?

Fixes a weird window with no size appearing when browsing for files on
Windows.
2022-01-27 02:47:11 +01:00
gxalpha 799ac3f6a0 UI: Fix transform options being wrongly enabled/disabled
They detection for this was not checking the n selected items but the
first n items in the list, which would lead to the options being enabled
or disabled based on the whether other items were locked.
2022-01-25 05:58:47 -08:00
Richard Stanway 076cd5d5d4 UI: Add option to hide OBS windows on Windows
This uses the SetWindowDisplayAffinity API to hide windows from capture
applications (including OBS). This is not perfect - internal windows
such as context menus, combo box dropdowns, etc will still be displayed.
Even with these limitations, it should help people with single monitors
capture content with less interference from the OBS window.

This implementation is for Windows only but the code is generic enough
that adding other platforms should be straightforward.
2022-01-22 15:14:16 -08:00
Cody Jung fab293a686 UI: Remove Apple deferred tray load
With the change to how initial startup minimizing-to-tray works,
we can remove the Apple-specific workaround.
2022-01-07 20:15:03 -08:00
Cody Jung 35b9c76495 UI: Fix flash when starting minimized
Rather than showing the main window, then hiding it again when the
tray icon initialization happens, just don't show the main window.

When deciding whether to show the window, we need to know whether
the tray icon is available or not - if it's not and we don't show
the window, there would be no way to restore OBS.
2022-01-07 20:15:03 -08:00
Cody Jung 8929798d4d UI: Immediately apply tray icon change on Apply
Rather than waiting until the user chooses OK or Cancel to update the
system tray icon status, update it when the user chooses Apply.
2022-01-05 20:53:17 +11:00
Matt Gajownik 65b4ba7939 UI: Fix compile error in UpdateEditMenu from rebase 2022-01-05 17:12:55 +11:00
gxalpha 5b87a842ee UI: Correctly enable edit menu items with multiple sources 2022-01-04 21:39:57 -08:00
gxalpha 648b47a6f5 UI: Reenable copy/paste transform 2022-01-04 21:39:57 -08:00
jp9000 f295bd9968 Revert "UI: Add checks for overwrite setting to replay buffer"
This reverts commit 02f3495b72.

Multiple issues have come up with this commit. One issue is that
suddenly replays are overwriting themselves despite the option being
disabled. Second issue is that slashes to separate files into
subdirectories no longer work properly with replay buffers.

I'm just reverting it. I do not care enough about this feature to try to
fix it or wait on a fix. If someone wants to fix it they can create a
new PR for it.
2022-01-04 20:42:58 -08:00
gxalpha 9f15a58483 UI: Correctly disable "Paste Duplicate" if required 2022-01-04 02:01:28 -08:00
jp9000 52cc1d533e libobs, UI: Fix cpp auto-release assignment from OBSRefs
The *AutoRelease helpers should not take references from OBSRef objects.
Instead, make an OBSRefAutoRelease base class, and OBSRef a subclass of
that to allow moves, and then perform moves from those objects.

This fixes an issue where *AutoRelease OBSRef objects would cause an
unintended double release of objects after having been assigned values
from non-*AutoRelease OBSRef objects.
2021-12-30 21:19:34 -08:00
tt2468 47397ce527 UI: Add obs_frontend_open_source_interaction()
Adds a frontend api call to open the interact dialog of a source,
just like the `_properties` and `_filters` functions.
2021-12-28 21:44:35 -08:00
jp9000 213712dfe5 UI: Fix Copy/Paste not including blend mode 2021-12-28 09:12:51 -08:00
jp9000 2364dfd0ef UI: Remove unnecessary shared_ptr allocations
Not sure why these were separate allocations -- the data will be
preserved just fine when copying the structure without being separate
allocations
2021-12-28 08:34:40 -08:00
jp9000 1655ebf18f libobs, UI: Add support for beta builds
Allows the ability to specify beta builds in addition to release
candidate builds
2021-12-27 10:01:07 -08:00
gxalpha a92b671ed1 UI: Hold refs to existing sources during remove scene undo 2021-12-24 09:45:02 -08:00
gxalpha 3a67fe5944 UI: Hold refs to old sources during remove source undo
Fixes an issue where sources could get released and destroyed when
undoing the removal of a nested scene.
2021-12-24 06:02:02 -08:00
Norihiro Kamae 550b1331ac obs-ffmpeg, UI: Reset timestamps at splitting file
This commit adds a setting to reset timestamps when splitting files.
Some NLEs cannot handle video files whose starting timestamp is not
zero. Default is enabed.
2021-12-24 15:59:26 +09:00
Norihiro Kamae 0e81c66f6e UI: Add automatic file splitting
This commit implements a new feature to split recordings in split files
in Advanced output mode.
These basic settings are implemented.
- Enable/disable the feature. Default is disabled.
- Select a type of the limit, time or size.
- Specifies the limit in seconds or MiB.
2021-12-24 15:55:57 +09:00
gxalpha 29b8df97a6 UI: Remove unneeded call when removing scene 2021-12-23 06:37:10 -08:00
tt2468 167f539416 libobs: Rename obs_audio_monitoring_supported to _available
With the reasonable possibility of monitoring support becoming a
runtime check, the phrase `available` is more fitting.
2021-12-22 02:43:14 -08:00
jp9000 1dbc6c177a UI: Invoke QCoreApplication::quit in queued connection
Instead of calling App()->quit() directly, which may shut down the event
loop prematurely, invoke it and put it in the event queue so other
events can be processed first.

Again, this may be redundant, but we want to make sure any remaining
events are taken care of before the main window gets completely
destroyed, and before the program shuts down. This should help ensure
that.

Plus it also says you're supposed to do it this way in the documentation
rather than call it correctly so uh... yea. Probably should have done
this sooner.
2021-12-21 01:49:47 -08:00
jp9000 8bff191b32 UI: Use sendPostedEvents with deleteLater events on destroy
On destruction of the window, send remaining QEvent::DeferredDelete
events just to ensure there are no lingering actions remaining in the
queue. May cause additional events to be posted, which should be covered
by the final sendPostedEvents call.

(Jim note: I admit this is probably unnecessary, and this may be
redundant, but the reason such redundant precaution is being taken is
because we want to make sure that browser panels in particular are
properly cleaned up. To be quite frank I'm adding this mostly out of
paranoia.)
2021-12-21 01:48:58 -08:00
jp9000 fb58e58892 UI: Use null with sendPostedEvents()
After stepping into this function with a debugger, it's been determined
that App() won't do anything because it'll marked as a recursive call,
and 'this' will only clear events for this specific object. Instead, we
should be using nullptr to send all posted events for the program.

This fixes an issue where posted events would not be processed on
shutdown as expected before destroying the main window.
2021-12-21 01:41:19 -08:00
jw0z96 447b17e75e libobs: Implement additional source blending modes 2021-12-20 09:06:38 -08:00
jp9000 8b3416c1e7 libobs: Implement deferred destruction of sources
(This also modifies the UI)

The purpose of deferring destruction of sources is to ensure that:
1.) Hard locks from enumeration cannot occur with source destruction.
  For example, if the browser source is destroyed while in the graphics
  thread, the browser thread would wait for the graphics thread, but the
  graphics thread would still be waiting for the browser thread, causing
  a hard lock.
2.) When destroys occur during source enumeration, that the integrity of
  the context's next pointer in the linked list can no longer be
  compromised
3.) Source releases are fully asynchronous rather than having the risk
  of stalling the calling thread
4.) We can wait for source destruction when switching scene collections
  or when shutting down rather than hoping for threads to be finished
  with sources.

This introduces a new requirement when cleaning up scene/source data:
the obs_wait_for_destroy_queue() function. It is highly recommended that
this function be called after cleaning up sources. It will return true
if at least one or more sources were destroyed. Otherwise it will return
false. Forks are highly advised to call this function manually on source
cleanup -- preferably in a loop, in conjunction with processing
outstanding OBS signals and UI events.
2021-12-19 11:53:19 -08:00
jp9000 e4f0c21252 UI: Process deleteLater() tasks in OBSBasic::ClearSceneData
Causes QObject::deleteLater() events to be processed immediately in
OBSBasic::ClearSceneData() to ensure no lingering source or scene item
references remain
2021-12-19 11:25:57 -08:00
Mike 02f3495b72 UI: Add checks for overwrite setting to replay buffer 2021-12-17 06:49:44 -08:00
Tommy Vercetti c83b758f4d UI: Remove Qt Windows Extras for Qt 6 and later
Co-Authored-By: Matt Gajownik <matt@wizardcm.com>
2021-12-17 01:35:40 -08:00
Jim 83f08725e4
Merge pull request #5580 from VodBox/add-cpp-templates
libobs: Add AutoRelease OBSRef wrappers for OBS types
2021-12-13 21:31:27 -08:00
jp9000 b92e941b4f libobs: Add source cap to hint not to show properties
(This commit also modifies UI)

Adds a source capability flag to indicate that properties should not be
shown on creation
2021-12-07 20:54:37 -08:00
jp9000 0be3524658 UI: Don't show properties on creation if no properties
If a source doesn't have any properties, don't show properties on
creation
2021-12-07 20:54:37 -08:00
Matt Gajownik 0b67dc0285 UI: Uniquely identify Custom Browser Docks 2021-12-04 15:08:46 -08:00
VodBox 3d544653e8 UI: Cleanup libobs C++ type use 2021-11-26 23:23:51 +13:00
Warchamp7 a33c5c6be1 UI: Move Docks into top level menu
Managing the OBS UI docks is a core feature and as such should be
at the top level of the menu
2021-11-25 11:30:55 -08:00
gxalpha f2fda20572 UI: Minimize context bar when too small
This change removes the minimum total size from the context bar, instead
removing certain elements when the size is too small. This means that
users will still be able to make OBS smaller in width while keeping the
context bar enabled.

First, the properties, filter and interact buttons will get reduced to
just the symbols, if it gets even smaller the source specific menus are
hidden.
2021-11-24 13:40:29 -08:00
Clayton Groeneveld 6a0348cf64 UI: Add option for only one fullscreen projector per screen
This option is added for users who want to have only one
projector on a screen and want to save gpu resources.
2021-11-24 01:01:12 -08:00
gxalpha e6dc6c2d94 UI: Recreate nested scenes on scene delete undo 2021-11-23 22:00:47 -08:00
tt2468 ff22897d68 libobs/UI: Stop using preprocessor directives for monitor
**Code Cleanup**
Stop using preprocessor directives to determine if audio monitoring
is supported. Use runtime function instead
2021-11-20 20:00:59 -08:00
tt2468 544633d9bb UI: Remove unnecessary calls to RefreshSources()
With the previous commit, these calls to `RefreshSources()` are no
longer necessary.
2021-11-20 19:58:38 -08:00
Clayton Groeneveld 8d349ea4aa obs-frontend-api: Add scripting shutdown event
This event is for when scripts need to know when OBS is exiting.
Currently scripts are destroyed before the current exit event.
2021-11-15 10:20:55 -08:00
Anthony Torres fd500f15a3 UI: Apply transforms/crops correctly to sources on paste
Applies transformations correctly to copy/pasted sources when copy and
pasting multiple. Previously the transformation/crop state was stored in
a single variable on copy so it would only apply the transformations to
one of the selected sources on paste instead of what the state was when
copied.
2021-11-10 14:22:45 -08:00
Mike 9267c7e53d UI: Update Edit Transform dialog on scene switch
Closes obsproject/obs-studio#4312
2021-11-10 06:08:48 -08:00
gxalpha a7e0affd36 UI: Don't load existing sources for scene removal undo 2021-11-06 15:08:17 -07:00
Clayton Groeneveld af6c719139 UI, libobs, obs-plugins: Fix compiler warnings
Found warnings when compiling OBS.
2021-11-04 06:25:52 -07:00
gxalpha c565bcaf54 UI: Set correct text in system tray on startup
The system tray assumed all outputs are inactive when it's initiated,
however outputs can be active if started via command line options. This
caused the wrong (only) text to be set if the output was in fact active.
2021-11-04 03:40:17 -07:00
gxalpha ea90b93c33 UI: Remove duplicated StreamingActive() function 2021-11-04 03:38:45 -07:00
Matt Gajownik a2c3896e1a UI: Match Windows taskbar state to tray icon
This adds a status icon for active/paused outputs.

Stripped down version of #2442
2021-11-03 09:28:41 -07:00
jp9000 a4146a685b libobs: Allow last encoder error for last output error
(This commit also modifies UI)

This makes it more trivial for encoder plugins to communicate to users
why specifically an encoder error might have occurred mid-stream.
2021-10-25 12:24:16 -07:00
Clayton Groeneveld d9b4fbba1a UI: Disable properties for groups in context menu
Makes it consistent with the source context menu.
2021-10-24 02:06:19 -07:00
Clayton Groeneveld 13c7998cb5 UI: Fix vertical/horizontal scene item alignment
If the transform position alignment was set to anything but
top left, or the item was flipped, the item would be moved to
the the wrong position when centering vertically or horizontally.
2021-10-24 02:01:56 -07:00
Jim 5a9d4d1b26
Merge pull request #5411 from derrod/yt-fixes
More YouTube fixes
2021-10-24 00:47:51 -07:00
Clayton Groeneveld 96a5e11cd9 UI: Cleanup advanced audio functions
This removes the AdvAudioPropsClicked and AdvAudioPropsDestroyed
functions. The click function was not being used anywhere and the
destroy function was redundant because the dialog is set
to be deleted on close.
2021-10-24 00:21:10 -07:00
jp9000 b173d1ce2c UI: Disable paste source menu items when removed
Disables the "Paste (Reference)" and "Paste (Copy)" for sources when the
sources that have been copied have been removed

Fixes obsproject/obs-studio#4074
Closes obsproject/obs-studio#4096
2021-10-15 22:11:03 -07:00
jp9000 52497d23bb UI: Don't copy via name, use weak refs
This change makes it so that when copying filters or sources, that it
stores a weak reference to the source(s) or filter(s) being copied
rather than relying on their names.
2021-10-15 22:10:33 -07:00
Mike 96449877ef UI: Update Edit menu item states before displaying
Originally, the states of the items in the Edit menu would only update
when a context menu popup was created for sources. This moves that code
out of the context menu creation, and into its own dedicated function.
That function is then used both before the Edit menu is shown, and
before the context menu is created.

Fixes obsproject/obs-studio#3827
2021-10-15 16:11:08 -07:00
derrod 9d8a011b78 UI: Fix broadcast button state for autostart without autostop 2021-10-13 12:41:49 +02:00
derrod 2170a6b8ac UI: Show warning if starting/stopping broadcast fails 2021-10-13 12:27:47 +02:00
jp9000 c46a719c9c UI: Fix formatting with both 12.0.0 and 12.0.1
This single line in the entire project causes a difference between
clang-format 12.0.0 and 12.0.1. So, just rearrange the code so it works
with both instead.
2021-10-13 02:44:31 -07:00
jp9000 de0610a03a UI: Fix formatting for clang-format 12.0.0 (I guess)
I guess visual studio uses 12.0.0 rather than 12.0.1 and apparently,
there's some ****ing difference between 12.0.1 and 12.0.0.

Whatever.
2021-10-13 02:22:31 -07:00
jp9000 095661905b UI: Fix formatting with clang-format 12 2021-10-13 02:12:18 -07:00
Ryan Foster 5f68991911 clang-format: Commit file changes for clang-format 12 2021-10-13 20:00:04 +11:00
PatTheMav 39aedc6c2f UI: Add new vector-based menubar icons for macOS 2021-10-12 08:33:54 +11:00
jpark37 64cb26d03d UI: Tuck variable inside macro guard 2021-10-10 19:12:45 -07:00
Bob van de Vijver 1b280e0ac4 UI: Add ShutDownActiveOutputsOnExit setting
Adds a new setting to the general OBS settings, which can be checked
in order to no longer show the "confirm close" dialog when there are
still streams/recordings running.
2021-10-07 09:07:06 -07:00
jp9000 da04907927 Revert "UI: Disable hotkeys when a user is expected to type text"
This reverts commit f832d14220.

Reverting this until we do more investigation. Currently, any text
that can be typed in a dialog requires the dialog to re-enable hotkeys
on destruction, which is frustrating. There has to be a better way.
2021-10-03 07:52:44 -07:00
Richard Stanway 422a206371 UI: Force minimum reconnect delay of 1 second
Setting this to zero breaks reconnecting (and OBS) entirely as various
parts of the reconnect system do not handle zero values properly, and
there are also possible race conditions with the reconnect thread. Set a
minimum of 1 second to avoid this.
2021-09-16 03:32:46 -07:00
Jim 5c9aa83e05
Merge pull request #5242 from derrod/yt-better-buttons
Adjustments to YouTube Broadcast Setup
2021-09-14 16:36:34 -07:00
tt2468 63a570ed00 UI: Remove unused RemoveSelectedSceneItem slot
Appears to be a remnant left by the undo/redo system changes, not used
at all by any parts of the UI. This slot does not have undo/redo
system functionality, so it is not useful in its current form.
2021-09-13 01:38:23 -07:00
derrod ca3f244584 UI: Rework YouTube broadcast setup flow 2021-09-12 13:45:51 +02:00