MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / parse_device_prep_option

Function parse_device_prep_option

src/display_device.cpp:271–289  ·  view source on GitHub ↗

* @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 };

Source from the content-addressed store, hash-verified

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.

Callers 1

parse_configurationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected