| 129 | } |
| 130 | |
| 131 | std::string FilterSelection::ToString(bool resolve) const |
| 132 | { |
| 133 | switch (_type) { |
| 134 | case Type::ALL: |
| 135 | return obs_module_text("AdvSceneSwitcher.filterSelection.all"); |
| 136 | case Type::SOURCE: |
| 137 | return _filter ? GetWeakSourceName(_filter) : _filterName; |
| 138 | case Type::VARIABLE: { |
| 139 | auto var = _variable.lock(); |
| 140 | if (!var) { |
| 141 | return ""; |
| 142 | } |
| 143 | if (resolve) { |
| 144 | return var->Name() + "[" + var->Value() + "]"; |
| 145 | } |
| 146 | return var->Name(); |
| 147 | } |
| 148 | default: |
| 149 | break; |
| 150 | } |
| 151 | return ""; |
| 152 | } |
| 153 | |
| 154 | FilterSelection FilterSelectionWidget::CurrentSelection() |
| 155 | { |
no test coverage detected