UI: Fix filter props. getting recreated unnecessarily

Closes obsproject/obs-studio#5846
This commit is contained in:
jp9000
2022-02-02 22:15:26 -08:00
parent 4b355192e7
commit f0e631df17
2 changed files with 25 additions and 1 deletions

View File

@@ -170,4 +170,20 @@ public:
inline bool DeferUpdate() const { return deferUpdate; }
inline OBSObject GetObject() const { return OBSGetStrongRef(weakObj); }
#define Def_IsObject(type) \
inline bool IsObject(obs_##type##_t *type) const \
{ \
OBSObject obj = OBSGetStrongRef(weakObj); \
return obj.Get() == (obs_object_t *)type; \
}
/* clang-format off */
Def_IsObject(source)
Def_IsObject(output)
Def_IsObject(encoder)
Def_IsObject(service)
/* clang-format off */
#undef Def_IsObject
};