utility: Add functions to check the state of tristates

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-11-16 21:18:58 +01:00
parent 59e33a132b
commit 65dddb5aa8
+12
View File
@@ -100,4 +100,16 @@ namespace obsffmpeg {
}; };
obs_property_t* obs_properties_add_tristate(obs_properties_t* props, const char* name, const char* desc); obs_property_t* obs_properties_add_tristate(obs_properties_t* props, const char* name, const char* desc);
inline bool is_tristate_enabled(int64_t tristate) {
return tristate == 1;
}
inline bool is_tristate_disabled(int64_t tristate) {
return tristate == 0;
}
inline bool is_tristate_default(int64_t tristate) {
return tristate == -1;
}
} // namespace obsffmpeg } // namespace obsffmpeg