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.
master
Clayton Groeneveld 2021-10-28 00:54:34 -05:00 committed by Jim
parent a65287d615
commit 8d349ea4aa
3 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,7 @@ enum obs_frontend_event {
OBS_FRONTEND_EVENT_TBAR_VALUE_CHANGED, OBS_FRONTEND_EVENT_TBAR_VALUE_CHANGED,
OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING, OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING,
OBS_FRONTEND_EVENT_PROFILE_CHANGING, OBS_FRONTEND_EVENT_PROFILE_CHANGING,
OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN,
}; };
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */

View File

@ -4590,6 +4590,9 @@ void OBSBasic::closeEvent(QCloseEvent *event)
ClearExtraBrowserDocks(); ClearExtraBrowserDocks();
#endif #endif
if (api)
api->on_event(OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN);
disableSaving++; disableSaving++;
/* Clear all scene data (dialogs, widgets, widget sub-items, scenes, /* Clear all scene data (dialogs, widgets, widget sub-items, scenes,

View File

@ -93,6 +93,10 @@ Structures/Enumerations
Triggered when a profile has been added/removed/renamed. Triggered when a profile has been added/removed/renamed.
- **OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN**
Triggered when scripts are unloaded when exiting OBS.
- **OBS_FRONTEND_EVENT_EXIT** - **OBS_FRONTEND_EVENT_EXIT**
Triggered when the program is about to exit. Triggered when the program is about to exit.