mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
UI: Add frontend API to defer saving
Allows the ability to perform multiple actions that would normally save, and defer the save until all of those actions are complete. Closes obsproject/obs-studio#1231
This commit is contained in:
@@ -550,6 +550,19 @@ void OBSBasic::Save(const char *file)
|
||||
obs_data_array_release(savedMultiviewProjectorList);
|
||||
}
|
||||
|
||||
void OBSBasic::DeferSaveBegin()
|
||||
{
|
||||
os_atomic_inc_long(&disableSaving);
|
||||
}
|
||||
|
||||
void OBSBasic::DeferSaveEnd()
|
||||
{
|
||||
long result = os_atomic_dec_long(&disableSaving);
|
||||
if (result == 0) {
|
||||
SaveProject();
|
||||
}
|
||||
}
|
||||
|
||||
static void LoadAudioDevice(const char *name, int channel, obs_data_t *parent)
|
||||
{
|
||||
obs_data_t *data = obs_data_get_obj(parent, name);
|
||||
|
||||
Reference in New Issue
Block a user