* @brief Parse device preparation option from the user configuration and the session information. * @param video_config User's video related configuration. * @returns Parsed device preparation value we need to use. * Empty optional if no preparation nor configuration shall take place. * * @examples * const config::video_t &video_config { config::video };
| 269 | * @examples_end |
| 270 | */ |
| 271 | std::optional<SingleDisplayConfiguration::DevicePreparation> parse_device_prep_option(const config::video_t &video_config) { |
| 272 | using enum config::video_t::dd_t::config_option_e; |
| 273 | using enum SingleDisplayConfiguration::DevicePreparation; |
| 274 | |
| 275 | switch (video_config.dd.configuration_option) { |
| 276 | case verify_only: |
| 277 | return VerifyOnly; |
| 278 | case ensure_active: |
| 279 | return EnsureActive; |
| 280 | case ensure_primary: |
| 281 | return EnsurePrimary; |
| 282 | case ensure_only_display: |
| 283 | return EnsureOnlyDisplay; |
| 284 | case disabled: |
| 285 | break; |
| 286 | } |
| 287 | |
| 288 | return std::nullopt; |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * @brief Parse resolution option from the user configuration and the session information. |
no outgoing calls
no test coverage detected