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:
Ilya M
2018-04-06 17:34:10 -07:00
committed by jp9000
parent 0dc9151dbd
commit 439b9e4d15
6 changed files with 43 additions and 1 deletions
+13
View File
@@ -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);