Commit Graph

24 Commits (master)

Author SHA1 Message Date
jpark37 1610ac04ff UI: Add application audio capture to toolbar 2022-07-23 17:41:34 -07:00
Norihiro Kamae fcf6b24e44 UI: Fix crash if missing module in context bar
If a module is not found in context bar, it crashed when resolving
source type name. This is same change as 41367bb2b but fixes
window-capture and display-capture.
Also removes an unnecessary pair of braces.
2022-06-25 16:09:30 -07:00
cg2121 7b418d5be3 UI: Use std::unique_ptr for ui variables
Most ui variables were using std::unique_ptr, but not all.
Went through all of the UI code to find where they were manually
deleted.
2022-02-20 00:30:37 -08:00
Matt Gajownik 4e04011101 UI: Don't read unloaded module in source toolbar
Avoid potential crashes similar to #4391 for existing users,
especially on non-Windows.
2022-01-23 16:45:54 +11:00
VodBox 3d544653e8 UI: Cleanup libobs C++ type use 2021-11-26 23:23:51 +13:00
gxalpha 3ccc963e53 UI: Fix context bar shutdown crash 2021-11-23 22:01:43 -08:00
gxalpha 509e44d6ea UI: Add undo/redo for context bar text changes 2021-11-06 14:43:58 -07:00
gxalpha 5c26bf06f0 UI: Use correct color property for freetype in toolbar 2021-10-16 15:30:41 -07:00
gxalpha 4bd69bf46e UI: Make toolbar color selectors respect alpha 2021-10-16 15:30:41 -07:00
Warchamp7 6e566f9b23 UI: Adjust minimum size of source toolbars
Sets a minimum size on the source toolbar itself to prevent shrinking the main window too small for it to be useable in some cases.

Also sets some sane limits on the toolbars with dropdown menus and the image source toolbar filepath
2021-08-25 02:09:51 -07:00
jp9000 2d524580fe UI: Fix context bar crash
This crash was caused by the fact that the SourceToolbar::oldData member
variable was not being released correctly. To release an OBSData object,
it must be either destructed, set to a new value, or set to a null
value.
2021-06-10 14:33:32 -07:00
jp9000 b685d1bf88 UI: Fix proprty Undo not updating settings properly
Settings would not update properly because obs_source_update() can only
apply the settings value to the existing settings, so it could not
remove values. This change fully erases existing settings and replaces
it with the target settings instead.
2021-04-30 18:38:31 -07:00
jp9000 78f1983f7d UI: Remove unnecessary Undo/Redo cleanup func
Since fixing the reference holding issue with scene/source deletion, the
undo/redo cleanup function (last param of add_action) is no longer
required.
2021-04-27 20:45:43 -07:00
Clayton Groeneveld 7dfd36f9e8 UI: Force current scene when using undo/redo
The undo/redo functions are setting the current scene. Everytime
it would do this, it would actually transition to the scene.
This forces the current scene, so it fixes a bug where the
transition would be grayed out when undoing/redoing.
2021-04-10 01:49:30 -07:00
Ford Smith 999495ca8c UI: Undo/Redo context bar properties
Implements undo/redo for changing of properties done through the context
bar.
2021-03-29 03:06:26 -04:00
Jimi Huotari 41367bb2b4 UI: Fix crash when no audio backends are available
This commit prevents a crash in, for example, Linux configurations
where PulseAudio is disabled, which leads into 'mod' being 'null',
which in turn leads into a segmentation fault when an ALSA source
is selected.

Closes https://github.com/obsproject/obs-studio/issues/3485
2021-01-12 09:33:48 -08:00
jp9000 97491ee91a UI: Add SetComboItemEnabled
Replaces SetComboItemDisabled in context-bar-controls.cpp with a global
function in qt-wrappers called SetComboItemEnabled, which allows both
enabling and disabling items in a combo box.
2020-11-13 18:07:20 -08:00
jp9000 50d3130b64 UI: Replace/simplify device toolbar
The old version of the device toolbar was a complex situation.  Because
of the fact that device properties can take significant time to query,
this put an unpleasant burden on the UI thread; so to fix this problem,
the device toolbar was made to be threaded.  However, threading is a
complex and dangerous thing, and there is a fear that this could cause
complications down the line whenever users are simply selecting devices.

So for the time being, as a safety precaution, simplify the device
toolbar down to just the "activate" button, and make it so that if users
really need to query and change the devices, that they need to
explicitly open the properties.  That way the devices aren't being
queried constantly every time a device source is selected.

Alternatively in the future, device enumeration could be cached, but
seeing as that's a significant amount of work and needs to take in to
account whether a user adds/removes a device while the process is
active, that's not going to happen any time soon.
2020-09-07 16:21:29 -07:00
Matt Gajownik cefc8cc767 UI: Save Freetype Text source color from Source Toolbar 2020-09-03 23:09:45 +10:00
jp9000 55c21319e0 UI: Fix source toolbar color selection on color source
When selecting a color on the color source, if you pressed cancel, it
would cause it to set the color to black.  Instead, make sure to check
isValid() on the returned color value to see if the user pressed cancel
when selecting a color.
2020-09-03 05:49:58 -07:00
jp9000 3cd925da73 UI: Remove unnecessary obs_properties_apply_settings
This is already called by obs_source_properties internally, so this call
was unnecessary.
2020-08-25 10:04:29 -07:00
jp9000 fcf01304d2 UI: Defer device properties to separate thread
Because devices can take significant time to enumerate, defer the
properties creation to a separate thread.  The author of this commit
feels a great amount of displeasure over having to write this.
2020-08-25 08:21:29 -07:00
jp9000 ab2f3edb2b UI: Put context combo box operations in functions
This allows the ability to use these functions elsewhere without having
to duplicate the code or subclass from the ComboSelectToolbar class.
2020-08-25 08:21:20 -07:00
Colin Edwards fddbbe259d UI: Source Toolbar
The source toolbar allows quick and easy access to properties and
filers, and shows common properties/features of a source type.  For
example, when you select a media source, VLC source, or the slideshow
source, you'll get media controls to control playback of the media.  If
you select a text source you can edit the font, color, or text if
applicable.  Or if you select a capture source, you can select the
display/window/etc to capture for that source.

If the source toolbar is not desired and is viewed as taking up valuable
space in the window, it can be disabled via the view menu.

Co-authored-by: Clayton Groeneveld <claytong1214@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
2020-08-17 07:18:18 -07:00