From 4e60d6a68356aaf12c4ee1aef4d1bf1d15f5384b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 31 May 2025 23:14:10 +0200 Subject: Cleanup: use an enum class. --- src/lib/config.cc | 14 +++++++------- src/lib/config.h | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/lib') diff --git a/src/lib/config.cc b/src/lib/config.cc index 66a0e1a5a..d8402e2ec 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -184,7 +184,7 @@ Config::set_defaults() _christie_password = optional(); _gdc_username = optional(); _gdc_password = optional(); - _player_mode = PLAYER_MODE_WINDOW; + _player_mode = PlayerMode::WINDOW; _player_restricted_menus = false; _playlist_editor_restricted_menus = false; _image_display = 0; @@ -604,11 +604,11 @@ try auto pm = f.optional_string_child("PlayerMode"); if (pm && *pm == "window") { - _player_mode = PLAYER_MODE_WINDOW; + _player_mode = PlayerMode::WINDOW; } else if (pm && *pm == "full") { - _player_mode = PLAYER_MODE_FULL; + _player_mode = PlayerMode::FULL; } else if (pm && *pm == "dual") { - _player_mode = PLAYER_MODE_DUAL; + _player_mode = PlayerMode::DUAL; } _player_restricted_menus = f.optional_bool_child("PlayerRestrictedMenus").get_value_or(false); @@ -1062,13 +1062,13 @@ Config::write_config() const with separate (advanced) controls. */ switch (_player_mode) { - case PLAYER_MODE_WINDOW: + case PlayerMode::WINDOW: cxml::add_text_child(root, "PlayerMode", "window"); break; - case PLAYER_MODE_FULL: + case PlayerMode::FULL: cxml::add_text_child(root, "PlayerMode", "full"); break; - case PLAYER_MODE_DUAL: + case PlayerMode::DUAL: cxml::add_text_child(root, "PlayerMode", "dual"); break; } diff --git a/src/lib/config.h b/src/lib/config.h index c90790ebc..9f6d1c743 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -536,10 +536,10 @@ public: return _gdc_password; } - enum PlayerMode { - PLAYER_MODE_WINDOW, ///< one window containing image and controls - PLAYER_MODE_FULL, ///< just the image filling the screen - PLAYER_MODE_DUAL ///< image on one monitor and extended controls on the other + enum class PlayerMode { + WINDOW, ///< one window containing image and controls + FULL, ///< just the image filling the screen + DUAL ///< image on one monitor and extended controls on the other }; PlayerMode player_mode() const { -- cgit v1.2.3