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:
parent
0dc9151dbd
commit
439b9e4d15
6 changed files with 43 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue