diff --git a/src/obs-source-util.h b/src/obs-source-util.h index 4f2c480..32f6d84 100644 --- a/src/obs-source-util.h +++ b/src/obs-source-util.h @@ -12,8 +12,8 @@ inline bool is_obs_source_text(obs_source_t *source) return false; } const auto source_id = obs_source_get_id(source); - return strcmp(source_id, "text_ft2_source_v2") == 0 || - strcmp(source_id, "text_gdiplus_v2") == 0; + return strncmp(source_id, "text_ft2_source", 15) == 0 || + strncmp(source_id, "text_gdiplus", 12) == 0; } inline bool is_obs_source_text(const std::string &source_name) diff --git a/src/ui/RequestBuilder.cpp b/src/ui/RequestBuilder.cpp index d3bdac8..a780347 100644 --- a/src/ui/RequestBuilder.cpp +++ b/src/ui/RequestBuilder.cpp @@ -37,7 +37,6 @@ void set_form_row_visibility(QFormLayout *layout, QWidget *widget, bool visible) bool add_sources_to_qcombobox(void *list, obs_source_t *source) { - const auto source_id = obs_source_get_id(source); // add all text sources and sources that produce an image (by checking source.output_flags = OBS_SOURCE_VIDEO) if (!is_obs_source_text(source) && ((obs_source_get_output_flags(source) & OBS_SOURCE_VIDEO) == 0)) { @@ -46,8 +45,9 @@ bool add_sources_to_qcombobox(void *list, obs_source_t *source) std::string name = obs_source_get_name(source); std::string prefix = ""; - if (strcmp(source_id, "text_ft2_source_v2") == 0 || - strcmp(source_id, "text_gdiplus_v2") == 0) + const auto source_id = obs_source_get_id(source); + if (strncmp(source_id, "text_ft2_source", 15) == 0 || + strncmp(source_id, "text_gdiplus", 12) == 0) prefix = "(Text) "; else prefix = "(Image) "; diff --git a/src/ui/obs-ui-utils.cpp b/src/ui/obs-ui-utils.cpp index 2a83bea..6b2e047 100644 --- a/src/ui/obs-ui-utils.cpp +++ b/src/ui/obs-ui-utils.cpp @@ -11,10 +11,9 @@ bool add_sources_to_combobox(void *list_property, obs_source_t *source) { // add all text and media sources to the list auto source_id = obs_source_get_id(source); - if (strcmp(source_id, "text_ft2_source_v2") != 0 && - strcmp(source_id, "text_gdiplus_v2") != 0 && - strcmp(source_id, "text_gdiplus_v3") != 0 && strcmp(source_id, "ffmpeg_source") != 0 && - strcmp(source_id, "image_source") != 0) { + if (strncmp(source_id, "text_ft2_source", 15) != 0 && + strncmp(source_id, "text_gdiplus", 12) != 0 && + strcmp(source_id, "ffmpeg_source") != 0 && strcmp(source_id, "image_source") != 0) { return true; } @@ -22,9 +21,8 @@ bool add_sources_to_combobox(void *list_property, obs_source_t *source) const char *name = obs_source_get_name(source); std::string name_with_prefix; // add a prefix to the name to indicate the source type - if (strcmp(source_id, "text_ft2_source_v2") == 0 || - strcmp(source_id, "text_gdiplus_v3") == 0 || - strcmp(source_id, "text_gdiplus_v2") == 0) { + if (strncmp(source_id, "text_ft2_source", 15) == 0 || + strncmp(source_id, "text_gdiplus", 12) == 0) { name_with_prefix = std::string("(Text) ").append(name); } else if (strcmp(source_id, "image_source") == 0) { name_with_prefix = std::string("(Image) ").append(name);