Ver Fonte

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)
jp9000 há 10 anos atrás
pai
commit
eac55edca0
2 ficheiros alterados com 10 adições e 0 exclusões
  1. 5 0
      libobs/obs-source.c
  2. 5 0
      libobs/obs.h

+ 5 - 0
libobs/obs-source.c

@@ -2064,6 +2064,11 @@ bool obs_source_active(const obs_source_t *source)
 	return source ? source->activate_refs != 0 : false;
 	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)
 static inline void signal_flags_updated(obs_source_t *source)
 {
 {
 	struct calldata data = {0};
 	struct calldata data = {0};

+ 5 - 0
libobs/obs.h

@@ -735,6 +735,11 @@ EXPORT void obs_source_enum_tree(obs_source_t *source,
 /** Returns true if active, false if not */
 /** Returns true if active, false if not */
 EXPORT bool obs_source_active(const obs_source_t *source);
 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
  * 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
  * don't have to constantly update and keep track of their settings.  This will