mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
libobs: Add functions to show/hide sources
obs_source_inc_showing and obs_source_dec_showing are used to indicate that a source is showing or no longer being shown in a particular area of the program outside from the main render view. One could use an obs_view, but I felt like it was unnecessary because using an obs_view just to display a single source feels somewhat superfluous.
This commit is contained in:
parent
ab520cab25
commit
7055775c7c
|
@ -2334,3 +2334,13 @@ float obs_source_get_target_volume(obs_source_t *source, obs_source_t *target)
|
|||
|
||||
return info.vol;
|
||||
}
|
||||
|
||||
void obs_source_inc_showing(obs_source_t *source)
|
||||
{
|
||||
obs_source_activate(source, AUX_VIEW);
|
||||
}
|
||||
|
||||
void obs_source_dec_showing(obs_source_t *source)
|
||||
{
|
||||
obs_source_deactivate(source, AUX_VIEW);
|
||||
}
|
||||
|
|
14
libobs/obs.h
14
libobs/obs.h
|
@ -780,6 +780,20 @@ EXPORT void obs_source_set_audio_mixers(obs_source_t *source, uint32_t mixers);
|
|||
/** Gets audio mixer flags */
|
||||
EXPORT uint32_t obs_source_get_audio_mixers(const obs_source_t *source);
|
||||
|
||||
/**
|
||||
* Increments the 'showing' reference counter to indicate that the source is
|
||||
* being shown somewhere. If the reference counter was 0, will call the 'show'
|
||||
* callback.
|
||||
*/
|
||||
EXPORT void obs_source_inc_showing(obs_source_t *source);
|
||||
|
||||
/**
|
||||
* Decrements the 'showing' reference counter to indicate that the source is
|
||||
* no longer being shown somewhere. If the reference counter is set to 0,
|
||||
* will call the 'hide' callback
|
||||
*/
|
||||
EXPORT void obs_source_dec_showing(obs_source_t *source);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Functions used by sources */
|
||||
|
||||
|
|
Loading…
Reference in a new issue