MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / GetWeakTransitionByName

Function GetWeakTransitionByName

lib/utils/source-helpers.cpp:76–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76OBSWeakSource GetWeakTransitionByName(const char *transitionName)
77{
78 OBSWeakSource weak;
79 obs_source_t *source = nullptr;
80
81 if (strcmp(transitionName, "Default") == 0) {
82 source = obs_frontend_get_current_transition();
83 weak = obs_source_get_weak_source(source);
84 obs_source_release(source);
85 obs_weak_source_release(weak);
86 return weak;
87 }
88
89 obs_frontend_source_list *transitions = new obs_frontend_source_list();
90 obs_frontend_get_transitions(transitions);
91 bool match = false;
92
93 for (size_t i = 0; i < transitions->sources.num; i++) {
94 const char *name =
95 obs_source_get_name(transitions->sources.array[i]);
96 if (strcmp(transitionName, name) == 0) {
97 match = true;
98 source = transitions->sources.array[i];
99 break;
100 }
101 }
102
103 if (match) {
104 weak = obs_source_get_weak_source(source);
105 obs_weak_source_release(weak);
106 }
107 obs_frontend_source_list_free(transitions);
108
109 return weak;
110}
111
112OBSWeakSource GetWeakTransitionByQString(const QString &name)
113{

Callers 4

loadMethod · 0.85
getOverrideTransitionFunction · 0.85
LoadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected