The frontend API events "OBS_FRONTEND_EVENT_SCENE_CHANGED" and
"OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED" are not dispatched if
disableSaving has a value > 0. Prior code decremented disableSaving to
0 globally (regardless of whether saving was necessary, which is only
the case if a new collection is created as a fallback for a missing
scene collection).
Thus the updated code exhibits different event dispatch behavior then
old code which some plugins might have relied on. To avoid introducing
new behavior, explicitly create the environment to allow the dispatch
to take place and remove/refactor the events in a later version.
CEF crashes on shutdown if any browser window remains open during the
shutdown flow. Reproducible 100% of the time on Linux with What's New.
The previous implementation of the What's New dialog correctly deleted
all the Qt widgets, but the CEF internal event flow would only call the
"preparing to close" function, and never the "window safely closed"
function. Moving the code (practically unchanged) to a custom QDialog
solves the problem entirely, and is more consistent with other uses.
SetupNewProfile is used to create new profiles when OBS is already
running, which requires resetting program state for the new profile.
This function cannot be used to create a new profile as a fallback
for either a non-existing profile or for a fresh installation of OBS
Studio because by the point this is called from OBSBasic::OBSInit, the
runtime modules are not loaded yet and as such no services exist.
Activating the new profile without a profile reset fixes this issue
as the reset will be done explicitly by OBSBasic::OBSInit later.
When a starting scene collection or profile is provided, current code
would crash as the corresponding collections and management functions
do not exist yet (they are tied to OBSBasic, which is not initialized
that early in the program execution).
This change moves the checks for command line arguments into OBSBasic
into the parts responsible for initializing profiles and scene
collections and check for arguments provided via command line there.
Scene collection names that are not considered "safe" by OBS Studio
get a changed JSON file name with incompatible characters replaced.
The refactored scene collection implementation uses the Load function to
either activate an existing scene collection or create a new one if it
does not exist.
The Load function however overwrote the scene collection name set in
the profile with its own variant based off the "safe" file name, which
created a mismatch with the code that created the collection data
model.
As the Load function is only called by ActivateSceneCollection (which
itself already sets the name and filename for the collection), removal
of this superfluous code in the Load function also fixes the issue.
This change enables loading scene collections from locations different
than OBS' own configuration directory.
It also rewrites profile management in the app to work off an in-memory
collection of profiles found on disk and does not require iterating
over directory contents for most profile interactions by the app.
This change enables loading profiles from locations different than
OBS' own configuration directory.
It also rewrites profile management in the app to work off an in-memory
collection of profiles found on disk and does not require iterating
over directory contents for most profile interactions by the app.
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.
This adds scrollbars to the preview, so users can move around the
preview without using the spacebar + clicking.
Co-Authored-By: Clayton Groeneveld <19962531+cg2121@users.noreply.github.com>
Currently, when adding a filter to a source and then right-clicking it
or using the menu bar edit menu, it's not possible to copy the source's
filters. This is because the edit menu does not update on filter
changes.
Listening to the new global filters add/remove signal and updating the
edit menu will enable the copy option if a filter get added or disable
the option if the last filter gets removed.
Copy-Pasting filters on a scene or on a source via the audio mixer
context menu would not add an undo/redo action. This commit factors the
undo/redo logic out into a generic paste filters function that can be
used for pasting filters everywhere.