summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-05-31 23:14:10 +0200
committerCarl Hetherington <cth@carlh.net>2025-06-17 00:04:03 +0200
commit4e60d6a68356aaf12c4ee1aef4d1bf1d15f5384b (patch)
treeead3b30b43b021d18c2c41038efa04fd343ad593 /src/lib
parent1bea93d20146af11330610ee159ec38c95347b3f (diff)
Cleanup: use an enum class.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc14
-rw-r--r--src/lib/config.h8
2 files changed, 11 insertions, 11 deletions
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<string>();
_gdc_username = optional<string>();
_gdc_password = optional<string>();
- _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 {