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

Method CurrentSelection

lib/utils/scene-selection.cpp:258–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258SceneSelection SceneSelectionWidget::CurrentSelection()
259{
260 SceneSelection s;
261
262 s._canvas = _forceMainCanvas ? OBSWeakCanvas(getWeakRefToMainCanvas())
263 : _canvas->GetCanvas();
264
265 const int idx = _scenes->currentIndex();
266 const auto name = _scenes->currentText();
267 if (idx == -1 || name.isEmpty()) {
268 return s;
269 }
270
271 if (idx < _placeholderEndIdx) {
272 if (IsCurrentSceneSelected(name)) {
273 s._type = SceneSelection::Type::CURRENT;
274 }
275 if (IsPreviousSceneSelected(name)) {
276 s._type = SceneSelection::Type::PREVIOUS;
277 }
278 if (IsPreviewSceneSelected(name)) {
279 s._type = SceneSelection::Type::PREVIEW;
280 }
281 } else if (idx < _variablesEndIdx) {
282 s._type = SceneSelection::Type::VARIABLE;
283 s._variable = GetWeakVariableByQString(name);
284 } else if (idx < _groupsEndIdx) {
285 s._type = SceneSelection::Type::GROUP;
286 s._group = GetSceneGroupByQString(name);
287 } else if (idx < _scenesEndIdx) {
288 s._type = SceneSelection::Type::SCENE;
289 s._scene = getWeakSceneSourceByName(s._canvas,
290 name.toStdString().c_str());
291 }
292 return s;
293}
294
295static QStringList getOrderList(bool current, bool previous, bool preview)
296{

Callers

nothing calls this directly

Calls 6

getWeakRefToMainCanvasFunction · 0.85
GetWeakVariableByQStringFunction · 0.85
GetSceneGroupByQStringFunction · 0.85
getWeakSceneSourceByNameFunction · 0.85
GetCanvasMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected