libobs: Add obs_source_reset_settings()
Allows the ability to reset (erase) a source's existing settings and replace them with new settings. This is useful for things such as reverting to older settings.
This commit is contained in:
parent
5f7e81d628
commit
60447872c0
@ -818,6 +818,13 @@ General Source Functions
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: void obs_source_reset_settings(obs_source_t *source, obs_data_t *settings)
|
||||
|
||||
Same as :c:func:`obs_source_update`, but clears existing settings
|
||||
first.
|
||||
|
||||
---------------------
|
||||
|
||||
.. function:: void obs_source_video_render(obs_source_t *source)
|
||||
|
||||
Renders a video source. This will call the
|
||||
|
@ -941,6 +941,15 @@ void obs_source_update(obs_source_t *source, obs_data_t *settings)
|
||||
}
|
||||
}
|
||||
|
||||
void obs_source_reset_settings(obs_source_t *source, obs_data_t *settings)
|
||||
{
|
||||
if (!obs_source_valid(source, "obs_source_reset_settings"))
|
||||
return;
|
||||
|
||||
obs_data_clear(source->context.settings);
|
||||
obs_source_update(source, settings);
|
||||
}
|
||||
|
||||
void obs_source_update_properties(obs_source_t *source)
|
||||
{
|
||||
if (!obs_source_valid(source, "obs_source_update_properties"))
|
||||
|
@ -942,6 +942,8 @@ EXPORT obs_properties_t *obs_source_properties(const obs_source_t *source);
|
||||
|
||||
/** Updates settings for this source */
|
||||
EXPORT void obs_source_update(obs_source_t *source, obs_data_t *settings);
|
||||
EXPORT void obs_source_reset_settings(obs_source_t *source,
|
||||
obs_data_t *settings);
|
||||
|
||||
/** Renders a video source. */
|
||||
EXPORT void obs_source_video_render(obs_source_t *source);
|
||||
|
Loading…
x
Reference in New Issue
Block a user