From eac55edca0d61aad739fbe61a44450f46227dbdc Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 31 Dec 2014 15:26:02 -0800 Subject: [PATCH] libobs: Add obs_source_showing function This allows the ability to see whether the source is being displayed somewhere (though not necessarily active in the main output) --- libobs/obs-source.c | 5 +++++ libobs/obs.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 53c17c707..765c580ad 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -2064,6 +2064,11 @@ bool obs_source_active(const obs_source_t *source) return source ? source->activate_refs != 0 : false; } +bool obs_source_showing(const obs_source_t *source) +{ + return source ? source->show_refs != 0 : false; +} + static inline void signal_flags_updated(obs_source_t *source) { struct calldata data = {0}; diff --git a/libobs/obs.h b/libobs/obs.h index f03adcac0..496d2444f 100644 --- a/libobs/obs.h +++ b/libobs/obs.h @@ -735,6 +735,11 @@ EXPORT void obs_source_enum_tree(obs_source_t *source, /** Returns true if active, false if not */ EXPORT bool obs_source_active(const obs_source_t *source); +/** + * Returns true if currently displayed somewhere (active or not), false if not + */ +EXPORT bool obs_source_showing(const obs_source_t *source); + /** * Sometimes sources need to be told when to save their settings so they * don't have to constantly update and keep track of their settings. This will