| 256 | } |
| 257 | |
| 258 | SceneSelection 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 | |
| 295 | static QStringList getOrderList(bool current, bool previous, bool preview) |
| 296 | { |
nothing calls this directly
no test coverage detected